mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Kent Gibson <warthog618@gmail.com>,
	Mika Westerberg <westeri@kernel.org>,
	Herve Codina <herve.codina@bootlin.com>,
	linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] gpiolib: release the chip's own lines before numbing it on removal
Date: Mon, 30 Nov 2026 12:16:00 +0200	[thread overview]
Message-ID: <20261130101559.1362604-2-aambrozewicz@nvidia.com> (raw)
In-Reply-To: <awmk-lfmMw8GG21o@ashevche-desk.local>

On Fri, Nov 27, 2026 at 05:42:50PM +0200, Andy Shevchenko wrote:
> This sounds like something is wrong in the cleanup flow. Why double free
> appears in the first place? Is the acpi_gpiochip_free_interrupts() call
> placed at incorrect function in the tear down flow?

Yes, it runs too late. The event lines are locked as IRQs, so
gpiochip_free_remaining_irqs(), which gpiochip_remove() calls right
before gpiochip_irqchip_remove(), frees their IRQs first. The
acpi_gpiochip_free_interrupts() call in gpiochip_irqchip_remove() then
frees them again. For v3 I plan to move that call out of
gpiochip_irqchip_remove() to before the numbing, with the chip's other
lines.

> Perhaps. I can't see it clearly in my mind, maybe when v3 is out it will
> be more obvious.

None of these bugs is new in v7.4, and the series has no Cc: stable,
so I plan to base v3 on gpio/for-next once it has v7.4-rc5, for the
chip-removal series, and to redo patch 1 there on top of commit
c402fd2961dd ("gpio: shared: factor out per-entry teardown helper"),
which it conflicts with today.

Bartosz, would you rather take them through gpio/for-current now? Then
I would post v3 on it, with that conflict described in the cover letter.

  reply	other threads:[~2026-11-30 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  7:49 [PATCH v2 0/3] gpiolib: free the lines a chip owns before numbing it Adrian Ambrozewicz
2026-11-27  7:49 ` [PATCH v2 1/3] gpiolib: shared: remove the proxies before releasing the shared line Adrian Ambrozewicz
2026-11-27  7:49 ` [PATCH v2 2/3] gpiolib: release the chip's own lines before numbing it on removal Adrian Ambrozewicz
2026-11-27 11:46   ` Andy Shevchenko
2026-11-27 12:44     ` Adrian Ambrozewicz
2026-11-27 15:42       ` Andy Shevchenko
2026-11-30 10:16         ` Adrian Ambrozewicz [this message]
2026-11-27  7:49 ` [PATCH v2 3/3] gpiolib: release user space's lines when adding the chip fails late Adrian Ambrozewicz

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=20261130101559.1362604-2-aambrozewicz@nvidia.com \
    --to=aambrozewicz@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=linusw@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog618@gmail.com \
    --cc=westeri@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®