OSDN Git Service

PCI/ERR: Run error recovery callbacks for all affected devices
authorKeith Busch <keith.busch@intel.com>
Thu, 20 Sep 2018 16:27:13 +0000 (10:27 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 26 Sep 2018 19:23:15 +0000 (14:23 -0500)
commitbfcb79fca19d267712e425af1dd48812c40dec0c
treef34cdd194d762c97f3e2b7424d3d2b59890bb31e
parentbdb5ac85777de67c909c9ad4327f03f7648b543f
PCI/ERR: Run error recovery callbacks for all affected devices

If an Endpoint reported an error with ERR_FATAL, we previously ran driver
error recovery callbacks only for the Endpoint's driver.  But if we reset a
Link to recover from the error, all downstream components are affected,
including the Endpoint, any multi-function peers, and children of those
peers.

Initiate the Link reset from the deepest Downstream Port that is
reliable, and call the error recovery callbacks for all its children.

If a Downstream Port (including a Root Port) reports an error, we assume
the Port itself is reliable and we need to reset its downstream Link.  In
all other cases (Switch Upstream Ports, Endpoints, Bridges, etc), we assume
the Link leading to the component needs to be reset, so we initiate the
reset at the parent Downstream Port.

This allows two other clean-ups.  First, we currently only use a Link
reset, which can only be initiated using a Downstream Port, so we can
remove checks for Endpoints.  Second, the Downstream Port where we initiate
the Link reset is reliable (unlike components downstream from it), so the
special cases for error detect and resume are no longer necessary.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[bhelgaas: changelog]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Sinan Kaya <okaya@kernel.org>
drivers/pci/pcie/err.c