[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7sbyvk6vyrbyox5ghvhokrv67r2el4s4f6k42aygmfo3rltj27@6v5pjxbhdl5w>
Date: Sat, 20 Sep 2025 00:05:38 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Siddharth Vadapalli <s-vadapalli@...com>
Cc: lpieralisi@...nel.org, kwilczynski@...nel.org, robh@...nel.org,
bhelgaas@...gle.com, jingoohan1@...il.com, christian.bruel@...s.st.com,
qiang.yu@....qualcomm.com, mayank.rana@....qualcomm.com, thippeswamy.havalige@....com,
shradha.t@...sung.com, quic_schintav@...cinc.com, inochiama@...il.com,
cassel@...nel.org, kishon@...nel.org, sergio.paracuellos@...il.com,
18255117159@....com, rongqianfeng@...o.com, jirislaby@...nel.org,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, srk@...com
Subject: Re: [PATCH v2 06/10] PCI: keystone: Add ks_pcie_free_intx_irq()
helper for cleanup
On Fri, Sep 12, 2025 at 05:46:17PM +0530, Siddharth Vadapalli wrote:
> Introduce the helper function ks_pcie_free_intx_irq() which will undo the
> configuration performed by the ks_pcie_config_intx_irq() function. This
> will be required for implementing a future helper function to undo the
> configuration performed by the ks_pcie_host_init() function.
>
> Signed-off-by: Siddharth Vadapalli <s-vadapalli@...com>
Please squash all patches introducing new helpers.
- Mani
> ---
>
> v1: https://lore.kernel.org/r/20250903124505.365913-7-s-vadapalli@ti.com/
> No changes since v1.
>
> drivers/pci/controller/dwc/pci-keystone.c | 29 +++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
> index 81c3686688c0..074566fb1d74 100644
> --- a/drivers/pci/controller/dwc/pci-keystone.c
> +++ b/drivers/pci/controller/dwc/pci-keystone.c
> @@ -745,6 +745,35 @@ static int ks_pcie_config_msi_irq(struct keystone_pcie *ks_pcie)
> return ret;
> }
>
> +static void ks_pcie_free_intx_irq(struct keystone_pcie *ks_pcie)
> +{
> + struct device_node *np = ks_pcie->np;
> + struct device_node *intc_np;
> + int irq_count, i;
> + u32 val;
> +
> + /* Nothing to do if INTx Interrupt Controller does not exist */
> + intc_np = of_get_child_by_name(np, "legacy-interrupt-controller");
> + if (!intc_np)
> + return;
> +
> + /* irq_count should be non-zero. Else, ks_pcie_host_init would have failed. */
> + irq_count = of_irq_count(intc_np);
> +
> + /* Disable all legacy interrupts */
> + for (i = 0; i < PCI_NUM_INTX; i++) {
> + val = ks_pcie_app_readl(ks_pcie, IRQ_ENABLE_SET(i));
> + val &= ~INTx_EN;
> + ks_pcie_app_writel(ks_pcie, IRQ_ENABLE_SET(i), val);
> + }
> +
> + irq_domain_remove(ks_pcie->intx_irq_domain);
> + for (i = 0; i < irq_count; i++)
> + irq_set_chained_handler(ks_pcie->intx_host_irqs[i], NULL);
> +
> + of_node_put(intc_np);
> +}
> +
> static int ks_pcie_config_intx_irq(struct keystone_pcie *ks_pcie)
> {
> struct device *dev = ks_pcie->pci->dev;
> --
> 2.43.0
>
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists