mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Walleij <linusw@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-gpio@vger.kernel.org, Bartosz Golaszewski <brgl@kernel.org>,
	 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Arnd Bergmann <arnd@arndb.de>,
	 Jason Cooper <jason@lakedaemon.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] gpio: mvebu: fix devres LIFO ordering between GPIO chip and IRQ domain
Date: Fri, 10 Jul 2026 21:38:27 +0200	[thread overview]
Message-ID: <CAD++jL=U6OiOT53hUZx5Jz39G2hQYH-tWM2=QRq04CUDFPhCzg@mail.gmail.com> (raw)
In-Reply-To: <20260708230638.1041426-1-rosenp@gmail.com>

On Thu, Jul 9, 2026 at 1:06 AM Rosen Penev <rosenp@gmail.com> wrote:

> During driver removal, devres cleans up in LIFO order. The IRQ domain
> was created and its devm cleanup action registered after
> devm_gpiochip_add_data(), so the domain was destroyed before the GPIO
> chip was deregistered. If gpiod_to_irq() is called on a pin during
> this window, mvebu_gpio_to_irq() passes the freed mvchip->domain to
> irq_create_mapping().
>
> Fix by moving the IRQ domain creation, devm cleanup action registration,
> generic chip allocation, and chip type setup before
> devm_gpiochip_add_data(). This ensures the GPIO chip is torn down
> first (preventing new IRQ mappings), then the IRQ domain is removed,
> and finally mvchip is freed.
>
> Assisted-by: opencode:big-pickle
> Fixes: fefe7b092345 ("gpio: introduce gpio-mvebu driver for Marvell SoCs")
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Excellent work on this!
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

  reply	other threads:[~2026-07-10 19:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 23:06 Rosen Penev
2026-07-10 19:38 ` Linus Walleij [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-06 23:22 Rosen Penev
2026-07-07  7:13 ` Uwe Kleine-König
2026-07-08  0:18   ` Rosen Penev
2026-07-10 19:33 ` Linus Walleij
2026-07-12 21:22   ` Rosen Penev

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='CAD++jL=U6OiOT53hUZx5Jz39G2hQYH-tWM2=QRq04CUDFPhCzg@mail.gmail.com' \
    --to=linusw@kernel.org \
    --cc=arnd@arndb.de \
    --cc=brgl@kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox