Re: [PATCH v3 4/4] i2c: designware: Handle active slave cleanly

From: Andy Shevchenko

Date: Tue May 05 2026 - 03:35:00 EST


On Mon, May 04, 2026 at 08:15:05PM +0000, William A. Kennington III wrote:
> When the I2C master attempts a new transaction while the slave
> controller is shutting down or restarting, it can lead to bus lockups
> and system bootloops if the hardware enters an inconsistent state.
>
> Address this by ensuring that the internal state machines are properly
> cleared when disabling the controller if slave activity is detected.
>
> If the controller remains active after disabling, perform a bus recovery
> to reset it to a known good state.

...

> #define DW_IC_STATUS_ACTIVITY BIT(0)
> #define DW_IC_STATUS_TFE BIT(2)
> #define DW_IC_STATUS_RFNE BIT(3)
> -#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
> -#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)
> +#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
> +#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)

If you wish to fix some indentation issues, combine these with the one from the
second patch and make it a separate change (as a last patch in the series).

> #define DW_IC_STATUS_MASTER_HOLD_TX_FIFO_EMPTY BIT(7)

--
With Best Regards,
Andy Shevchenko