[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<SN7PR12MB720119A1E4F99A463758DF8A8BC32@SN7PR12MB7201.namprd12.prod.outlook.com>
Date: Tue, 25 Feb 2025 14:18:07 +0000
From: "Havalige, Thippeswamy" <thippeswamy.havalige@....com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
CC: "bhelgaas@...gle.com" <bhelgaas@...gle.com>, "lpieralisi@...nel.org"
<lpieralisi@...nel.org>, "kw@...ux.com" <kw@...ux.com>, "robh@...nel.org"
<robh@...nel.org>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>, "linux-pci@...r.kernel.org"
<linux-pci@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "Simek, Michal" <michal.simek@....com>,
"Gogada, Bharat Kumar" <bharat.kumar.gogada@....com>, "jingoohan1@...il.com"
<jingoohan1@...il.com>
Subject: RE: [PATCH v14 3/3] PCI: amd-mdb: Add AMD MDB Root Port driver
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Mani,
[...]
>
> > > + for (i = 0; i < ARRAY_SIZE(intr_cause); i++) {
> > > + if (!intr_cause[i].str)
> > > + continue;
> > > + irq = irq_create_mapping(pcie->mdb_domain, i);
> > > + if (!irq) {
> > > + dev_err(dev, "Failed to map mdb domain
> interrupt\n");
> > > + return -ENOMEM;
> > > + }
> > > + err = devm_request_irq(dev, irq,
> amd_mdb_pcie_intr_handler,
> > > + IRQF_SHARED | IRQF_NO_THREAD,
> > > + intr_cause[i].sym, pcie);
> >
> > Aren't these IRQs just part of a single IRQ? I'm wondering why do you need
> to represent them individually instead of having a single IRQ handler.
> >
> > Btw, you are not disposing these IRQs anywhere. Especially in error paths.
> > Thank you for reviewing. This code is based on the work authored by Marc
> Zyngier and Bjorn during the development of our CPM drivers, and it follows
> the same design principles. The individual IRQ handling is consistent with that
> approach.
> > For reference, you can review the driver here: pcie-xilinx-cpm.c. All of your
> comments have been incorporated into this driver as requested.
> >
>
> Ok for the separate IRQ question. But you still need to dispose the IRQs in
> error path.
Here none of the drivers are disposing explicitly in the error path explicitly. I only
See VMD driver is freeing it up explicitly in suspend path so that driver can register irq
Handler in the resume. May I know the reason for explicitly need for disposing here.
>
> > > + if (err) {
> > > + dev_err(dev, "Failed to request IRQ %d\n", irq);
> > > + return err;
> > > + }
> > > + }
> > > +
> > > + pcie->intx_irq = irq_create_mapping(pcie->mdb_domain,
> > > + AMD_MDB_PCIE_INTR_INTX);
> > > + if (!pcie->intx_irq) {
> > > + dev_err(dev, "Failed to map INTx interrupt\n");
> > > + return -ENXIO;
> > > + }
> > > +
> > > + err = devm_request_irq(dev, pcie->intx_irq,
> > > + dw_pcie_rp_intx_flow,
> > > + IRQF_SHARED | IRQF_NO_THREAD, NULL, pcie);
> > > + if (err) {
> > > + dev_err(dev, "Failed to request INTx IRQ %d\n", irq);
> > > + return err;
> > > + }
> > > +
> > > + /* Plug the main event handler */
> > > + err = devm_request_irq(dev, pp->irq, amd_mdb_pcie_event_flow,
> > > + IRQF_SHARED | IRQF_NO_THREAD, "amd_mdb
> pcie_irq",
> >
> > Why is this a SHARED IRQ?
> > Thank you for reviewing. The IRQ is shared because all the events, errors,
> and INTx interrupts are routed through the same IRQ line, so multiple
> handlers need to be able to respond to the same interrupt.
>
> IIUC, you have a single handler for this IRQ and that handler is invoking other
> handlers (for events, INTx etc...). So I don't see how this IRQ is shared.
>
> Shared IRQ is only required if multiple handlers are sharing the same IRQ line.
> But that is not the case here afaics.
- I have verified this in my driver it works without shared interrupt line. Thanks for reviewing.
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists