i2c: atr: Fix lockdep for nested ATRs
authorTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Wed, 7 May 2025 12:19:07 +0000 (15:19 +0300)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 22 May 2025 09:06:40 +0000 (11:06 +0200)
commitec8c1b92eaec3efebff717b5c13da3b5e87f2dcc
treef7e6d7330342650b14b638fb653617a92141465b
parent7e6f4a0a7512eca93cecff3bcb37f0ed164949a2
i2c: atr: Fix lockdep for nested ATRs

When we have an ATR, and another ATR as a subdevice of the first ATR,
we get lockdep warnings for the i2c_atr.lock and
i2c_atr_chan.orig_addrs_lock. This is because lockdep uses a static key
for the locks, and doesn't see the locks of the separate ATR instances
as separate.

Fix this by generating a dynamic lock key per lock instance.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-atr.c