From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Siddharth Vadapalli <s-vadapalli@ti.com>, <lpieralisi@kernel.org>,
<kwilczynski@kernel.org>, <mani@kernel.org>, <robh@kernel.org>,
<bhelgaas@google.com>, <jingoohan1@gmail.com>,
<fan.ni@samsung.com>, <quic_wenbyao@quicinc.com>,
<namcao@linutronix.de>, <mayank.rana@oss.qualcomm.com>,
<thippeswamy.havalige@amd.com>, <quic_schintav@quicinc.com>,
<shradha.t@samsung.com>, <inochiama@gmail.com>,
<cassel@kernel.org>, <kishon@kernel.org>, <18255117159@163.com>,
<rongqianfeng@vivo.com>, <linux-pci@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <srk@ti.com>
Subject: Re: [PATCH 09/11] PCI: keystone: Switch to devm_request_irq() for "ks-pcie-error-irq" IRQ
Date: Thu, 4 Sep 2025 14:42:45 +0530 [thread overview]
Message-ID: <249d79be-deed-4277-96c3-845bafcec37a@ti.com> (raw)
In-Reply-To: <3d3a4b52-e343-42f3-9d69-94c259812143@kernel.org>
On Thu, Sep 04, 2025 at 09:24:01AM +0200, Jiri Slaby wrote:
> On 03. 09. 25, 14:44, Siddharth Vadapalli wrote:
> > In preparation for enabling loadable module support for the driver,
> > there is motivation to switch to devm_request_irq() to simplify the
> > cleanup on driver removal. Additionally, since the interrupt handler
> > associated with the "ks-pcie-error-irq" namely "ks_pcie_handle_error_irq()
> > is only printing the error and is clearing the interrupt, there is no
> > necessity to prefer devm_request_threaded_irq() over devm_request_irq().
> > Hence, switch from request_irq() to devm_request_irq().
> >
> > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> > ---
> > drivers/pci/controller/dwc/pci-keystone.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
> > index bb93559f6468..02f9a6d0e4a8 100644
> > --- a/drivers/pci/controller/dwc/pci-keystone.c
> > +++ b/drivers/pci/controller/dwc/pci-keystone.c
> > @@ -1277,8 +1277,8 @@ static int ks_pcie_probe(struct platform_device *pdev)
> > if (irq < 0)
> > return irq;
> > - ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED,
> > - "ks-pcie-error-irq", ks_pcie);
> > + ret = devm_request_irq(dev, irq, ks_pcie_err_irq_handler, IRQF_SHARED,
> > + "ks-pcie-error-irq", ks_pcie);
> > if (ret < 0) {
> > dev_err(dev, "failed to request error IRQ %d\n",
> > irq);
>
> Ugh, so you are not removing any free_irq() from anywhere?
>
> <me checking>
>
> Because there is none...
>
> So you are actually fixing an IRQ leak in case something later fails -- I
> guess this needs Fixes and Cc stable tags, right?
Yes! While working on this series and unloading the module, I had seen
the issue and narrowed it down to the absence of a free_irq() in the
driver's .remove callback. Since the driver cannot be unloaded prior to
this series (driver can only be built-in), I had felt that a separate
fix may not be required for adding the missing free_irq() in the .remove
callback. However, after you pointed it out now, I realize that there
are other places during the driver's probe where we may exit in the
event of an error, without freeing the interrupt. Thank you for noticing
this. The commit to be fixed is:
0790eb175ee0 PCI: keystone: Cleanup error_irq configuration
Link to the commit is:
https://github.com/torvalds/linux/commit/0790eb175ee0
I will include the Fixes tag for the above commit and also Cc stable when
I post the v2 series. I will wait for feedback on the remaining patches
in the series before posting the v2 series.
Regards,
Siddharth.
next prev parent reply other threads:[~2025-09-04 9:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 12:44 [PATCH 00/11] PCI: Keystone: Enable loadable module support Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 01/11] PCI: Export pci_get_host_bridge_device() for use by pci-keystone Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 02/11] PCI: dwc: Export dw_pcie_allocate_domains() for pci-keystone Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 03/11] PCI: dwc: Add dw_pcie_free_domains() helper for cleanup Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 04/11] PCI: dwc: ep: Export dw_pcie_ep_raise_msix_irq() for pci-keystone Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 05/11] PCI: keystone: Add ks_pcie_free_msi_irq() helper for cleanup Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 06/11] PCI: keystone: Add ks_pcie_free_intx_irq() " Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 07/11] PCI: keystone: Add ks_pcie_host_deinit() " Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 08/11] PCI: keystone: Add ks_pcie_disable_error_irq() " Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 09/11] PCI: keystone: Switch to devm_request_irq() for "ks-pcie-error-irq" IRQ Siddharth Vadapalli
2025-09-04 7:24 ` Jiri Slaby
2025-09-04 9:12 ` Siddharth Vadapalli [this message]
2025-09-03 12:44 ` [PATCH 10/11] PCI: keystone: Exit ks_pcie_probe() for the default switch-case of "mode" Siddharth Vadapalli
2025-09-03 12:44 ` [PATCH 11/11] PCI: keystone: Add support to build as a loadable module Siddharth Vadapalli
2025-09-06 21:37 ` kernel test robot
2025-09-08 3:39 ` [PATCH 00/11] PCI: Keystone: Enable loadable module support Manivannan Sadhasivam
2025-09-08 7:13 ` Siddharth Vadapalli
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=249d79be-deed-4277-96c3-845bafcec37a@ti.com \
--to=s-vadapalli@ti.com \
--cc=18255117159@163.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=fan.ni@samsung.com \
--cc=inochiama@gmail.com \
--cc=jingoohan1@gmail.com \
--cc=jirislaby@kernel.org \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mayank.rana@oss.qualcomm.com \
--cc=namcao@linutronix.de \
--cc=quic_schintav@quicinc.com \
--cc=quic_wenbyao@quicinc.com \
--cc=robh@kernel.org \
--cc=rongqianfeng@vivo.com \
--cc=shradha.t@samsung.com \
--cc=srk@ti.com \
--cc=thippeswamy.havalige@amd.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