Linux I2C development
 help / color / mirror / Atom feed
* [PATCH v6 0/1] i2c: designware: defer probe if child GpioInt controllers are not bound
@ 2026-05-23 17:44 Hardik Prakash
  2026-05-23 17:44 ` [PATCH v6 1/1] " Hardik Prakash
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Hardik Prakash @ 2026-05-23 17:44 UTC (permalink / raw)
  To: linux-i2c
  Cc: linux-gpio, wsa, andriy.shevchenko, mario.limonciello, brgl,
	basavaraj.natikar, linus.walleij, Hardik Prakash

Patch 1/2 (pinctrl-amd GPIO IRQ fix) is already in Linus Walleij's
tree. This replaces patch 2 with a generic solution suggested by
Mario Limonciello.

The root cause: i2c_designware probes AMDI0010:02 before pinctrl-amd
completes. Dynamic debug tracing confirmed the race:

  0.285952  amd_gpio_probe: registering gpiochip  <- GPIO chip visible
  0.287121  amd_gpio_probe: requesting parent IRQ <- probe still running
  0.301454  AMDI0010:02 dw_i2c_plat_probe: start  <- races here
  2.348157  lost arbitration

Previous attempts to fix this via initcall promotion (subsys_initcall,
fs_initcall, arch_initcall) all failed because the race is not about
when the driver registers but about when probe completes. The GPIO chip
becomes visible to the system via gpiochip_add_data() before
amd_gpio_probe() finishes, and i2c-designware probes AMDI0010:02 in
that window.

This patch adds a generic check that walks ACPI child devices, finds
any GpioInt resources, and defers probe if the referenced GPIO
controllers are not yet fully bound. No DMI matching required.

v6:
 - Replace DMI-specific deferral with generic GpioInt dependency check
   walking ACPI child devices (suggested by Mario Limonciello)

v5:
 - Add blank line before #include <linux/acpi.h> (Bartosz Golaszewski)
 - Use scoped_guard(device, gpio_dev) (Bartosz Golaszewski)

v4:
 - Rebase onto Linus Walleij's tree (patch 1 already there)
 - Use --base so series is correctly 1/1 (Andy Shevchenko)
 - Add subsys_initcall test results (Mario Limonciello)

v3:
 - Fix variable declaration style in dw_i2c_needs_amd_gpio_dep (Andy Shevchenko)
 - Add BugLink tag (Andy Shevchenko)
 - CC AMD engineers (Andy Shevchenko)

v2:
 - Replace custom HID/UID lookup with acpi_dev_get_first_match_dev()
 - Use device_is_bound() under device_lock() with explanatory comments
 - Add Assisted-by tags per coding-assistants.rst

Kernel bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=221494
Related: https://bugzilla.kernel.org/show_bug.cgi?id=221454

Hardik Prakash (1):
  i2c: designware: defer probe if child GpioInt controllers are not
    bound

 drivers/i2c/busses/i2c-designware-platdrv.c | 157 ++++++++++++++++++++
 1 file changed, 157 insertions(+)

base-commit: 3812a9e84265a5cdd90d29fe8d97a023e91fb945

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-05-29  7:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-23 17:44 [PATCH v6 0/1] i2c: designware: defer probe if child GpioInt controllers are not bound Hardik Prakash
2026-05-23 17:44 ` [PATCH v6 1/1] " Hardik Prakash
2026-05-24  1:47   ` kernel test robot
2026-05-24  5:40     ` Hardik Prakash
2026-05-26 10:42   ` Bartosz Golaszewski
2026-05-28 21:24     ` Mario Limonciello
2026-05-29  6:56       ` Hardik Prakash
2026-05-29  7:23         ` Mario Limonciello
2026-05-23 17:57 ` [PATCH v6 0/1] " Mario Limonciello
2026-05-26  9:41 ` Bartosz Golaszewski
2026-05-26 10:05   ` Hardik Prakash

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox