i2c: npcm: Enable slave in eob interrupt
Subsystems (2)
PATCH v3 6/6 i2c: npcm: Enable slave in eob interrupt
From: Charles Boyer <[email protected]>
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.
--- drivers/i2c/busses/i2c-npcm7xx.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/i2c/busses/i2c-npcm7xx.c +6 -0
@@ -1781,6 +1781,12 @@ static int npcm_i2c_int_master_handler(struct npcm_i2c *bus) (FIELD_GET(NPCM_I2CCST3_EO_BUSY, ioread8(bus->reg + NPCM_I2CCST3)))) {npcm_i2c_irq_handle_eob (bus); +#if IS_ENABLED (CONFIG_I2C_SLAVE ) +/* reenable slave if it was enabled */ +if (bus->slave) +iowrite8 ((bus->slave->addr &0x7F ) |NPCM_I2CADDR_SAEN , + bus->reg +NPCM_I2CADDR1 ); +#endif return 0 ; }
Signature · 1 line
2.34.1
Quoted 10 lines · Tyrone Ting
From: Charles Boyer <[email protected]>
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.
Fixes tag?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi Andy:
Thank you for your feedback.
Andy Shevchenko <[email protected]> 於 2024年9月13日 週五 下午6:29寫道:
Quoted 9 lines · Tyrone Ting
Quoted 7 lines
From: Charles Boyer <[email protected]>
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.
Quoted 6 lines
Quoted 3 lines
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.
Fixes tag?
The patch is to reduce the time for the i2c module to behave as a target. IOW, the i2c module target function will be ready earlier than it was. So I remove the Fixes tag.
Quoted 5 lines
--
With Best Regards,
Andy Shevchenko
Thank you.
Regards,
Tyrone