On Tue, Dec 23, 2025 at 11:06:47AM +0100, Bartosz Golaszewski wrote:
> 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.
> [1] https://lore.kernel.org/all/20251106152330.11733-1-tzungbi@kernel.org/
Can be also made as a Link tag and some people use `b4 shazam`, that uses the
above test as a merge commit message where other tags are also being
recognized.
Have no objection and code looks good,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko