Re: [PATCH v6 4/4] i2c: npcm: Enable slave in eob interrupt

From: Andy Shevchenko
Date: Fri Oct 11 2024 - 07:02:39 EST


On Fri, Oct 11, 2024 at 01:52:31PM +0800, Tyrone Ting wrote:
> From: Charles Boyer <Charles.Boyer@xxxxxxxxxxx>
>
> 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.

...

> +#if IS_ENABLED(CONFIG_I2C_SLAVE)
> + /* reenable slave if it was enabled */
> + if (bus->slave)
> + iowrite8((bus->slave->addr & 0x7F) | NPCM_I2CADDR_SAEN,

GENMASK()?
But why do we need it? Do we expect this to be 10-bit address or...?

> + bus->reg + NPCM_I2CADDR1);
> +#endif

--
With Best Regards,
Andy Shevchenko