Re: [PATCH 2/3] i2c: atr: Fix lockdep for nested ATRs
From: Andy Shevchenko
Date: Fri Nov 22 2024 - 04:24:27 EST
On Fri, Nov 22, 2024 at 09:51:39AM +0200, Tomi Valkeinen wrote:
> From: Tomi Valkeinen <tomi.valkeinen+renesas@xxxxxxxxxxxxxxxx>
>
> 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.
...
> + lockdep_register_key(&atr->lock_key);
> mutex_init(&atr->lock);
> + lockdep_set_class(&atr->lock, &atr->lock_key);
mutext_init_with_key()
...
> + lockdep_register_key(&chan->orig_addrs_lock_key);
> mutex_init(&chan->orig_addrs_lock);
> + lockdep_set_class(&chan->orig_addrs_lock, &chan->orig_addrs_lock_key);
Ditto.
--
With Best Regards,
Andy Shevchenko