[PATCH v3 0/4] i2c: designware: Improve device disable handling

William A. Kennington III posted 4 patches 1 month, 1 week ago
There is a newer version of this series
drivers/i2c/busses/i2c-designware-common.c  | 32 +++++++++++++++++++++++++++++
drivers/i2c/busses/i2c-designware-core.h    |  5 +++--
drivers/i2c/busses/i2c-designware-master.c  | 31 +++++++++++++++++-----------
drivers/i2c/busses/i2c-designware-pcidrv.c  | 15 +++++++++++++-
drivers/i2c/busses/i2c-designware-platdrv.c | 13 ++++++++++++
5 files changed, 81 insertions(+), 15 deletions(-)
[PATCH v3 0/4] i2c: designware: Improve device disable handling
Posted by William A. Kennington III 1 month, 1 week ago
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.

This patch series addresses this by ensuring that the internal state
machines are properly cleared when disabling the controller if slave
activity is detected.

Additionally, it adds a shutdown hook that gracefully sets the slave
disable bit before disabling the controller. This guarantees that any
incoming requests from the master are immediately NACKed during
shutdown, preventing the bus from hanging.

--- 
Changes in v3:
- Split the monolithic patch into 4 logical patches
- Reverted stray formatting change in the PCI driver's dw_i2c_driver struct.
Changes in v2:
- Fix description footers
- Fix emails

Signed-off-by: William A. Kennington III <william@wkennington.com>
---
William A. Kennington III (4):
      i2c: designware: Introduce shutdown exported function
      i2c: designware: Convert PCI driver to use shutdown hook
      i2c: designware: Convert platform driver to use shutdown hook
      i2c: designware: Handle active slave cleanly

 drivers/i2c/busses/i2c-designware-common.c  | 32 +++++++++++++++++++++++++++++
 drivers/i2c/busses/i2c-designware-core.h    |  5 +++--
 drivers/i2c/busses/i2c-designware-master.c  | 31 +++++++++++++++++-----------
 drivers/i2c/busses/i2c-designware-pcidrv.c  | 15 +++++++++++++-
 drivers/i2c/busses/i2c-designware-platdrv.c | 13 ++++++++++++
 5 files changed, 81 insertions(+), 15 deletions(-)
---
base-commit: 6d35786de28116ecf78797a62b84e6bf3c45aa5a
change-id: 20260504-dw-i2c-d5a1b1a0036a

Best regards,
-- 
William A. Kennington III <william@wkennington.com>
Re: [PATCH v3 0/4] i2c: designware: Improve device disable handling
Posted by Andy Shevchenko 1 month, 1 week ago
On Mon, May 04, 2026 at 08:15:01PM +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.
> 
> This patch series addresses this by ensuring that the internal state
> machines are properly cleared when disabling the controller if slave
> activity is detected.
> 
> Additionally, it adds a shutdown hook that gracefully sets the slave
> disable bit before disabling the controller. This guarantees that any
> incoming requests from the master are immediately NACKed during
> shutdown, preventing the bus from hanging.

In general series looks good, just some style issues, see individual replies.
If you address them as suggested, I will give my tag against v4.

-- 
With Best Regards,
Andy Shevchenko