lkml.org 
[lkml]   [2018]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v10 4/7] PCI/DPC: Unify and plumb error handling into DPC
    On Thu, Feb 22, 2018 at 09:32:09PM +0530, Oza Pawandeep wrote:
    > Current DPC driver does not do recovery, e.g. calling end-point's driver's
    > callbacks, which sanitize the sw.
    >
    > DPC driver implements link_reset callback, and calls pci_do_recovery.
    >
    > Signed-off-by: Oza Pawandeep <poza@codeaurora.org>
    >
    > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
    > index a5a79f0..124f42e 100644
    > --- a/drivers/pci/pci.h
    > +++ b/drivers/pci/pci.h
    > @@ -343,6 +343,8 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
    > void pci_enable_acs(struct pci_dev *dev);
    >
    > /* PCI error reporting and recovery */
    > +#define DPC_FATAL 4
    > +
    > void pci_do_recovery(struct pci_dev *dev, int severity);
    >
    > #ifdef CONFIG_PCIEASPM
    > diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c
    > index 38e40c6..208b427 100644
    > --- a/drivers/pci/pcie/pcie-dpc.c
    > +++ b/drivers/pci/pcie/pcie-dpc.c
    > @@ -13,6 +13,7 @@
    > #include <linux/pcieport_if.h>
    > #include "../pci.h"
    > #include "aer/aerdrv.h"
    > +#include "portdrv.h"
    >
    > struct dpc_dev {
    > struct pcie_device *dev;
    > @@ -45,6 +46,60 @@ struct dpc_dev {
    > "Memory Request Completion Timeout", /* Bit Position 18 */
    > };
    >
    > +static int find_dpc_dev_iter(struct device *device, void *data)
    > +{
    > + struct pcie_port_service_driver *service_driver;
    > + struct device **dev;
    > +
    > + dev = (struct device **) data;
    > +
    > + if (device->bus == &pcie_port_bus_type && device->driver) {
    > + service_driver = to_service_driver(device->driver);

    Please move the initial assignment to the declaration line to
    clean this up a bit:

    struct device **dev = (struct device **)data;

    Same thing happens a couple more times in this patch.

    > +EXPORT_SYMBOL(pci_find_dpc_service);

    EXPORT_SYMBOL_GPL for PCI layer internals again - and ditto for
    probably about everything in this series.

    > #if IS_ENABLED(CONFIG_PCIEAER)
    > - /* Use the aer driver of the component firstly */
    > - driver = pci_find_aer_service(udev);
    > + if ((severity == AER_FATAL) ||
    > + (severity == AER_NONFATAL) ||
    > + (severity == AER_CORRECTABLE))
    > + driver = pci_find_aer_service(udev);
    > #endif

    No need for the inner braces here.

    > - if (severity == AER_FATAL)
    > + if ((severity == AER_FATAL) ||
    > + (severity == DPC_FATAL))
    > state = pci_channel_io_frozen;
    > else
    > state = pci_channel_io_normal;

    Same here and a few more times below.

    \
     
     \ /
      Last update: 2018-02-22 19:40    [W:3.147 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site