Skip to content

PCI, error handling and hot plug

Keith Busch linux-pci 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 23 repliesIn review
  2. v116 patches 29 repliesSuperseded

Changes in v2 from the cover letter

* Use Dennis' patch for the incorrect slot reset detection since he posted that fix first

* I found some DPC and HPC capable ports (PLX Device 9781 to be specific) that don't have data-link active reporting capabilities, so I added another patch to handle that

* If the recovery determines the precence detection has changed during error handling, we need to prevent the downstream driver from accessing the device under its old context. This was a little tricky because of a circular dependency on the pci_bus_sem, so there is a prep patch to allow recursive pci bus walking, and then we use it from pciehp's slot_reset callback.

* Make error handling not able to change the error state away from pci_channel_state_perm_failure so that hotplug and error handling may use the same state (suggested by Benjamin Herrenschmidt)

* Moved the link active wait requirements into generic code (suggested by Sinan Kaya)

* Check for successful secondary bus reset on recovery failure (suggested by Sinan Kaya)

* Use pcie_device for service driver error callbacks (suggested by Lukas Wunner)

* Hold pci_slot_lock when doing a slot reset (suggested by Lukas Wunner)

* Fixed processing user orderly hotplug requests during error handling suggested by Lukas Wunner)

* Various code cleanups (suggested by Christoph Hellwig)

* Split dpc code cleanup into separate patch

* Changelog grammer fixes and wording clarity

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20PCI: Simplify disconnected markingdrivers/pci/hotplug/pciehp_pci.c+3 -60 replies
2/20PCI: Fix faulty logic in pci_reset_bus()drivers/pci/pci.c+1 -10 replies
3/20PCI: Add required waits on link activedrivers/pci/pci.c+18 -62 replies
4/20PCI/AER: Remove dead codedrivers/pci/pcie/aer.c+0 -130 replies
5/20PCI/ERR: Use slot reset if availabledrivers/pci/pci.c drivers/pci/pci.h drivers/pci/pcie/aer.c +2 more+38 -30 replies
6/20PCI/ERR: Handle fatal error recoverydrivers/pci/pci.h drivers/pci/pcie/aer.c drivers/pci/pcie/dpc.c +1 more+18 -810 replies
7/20PCI/ERR: Always use the first downstream portdrivers/pci/pcie/err.c+21 -640 replies
8/20PCI/ERR: Simplify broadcast calloutsdrivers/pci/pcie/err.c+38 -690 replies
9/20PCI/ERR: Report current recovery status for udevdrivers/pci/pcie/err.c+2 -30 replies
10/20PCI/ERR: Remove devices on recovery failuredrivers/pci/pcie/err.c+38 -40 replies
11/20PCI/portdrv: Provide pci error callbacksdrivers/pci/pcie/portdrv.h drivers/pci/pcie/portdrv_pci.c+47 -60 replies
12/20PCI/portdrv: Restore pci state on slot resetdrivers/pci/pcie/portdrv_pci.c+2 -00 replies
13/20PCI: Make link active reporting detection genericdrivers/pci/hotplug/pciehp.h drivers/pci/hotplug/pciehp_hpc.c drivers/pci/pci.c +2 more+13 -211 reply
14/20PCI: Create recursive bus walkdrivers/pci/bus.c include/linux/pci.h+14 -30 replies
15/20PCI/pciehp: Fix powerfault detection orderdrivers/pci/hotplug/pciehp_hpc.c+8 -88 replies
16/20PCI/pciehp: Implement error handling callbacksdrivers/pci/hotplug/pciehp.h drivers/pci/hotplug/pciehp_core.c drivers/pci/hotplug/pciehp_hpc.c+49 -09 replies
17/20PCI/pciehp: Ignore link events during DPC eventdrivers/pci/hotplug/pciehp_hpc.c drivers/pci/pcie/dpc.c include/linux/pci.h+21 -20 replies
18/20PCI/DPC: Wait for link active after resetdrivers/pci/pcie/dpc.c+4 -00 replies
19/20PCI/DPC: Link reset code cleanupdrivers/pci/pcie/dpc.c+7 -160 replies
20/20PCI: Unify device inaccessibledrivers/pci/pci.h drivers/pci/pcie/err.c+16 -101 reply

