Re: [PATCH v15 8/9] PCI/DPC: Unify and plumb error handling into DPC
From: Bjorn Helgaas
Date: Thu May 10 2018 - 12:27:55 EST
On Thu, May 10, 2018 at 07:56:00PM +0530, poza@xxxxxxxxxxxxxx wrote:
> On 2018-05-10 18:52, Bjorn Helgaas wrote:
> > On Thu, May 03, 2018 at 01:03:57AM -0400, Oza Pawandeep wrote:
> ...
> > > -static pci_ers_result_t reset_link(struct pci_dev *dev)
> > > +static pci_ers_result_t reset_link(struct pci_dev *dev, int severity)
> > > {
> > > struct pci_dev *udev;
> > > pci_ers_result_t status;
> > > struct pcie_port_service_driver *driver;
> > > + u32 service;
> > >
> > > if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
> > > /* Reset this port for all subordinates */
> > > @@ -196,7 +197,12 @@ static pci_ers_result_t reset_link(struct
> > > pci_dev *dev)
> > > }
> > >
> > > /* Use the aer driver of the component firstly */
> > > - driver = pcie_port_find_service(udev, PCIE_PORT_SERVICE_AER);
> > > + if (severity == DPC_FATAL)
> > > + service = PCIE_PORT_SERVICE_DPC;
> > > + else
> > > + service = PCIE_PORT_SERVICE_AER;
> > > +
> > > + driver = pcie_port_find_service(udev, service);
> >
> > This is where I was wondering about passing in "service" directly
> > instead
> > of "severity".
>
> passing service directly instead of severity ? (I do not think you meant to
> write severity there)
I did mean "severity".
> perhaps do you mean following ?
>
> if (severity == DPC_FATAL)
> pcie_port_find_service(udev, PCIE_PORT_SERVICE_DPC);
> else
> pcie_port_find_service(udev, PCIE_PORT_SERVICE_AER);
No, my thought was that most of the places that use "severity" only
use it to decide between PCIE_PORT_SERVICE_DPC and
PCIE_PORT_SERVICE_AER, so if you just passed in "service" directly,
you wouldn't need this "if" statement.
Bjorn