All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] regmap: irq: Avoid lockdep warnings with nested regmap-irq chips
Date: Fri, 1 Aug 2025 13:28:50 +0100	[thread overview]
Message-ID: <aIyzApkSjFc0ic7T@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250731-regmap-irq-nesting-v1-2-98b4d1bf20f0@kernel.org>

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@armlinux.org.uk>

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

please (also for patch 1.)

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

Tested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.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!

  reply	other threads:[~2025-08-01 12:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 20:38 [PATCH 0/2] regmap: Fix lockdep warnings for nested regmap-irqs Mark Brown
2025-07-31 20:38 ` [PATCH 1/2] regmap: irq: Free the regmap-irq mutex Mark Brown
2025-08-01 12:27   ` Russell King (Oracle)
2025-08-01 12:29   ` Russell King (Oracle)
2025-07-31 20:38 ` [PATCH 2/2] regmap: irq: Avoid lockdep warnings with nested regmap-irq chips Mark Brown
2025-08-01 12:28   ` Russell King (Oracle) [this message]
2025-08-01 18:14 ` [PATCH 0/2] regmap: Fix lockdep warnings for nested regmap-irqs Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aIyzApkSjFc0ic7T@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=broonie@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.