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

William A. Kennington III posted 4 patches 1 week, 4 days ago
drivers/i2c/busses/i2c-designware-common.c  | 32 +++++++++++++++++++++++++++++
drivers/i2c/busses/i2c-designware-core.h    |  1 +
drivers/i2c/busses/i2c-designware-master.c  | 31 +++++++++++++++++-----------
drivers/i2c/busses/i2c-designware-pcidrv.c  | 14 +++++++++++++
drivers/i2c/busses/i2c-designware-platdrv.c | 14 +++++++++++++
5 files changed, 80 insertions(+), 12 deletions(-)
[PATCH RESEND v5 0/4] i2c: designware: Improve device disable handling
Posted by William A. Kennington III 1 week, 4 days ago
When the I2C controller attempts a new transaction while the target
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 target
activity is detected.

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

Signed-off-by: William A. Kennington III <william@wkennington.com>
---
Changes in v5:
- Fixed one last inclusive language mistake
- Link to v4: https://lore.kernel.org/r/20260507-dw-i2c-v4-0-9a447b23bfdf@wkennington.com
Changes in v4:
- Updated language to use inclusive terms
- Refactored some minor comment / code nits
- Link to v3: https://lore.kernel.org/r/20260504-dw-i2c-v3-0-57e56135d602@wkennington.com
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

---
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 target cleanly

 drivers/i2c/busses/i2c-designware-common.c  | 32 +++++++++++++++++++++++++++++
 drivers/i2c/busses/i2c-designware-core.h    |  1 +
 drivers/i2c/busses/i2c-designware-master.c  | 31 +++++++++++++++++-----------
 drivers/i2c/busses/i2c-designware-pcidrv.c  | 14 +++++++++++++
 drivers/i2c/busses/i2c-designware-platdrv.c | 14 +++++++++++++
 5 files changed, 80 insertions(+), 12 deletions(-)
---
base-commit: 5d6919055dec134de3c40167a490f33c74c12581
change-id: 20260504-dw-i2c-d5a1b1a0036a

Best regards,
-- 
William A. Kennington III <william@wkennington.com>
Re: [PATCH RESEND v5 0/4] i2c: designware: Improve device disable handling
Posted by Andi Shyti 1 week, 3 days ago
Hi William,

> 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 target cleanly

merged to i2c/i2c-host.

Thanks,
Andi
Re: [PATCH RESEND v5 0/4] i2c: designware: Improve device disable handling
Posted by Mika Westerberg 1 week, 4 days ago
Hi,

On Wed, May 27, 2026 at 08:09:48PM +0000, William A. Kennington III wrote:
> When the I2C controller attempts a new transaction while the target
> 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 target
> activity is detected.
> 
> Additionally, it adds a shutdown hook that gracefully sets the target
> disable bit before disabling the controller. This guarantees that any
> incoming requests from the controller are immediately NACKed during
> shutdown, preventing the bus from hanging.
> 
> Signed-off-by: William A. Kennington III <william@wkennington.com>
> ---
> Changes in v5:
> - Fixed one last inclusive language mistake
> - Link to v4: https://lore.kernel.org/r/20260507-dw-i2c-v4-0-9a447b23bfdf@wkennington.com
> Changes in v4:
> - Updated language to use inclusive terms
> - Refactored some minor comment / code nits
> - Link to v3: https://lore.kernel.org/r/20260504-dw-i2c-v3-0-57e56135d602@wkennington.com
> 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
> 
> ---
> 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 target cleanly

For the series,

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>