public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] i2c: provide and use i2c_adapter_set_node()
@ 2026-02-23  9:08 Bartosz Golaszewski
  2026-02-23  9:08 ` [PATCH v2 1/9] i2c: provide i2c_adapter_set_node() Bartosz Golaszewski
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Bartosz Golaszewski @ 2026-02-23  9:08 UTC (permalink / raw)
  To: Wolfram Sang, Mika Westerberg, Andy Shevchenko, Jan Dabros,
	Andi Shyti, Lixu Zhang, Sakari Ailus, Binbin Zhou,
	Fabrizio Castro, Israel Cepeda, Hans de Goede, Nirujogi Pratap,
	Bin Du, Hans Hu
  Cc: Bartosz Golaszewski, linux-i2c, linux-kernel, linux-renesas-soc,
	Bartosz Golaszewski

It's been another year of discussing the object life-time problems at
conferences. I2C is one of the offenders and its problems are more
complex than those of some other subsystems. It seems the revocable[1]
API may make its way into the kernel this year but even with it in
place, I2C won't be able to use it as there's currently nothing to
*revoke*. The struct device is embedded within the i2c_adapter struct
whose lifetime is tied to the provider device being bound to its driver.

Fixing this won't be fast and easy but nothing's going to happen if we
don't start chipping away at it. The ultimate goal in order to be able
to use an SRCU-based solution (revocable or otherwise) is to convert the
embedded struct device in struct i2c_adapter into an __rcu pointer that
can be *revoked*. To that end we need to hide all dereferences of
adap->dev in drivers.

I2C drivers use device_set_node() to assign a firmware node directly to
the struct device embedded in i2c_adapter. In order to hide the direct
dereferencing: provide a dedicated interface that wraps the call to
device_set_node() but takes the adapter as argument instead.

Link: https://lore.kernel.org/all/20251106152330.11733-1-tzungbi@kernel.org/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v2:
- add patches replacing ACPI_COMPANION_SET() with i2c_adapter_set_node()
- rebased on top of v7.0-rc1
- collected tags
- Link to v1: https://lore.kernel.org/r/20251223-i2c-ada-dev-set-node-v1-0-2e36e0e785b4@oss.qualcomm.com

---
Bartosz Golaszewski (9):
      i2c: provide i2c_adapter_set_node()
      i2c: designware-common: use i2c_adapter_set_node()
      i2c: gpio: use i2c_adapter_set_node()
      i2c: ljca: use i2c_adapter_set_node()
      i2c: ls2x: use i2c_adapter_set_node()
      i2c: rzv2m: use i2c_adapter_set_node()
      i2c: usbio: use i2c_adapter_set_node()
      i2c: designware-amdisp: use i2c_adapter_set_node()
      i2c: viai2c-zhaoxin: use i2c_adapter_set_node()

 drivers/i2c/busses/i2c-designware-amdisp.c | 2 +-
 drivers/i2c/busses/i2c-designware-common.c | 2 +-
 drivers/i2c/busses/i2c-gpio.c              | 2 +-
 drivers/i2c/busses/i2c-ljca.c              | 2 +-
 drivers/i2c/busses/i2c-ls2x.c              | 2 +-
 drivers/i2c/busses/i2c-rzv2m.c             | 2 +-
 drivers/i2c/busses/i2c-usbio.c             | 2 +-
 drivers/i2c/busses/i2c-viai2c-zhaoxin.c    | 2 +-
 include/linux/i2c.h                        | 7 +++++++
 9 files changed, 15 insertions(+), 8 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20251223-i2c-ada-dev-set-node-0636a8d3666c

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>


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

end of thread, other threads:[~2026-02-26 20:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23  9:08 [PATCH v2 0/9] i2c: provide and use i2c_adapter_set_node() Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 1/9] i2c: provide i2c_adapter_set_node() Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 2/9] i2c: designware-common: use i2c_adapter_set_node() Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 3/9] i2c: gpio: " Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 4/9] i2c: ljca: " Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 5/9] i2c: ls2x: " Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 6/9] i2c: rzv2m: " Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 7/9] i2c: usbio: " Bartosz Golaszewski
2026-02-23  9:08 ` [PATCH v2 8/9] i2c: designware-amdisp: " Bartosz Golaszewski
2026-02-23 11:46   ` Andy Shevchenko
2026-02-23 12:23     ` Bartosz Golaszewski
2026-02-26 20:24       ` Wolfram Sang
2026-02-23  9:08 ` [PATCH v2 9/9] i2c: viai2c-zhaoxin: " Bartosz Golaszewski
2026-02-26 20:25 ` [PATCH v2 0/9] i2c: provide and " Wolfram Sang

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