From: Herve Codina <herve.codina@bootlin.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Luca Ceresoli <luca.ceresoli@bootlin.com>
Subject: Re: [PATCH v2] gpio: free irqs that are still requested when the chip is being removed
Date: Mon, 23 Sep 2024 15:00:36 +0200 [thread overview]
Message-ID: <20240923150036.1ede7ca6@bootlin.com> (raw)
In-Reply-To: <20240919135104.3583-1-brgl@bgdev.pl>
Hi Bartosz,
On Thu, 19 Sep 2024 15:51:04 +0200
Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> If we remove a GPIO chip that is also an interrupt controller with users
> not having freed some interrupts, we'll end up leaking resources as
> indicated by the following warning:
>
> remove_proc_entry: removing non-empty directory 'irq/30', leaking at least 'gpio'
>
> As there's no way of notifying interrupt users about the irqchip going
> away and the interrupt subsystem is not plugged into the driver model and
> so not all cases can be handled by devlinks, we need to make sure to free
> all interrupts before the complete the removal of the provider.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> v1 -> v2:
> - we should actually take the request_mutex to protect the irqaction from being
> freed while we dereference it and keep the actual dereferencing under the lock
> - add some comments to explain what we're doing
>
> drivers/gpio/gpiolib.c | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
Thanks for the patch.
Tested on my system and it fixes the issue.
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Herve Codina <herve.codina@bootlin.com>
My old series [1] related to the topic is no more needed and can be thrown
away.
Best regards,
Hervé
[1] https://lore.kernel.org/all/20240227113426.253232-1-herve.codina@bootlin.com/
next prev parent reply other threads:[~2024-09-23 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 13:51 [PATCH v2] gpio: free irqs that are still requested when the chip is being removed Bartosz Golaszewski
2024-09-23 13:00 ` Herve Codina [this message]
2024-09-30 8:22 ` Bartosz Golaszewski
2024-10-02 13:14 ` 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=20240923150036.1ede7ca6@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.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 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.