Skip to content

i2c: provide and use i2c_adapter_set_node()

Bartosz Golaszewski linux-i2c linux-renesas-soc lkml 2 versions – Applied

Status from this message: Applied to for-current, squashed...

Get series with b4
b4 am [email protected] change-id 20251223-i2c-ada-dev-set-node-0636a8d3666c

Versions newest first

  1. v2 Latest9 patches 4 repliesApplied
  2. v17 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- 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/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9i2c: provide i2c_adapter_set_node()include/linux/i2c.h+7 -00 replies
2/9i2c: designware-common: use i2c_adapter_set_node()drivers/i2c/busses/i2c-designware-common.c+1 -10 replies
3/9i2c: gpio: use i2c_adapter_set_node()drivers/i2c/busses/i2c-gpio.c+1 -10 replies
4/9i2c: ljca: use i2c_adapter_set_node()drivers/i2c/busses/i2c-ljca.c+1 -10 replies
5/9i2c: ls2x: use i2c_adapter_set_node()drivers/i2c/busses/i2c-ls2x.c+1 -10 replies
6/9i2c: rzv2m: use i2c_adapter_set_node()drivers/i2c/busses/i2c-rzv2m.c+1 -10 replies
7/9i2c: usbio: use i2c_adapter_set_node()drivers/i2c/busses/i2c-usbio.c+1 -10 replies
8/9i2c: designware-amdisp: use i2c_adapter_set_node()drivers/i2c/busses/i2c-designware-amdisp.c+1 -13 replies
9/9i2c: viai2c-zhaoxin: use i2c_adapter_set_node()drivers/i2c/busses/i2c-viai2c-zhaoxin.c+1 -10 replies

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoMika WesterbergSakari AilusZhang LixuBinbin ZhouFabrizio Castro
1/9R-b
2/9R-b A-b
3/9R-b
4/9R-b A-b R-b
5/9R-b R-b
6/9R-b R-b
7/9R-b R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/9] i2c: provide and use i2c_adapter_set_node()

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.

---
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/[email protected]

---
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,

Signature · 1 line
Bartosz Golaszewski <[email protected]>