Reviews trailers per patch

3 of 20 patches have a Reviewed-by or Acked-by.

PatchKeith BuschMichael J. RuhlLukas Wunner
1/20R-b
2/20R-b R-b
3/20
4/20
5/20
6/20
7/20
8/20
9/20
10/20
11/20
12/20
13/20
14/20
15/20R-b R-b
16/20
17/20
18/20
19/20
20/20

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCHv2 00/20] PCI, error handling and hot plug

v1 -> v2:

* Use Dennis' patch for the incorrect slot reset detection since he posted that fix first

* I found some DPC and HPC capable ports (PLX Device 9781 to be specific) that don't have data-link active reporting capabilities, so I added another patch to handle that

* If the recovery determines the precence detection has changed during error handling, we need to prevent the downstream driver from accessing the device under its old context. This was a little tricky because of a circular dependency on the pci_bus_sem, so there is a prep patch to allow recursive pci bus walking, and then we use it from pciehp's slot_reset callback.

* Make error handling not able to change the error state away from pci_channel_state_perm_failure so that hotplug and error handling may use the same state (suggested by Benjamin Herrenschmidt)

* Moved the link active wait requirements into generic code (suggested by Sinan Kaya)

* Check for successful secondary bus reset on recovery failure (suggested by Sinan Kaya)

* Use pcie_device for service driver error callbacks (suggested by Lukas Wunner)

* Hold pci_slot_lock when doing a slot reset (suggested by Lukas Wunner)

* Fixed processing user orderly hotplug requests during error handling suggested by Lukas Wunner)

* Various code cleanups (suggested by Christoph Hellwig)

* Split dpc code cleanup into separate patch

* Changelog grammer fixes and wording clarity

Dennis Dalessandro (1):
PCI: Fix faulty logic in pci_reset_bus()

Keith Busch (18):
PCI: Add required waits on link active PCI/AER: Remove dead code
PCI/ERR: Use slot reset if available PCI/ERR: Handle fatal error recovery PCI/ERR: Always use the first downstream port PCI/ERR: Simplify broadcast callouts PCI/ERR: Report current recovery status for udev PCI/ERR: Remove devices on recovery failure PCI/portdrv: Provide pci error callbacks PCI/portdrv: Restore pci state on slot reset
PCI: Make link active reporting detection generic
PCI: Create recursive bus walk PCI/pciehp: Fix powerfault detection order PCI/pciehp: Implement error handling callbacks PCI/pciehp: Ignore link events during DPC event PCI/DPC: Wait for link active after reset PCI/DPC: Link reset code cleanup
PCI: Unify device inaccessible

Lukas Wunner (1):
PCI: Simplify disconnected marking

 drivers/pci/bus.c                 |  14 +-
 drivers/pci/hotplug/pciehp.h      |   2 +-
 drivers/pci/hotplug/pciehp_core.c |  39 +++++
 drivers/pci/hotplug/pciehp_hpc.c  |  56 +++----
 drivers/pci/hotplug/pciehp_pci.c  |   9 +-
 drivers/pci/pci.c                 |  68 +++++++-
 drivers/pci/pci.h                 |  17 +-
 drivers/pci/pcie/aer.c            |  27 ++--
 drivers/pci/pcie/dpc.c            |  37 +++--
 drivers/pci/pcie/err.c            | 327 +++++++++++++-------------------------
 drivers/pci/pcie/portdrv.h        |  10 +-
 drivers/pci/pcie/portdrv_pci.c    |  45 +++++-
 drivers/pci/probe.c               |   1 +
 drivers/pci/slot.c                |   2 +-
 include/linux/pci.h               |  10 ++
 15 files changed, 353 insertions(+), 311 deletions(-)
Signature · 1 line
2.14.4