Skip to content

Commit 8b56f98

Browse files
boyerceeAndi Shyti
authored andcommitted
i2c: npcm: Enable slave in eob interrupt
Nuvoton slave enable was in user space API call master_xfer, so it is subject to delays from the OS scheduler. If the BMC is not enabled for slave mode in time for master to send response, then it will NAK the address match. Then the PLDM request timeout occurs. If the slave enable is moved to the EOB interrupt service routine, then the BMC can be ready in slave mode by the time it needs to receive a response. Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com> Signed-off-by: Vivekanand Veeracholan <vveerach@google.com> Signed-off-by: Tyrone Ting <kfting@nuvoton.com> Reviewed-by: Tali Perry <tali.perry1@gmail.com> Link: https://lore.kernel.org/r/20241219090859.18722-5-kfting@nuvoton.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 6ddc913 commit 8b56f98

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/i2c/busses/i2c-npcm7xx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,12 @@ static int npcm_i2c_int_master_handler(struct npcm_i2c *bus)
19251925
(FIELD_GET(NPCM_I2CCST3_EO_BUSY,
19261926
ioread8(bus->reg + NPCM_I2CCST3)))) {
19271927
npcm_i2c_irq_handle_eob(bus);
1928+
#if IS_ENABLED(CONFIG_I2C_SLAVE)
1929+
/* reenable slave if it was enabled */
1930+
if (bus->slave)
1931+
iowrite8(bus->slave->addr | NPCM_I2CADDR_SAEN,
1932+
bus->reg + NPCM_I2CADDR1);
1933+
#endif
19281934
return 0;
19291935
}
19301936

0 commit comments

Comments
 (0)