RE: [PATCH v14 3/3] PCI: amd-mdb: Add AMD MDB Root Port driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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
>
> --
> மணிவண்ணன் சதாசிவம்




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux