All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Hector Martin <marcan@marcan.st>
Cc: Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	 Marc Zyngier <maz@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	 linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 asahi@lists.linux.dev
Subject: Re: [PATCH] pinctrl: apple: Use a raw spinlock for the regmap
Date: Wed, 25 May 2022 09:38:51 +0200	[thread overview]
Message-ID: <CACRpkdZX19VaEy64-64UNWafM-wF_=h9w8Qiq4xFFhsa6sahaQ@mail.gmail.com> (raw)
In-Reply-To: <20220524142206.18833-1-marcan@marcan.st>

On Tue, May 24, 2022 at 4:22 PM Hector Martin <marcan@marcan.st> wrote:

> The irqchip ops are called with a raw spinlock held, so the subsequent
> regmap usage cannot use a plain spinlock.
>
> spi-hid-apple-of spi0.0: spihid_apple_of_probe:74
>
> =============================
> [ BUG: Invalid wait context ]
> 5.18.0-asahi-00176-g0fa3ab03bdea #1337 Not tainted
> -----------------------------
> kworker/u20:3/86 is trying to lock:
> ffff8000166b5018 (pinctrl_apple_gpio:462:(&regmap_config)->lock){....}-{3:3}, at: regmap_lock_spinlock+0x18/0x30
> other info that might help us debug this:
> context-{5:5}
> 7 locks held by kworker/u20:3/86:
>  #0: ffff800017725d48 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670
>  #1: ffff80001e33bdd0 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670
>  #2: ffff800017d629a0 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c
>  #3: ffff80002414e618 (&ctlr->add_lock){+.+.}-{4:4}, at: spi_add_device+0x40/0x80
>  #4: ffff800024116990 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c
>  #5: ffff800022d4be58 (request_class){+.+.}-{4:4}, at: __setup_irq+0xa8/0x720
>  #6: ffff800022d4bcc8 (lock_class){....}-{2:2}, at: __setup_irq+0xcc/0x720
>
> Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs")
> Signed-off-by: Hector Martin <marcan@marcan.st>

Patch applied!

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Hector Martin <marcan@marcan.st>
Cc: Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	 Marc Zyngier <maz@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	 linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 asahi@lists.linux.dev
Subject: Re: [PATCH] pinctrl: apple: Use a raw spinlock for the regmap
Date: Wed, 25 May 2022 09:38:51 +0200	[thread overview]
Message-ID: <CACRpkdZX19VaEy64-64UNWafM-wF_=h9w8Qiq4xFFhsa6sahaQ@mail.gmail.com> (raw)
In-Reply-To: <20220524142206.18833-1-marcan@marcan.st>

On Tue, May 24, 2022 at 4:22 PM Hector Martin <marcan@marcan.st> wrote:

> The irqchip ops are called with a raw spinlock held, so the subsequent
> regmap usage cannot use a plain spinlock.
>
> spi-hid-apple-of spi0.0: spihid_apple_of_probe:74
>
> =============================
> [ BUG: Invalid wait context ]
> 5.18.0-asahi-00176-g0fa3ab03bdea #1337 Not tainted
> -----------------------------
> kworker/u20:3/86 is trying to lock:
> ffff8000166b5018 (pinctrl_apple_gpio:462:(&regmap_config)->lock){....}-{3:3}, at: regmap_lock_spinlock+0x18/0x30
> other info that might help us debug this:
> context-{5:5}
> 7 locks held by kworker/u20:3/86:
>  #0: ffff800017725d48 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670
>  #1: ffff80001e33bdd0 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670
>  #2: ffff800017d629a0 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c
>  #3: ffff80002414e618 (&ctlr->add_lock){+.+.}-{4:4}, at: spi_add_device+0x40/0x80
>  #4: ffff800024116990 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c
>  #5: ffff800022d4be58 (request_class){+.+.}-{4:4}, at: __setup_irq+0xa8/0x720
>  #6: ffff800022d4bcc8 (lock_class){....}-{2:2}, at: __setup_irq+0xcc/0x720
>
> Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs")
> Signed-off-by: Hector Martin <marcan@marcan.st>

Patch applied!

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-25  7:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24 14:22 [PATCH] pinctrl: apple: Use a raw spinlock for the regmap Hector Martin
2022-05-24 14:22 ` Hector Martin
2022-05-25  7:38 ` Linus Walleij [this message]
2022-05-25  7:38   ` Linus Walleij

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='CACRpkdZX19VaEy64-64UNWafM-wF_=h9w8Qiq4xFFhsa6sahaQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=sven@svenpeter.dev \
    /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.