From: Andrea della Porta <andrea.porta@suse.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: Andrea della Porta <andrea.porta@suse.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: rp1: clear chained IRQ handlers on teardown
Date: Tue, 23 Jun 2026 18:01:47 +0200 [thread overview]
Message-ID: <ajqt6wa1MV-5KCsX@apocalypse> (raw)
In-Reply-To: <20260616151028.69890-1-pengpeng@iscas.ac.cn>
Hi,
On 23:10 Tue 16 Jun , Pengpeng Hou wrote:
> rp1_probe() installs a chained handler for each parent MSI-X vector and
> stores the rp1 device pointer as handler data. rp1_unregister_interrupts()
> then disposes the child IRQ mappings, removes the IRQ domain, and frees
> the PCI IRQ vectors without first removing those chained handlers.
>
> If a teardown path runs after the handlers have been installed, a later
> parent IRQ can still call rp1_chained_handle_irq() with stale handler
> data and a removed IRQ domain. Clear the chained handlers before
> disposing mappings and freeing the vectors.
>
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---
> drivers/misc/rp1/rp1_pci.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/misc/rp1/rp1_pci.c b/drivers/misc/rp1/rp1_pci.c
> index 81685e3f3296..a1f20d88be5d 100644
> --- a/drivers/misc/rp1/rp1_pci.c
> +++ b/drivers/misc/rp1/rp1_pci.c
> @@ -166,6 +166,9 @@ static void rp1_unregister_interrupts(struct pci_dev *pdev)
> struct rp1_dev *rp1 = pci_get_drvdata(pdev);
> int irq, i;
>
> + for (i = 0; i < RP1_INT_END; i++)
> + irq_set_chained_handler_and_data(pci_irq_vector(pdev, i), NULL, NULL);
> +
> if (rp1->domain) {
> for (i = 0; i < RP1_INT_END; i++) {
> irq = irq_find_mapping(rp1->domain, i);
> --
> 2.43.0
>
Reviewed-by: Andrea della Porta <andrea.porta@suse.com>
prev parent reply other threads:[~2026-06-23 15:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 15:10 Pengpeng Hou
2026-06-23 16:01 ` Andrea della Porta [this message]
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=ajqt6wa1MV-5KCsX@apocalypse \
--to=andrea.porta@suse.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pengpeng@iscas.ac.cn \
/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®