lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIyzApkSjFc0ic7T@shell.armlinux.org.uk>
Date: Fri, 1 Aug 2025 13:28:50 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Mark Brown <broonie@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] regmap: irq: Avoid lockdep warnings with nested
 regmap-irq chips

On Thu, Jul 31, 2025 at 09:38:19PM +0100, Mark Brown wrote:
> While handling interrupts through regmap-irq we use a mutex to protect the
> updates we are caching while genirq runs in atomic context. Russell King
> reported that while running on the nVidia Jetson Xavier NX this generates
> lockdep warnings since that platform has a regmap-irq for the max77686 RTC
> which is a child of a max77620 which also uses regmap-irq.
> 
> [   46.723127] rtcwake/3984 is trying to acquire lock:
> [   46.723235] ffff0000813b2c68 (&d->lock){+.+.}-{4:4}, at: regmap_irq_lock+0x18/0x24
> [   46.723452]
>                but task is already holding lock:
> [   46.723556] ffff00008504dc68 (&d->lock){+.+.}-{4:4}, at: regmap_irq_lock+0x18/0x24
> 
> This happens because by default lockdep uses a single lockdep class for all
> mutexes initialised from a single mutex_init() call and is unable to tell
> that two distinct mutex are being taken and verify that the ordering of
> operations is safe. This should be a very rare situation since normally
> anything using regmap-irq will be a leaf interrupt controller due to being
> on a slow bus like I2C.
> 
> We can avoid these warnings by providing the lockdep key for the regmap-irq
> explicitly, allocating one for each chip so that lockdep can distinguish
> between them.
> 
> Thanks to Russell for the report and analysis.
> 
> Reported-by: "Russell King (Oracle)" <linux@...linux.org.uk>

Reported-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>

please (also for patch 1.)

> Signed-off-by: Mark Brown <broonie@...nel.org>

Tested-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Reviewed-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