public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/13] i2c: add and start using i2c_adapter-specific printk helpers
@ 2026-02-23  8:59 Bartosz Golaszewski
  2026-02-23  8:59 ` [PATCH v2 01/13] media: saa7134: rename i2c_dbg() to saa7134_i2c_dbg() Bartosz Golaszewski
                   ` (14 more replies)
  0 siblings, 15 replies; 37+ messages in thread
From: Bartosz Golaszewski @ 2026-02-23  8:59 UTC (permalink / raw)
  To: Wolfram Sang, Andi Shyti, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Khalil Blaiech, Asmaa Mnebhi, Jean Delvare,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andreas Färber,
	Manivannan Sadhasivam, Mauro Carvalho Chehab
  Cc: linux-i2c, linux-kernel, linux-arm-kernel, linux-sunxi,
	linuxppc-dev, linux-actions, Bartosz Golaszewski, linux-media,
	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.

This series addresses the usage of adap->dev in device printk() helpers
(dev_err() et al). It introduces a set of i2c-specific helpers and
starts using them across bus drivers. For now just 12 patches but I'll
keep on doing it if these get accepted. Once these get upstream for
v6.20/7.0, we'll be able to also start converting i2c drivers outside of
drivers/i2c/.

Link: [1] 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 a patch renaming an existing i2c_dbg() macro in a media driver
- Link to v1: https://lore.kernel.org/r/20251223-i2c-printk-helpers-v1-0-46a08306afdb@oss.qualcomm.com

---
Bartosz Golaszewski (13):
      media: saa7134: rename i2c_dbg() to saa7134_i2c_dbg()
      i2c: add i2c_adapter-specific printk helpers
      i2c: sun6i-p2wi: use i2c_adapter-specific printk helpers
      i2c: mlxbf: use i2c_adapter-specific printk helpers
      i2c: isch: use i2c_adapter-specific printk helpers
      i2c: ali1535: use i2c_adapter-specific printk helpers
      i2c: scmi: use i2c_adapter-specific printk helpers
      i2c: ali15x3: use i2c_adapter-specific printk helpers
      i2c: powermac: use i2c_adapter-specific printk helpers
      i2c: owl: use i2c_adapter-specific printk helpers
      i2c: nforce2: use i2c_adapter-specific printk helpers
      i2c: amd756: use i2c_adapter-specific printk helpers
      i2c: piix4: use i2c_adapter-specific printk helpers

 drivers/i2c/busses/i2c-ali1535.c        | 20 ++++++++++----------
 drivers/i2c/busses/i2c-ali15x3.c        | 20 ++++++++++----------
 drivers/i2c/busses/i2c-amd756.c         | 24 ++++++++++++------------
 drivers/i2c/busses/i2c-isch.c           | 32 ++++++++++++++++----------------
 drivers/i2c/busses/i2c-mlxbf.c          | 19 +++++++++----------
 drivers/i2c/busses/i2c-nforce2.c        | 14 +++++++-------
 drivers/i2c/busses/i2c-owl.c            |  4 ++--
 drivers/i2c/busses/i2c-piix4.c          |  8 ++++----
 drivers/i2c/busses/i2c-powermac.c       | 26 +++++++++++++-------------
 drivers/i2c/busses/i2c-scmi.c           |  6 +++---
 drivers/i2c/busses/i2c-sun6i-p2wi.c     |  8 ++++----
 drivers/media/pci/saa7134/saa7134-i2c.c | 26 +++++++++++++-------------
 include/linux/i2c.h                     |  6 ++++++
 13 files changed, 109 insertions(+), 104 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20251222-i2c-printk-helpers-a69f4403ca70

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


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

end of thread, other threads:[~2026-03-17 10:28 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23  8:59 [PATCH v2 00/13] i2c: add and start using i2c_adapter-specific printk helpers Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 01/13] media: saa7134: rename i2c_dbg() to saa7134_i2c_dbg() Bartosz Golaszewski
2026-03-16  8:29   ` Hans Verkuil
2026-03-16  8:38     ` Wolfram Sang
2026-03-16  8:42       ` Hans Verkuil
2026-02-23  8:59 ` [PATCH v2 02/13] i2c: add i2c_adapter-specific printk helpers Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 03/13] i2c: sun6i-p2wi: use " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 04/13] i2c: mlxbf: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 05/13] i2c: isch: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 06/13] i2c: ali1535: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 07/13] i2c: scmi: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 08/13] i2c: ali15x3: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 09/13] i2c: powermac: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 10/13] i2c: owl: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 11/13] i2c: nforce2: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 12/13] i2c: amd756: " Bartosz Golaszewski
2026-02-23  8:59 ` [PATCH v2 13/13] i2c: piix4: " Bartosz Golaszewski
2026-02-26 20:21 ` [PATCH v2 00/13] i2c: add and start using " Wolfram Sang
2026-02-27  8:38   ` Bartosz Golaszewski
2026-02-27  8:54     ` Wolfram Sang
2026-02-27  8:58 ` Johan Hovold
2026-02-27  9:08   ` Wolfram Sang
2026-02-27 10:05     ` Johan Hovold
2026-02-27 15:42       ` Bartosz Golaszewski
2026-02-27 16:40         ` Johan Hovold
2026-03-02 18:03           ` Bartosz Golaszewski
2026-03-03 15:57             ` Johan Hovold
2026-03-04  9:55               ` Bartosz Golaszewski
2026-03-04 11:07                 ` Wolfram Sang
2026-03-06 15:50                   ` Johan Hovold
2026-03-06 17:20                     ` Bartosz Golaszewski
2026-03-09 11:51                     ` Wolfram Sang
2026-03-06 15:39                 ` Johan Hovold
2026-03-06 17:34                   ` Bartosz Golaszewski
2026-03-09 10:31                     ` Johan Hovold
2026-03-10  9:28                       ` Bartosz Golaszewski
2026-03-17 10:28                         ` Johan Hovold

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