Skip to content

PCI: Add PCI_ERROR_RESPONSE, check for errors

Bjorn Helgaas linux-pci linux-pm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesIn review
  2. v15 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Add Rafael's Reviewed-By to the first two patches
- Drop "PCI / PM: Check for error when reading PME status" because Rafael pointed out that some devices can signal PME even when in D3cold, so this would require additional rework
- Drop "PCI / PM: Check for error when reading Power State" because Rafael thinks it's mostly redundant

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3PCI: Add PCI_ERROR_RESPONSE definitiondrivers/pci/access.c drivers/pci/controller/dwc/pcie-designware-host.c drivers/pci/controller/pci-aardvark.c +18 more+65 -582 replies
2/3PCI / PM: Decode D3cold power state correctlydrivers/pci/pci.c+9 -70 replies
3/3PCI / PM: Return error when changing power state from D3colddrivers/pci/pci.c+9 -21 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchRafael J. WysockiMika WesterbergKeith Busch
SeriesR-b R-b
1/3R-b
2/3R-b
3/3R-b

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 [PATCH v2 0/3] PCI: Add PCI_ERROR_RESPONSE, check for errors

From: Bjorn Helgaas <[email protected]>

Reads from a PCI device may fail if the device has been turned off (put into D3cold), removed, or if some other error occurs. The PCI host bridge typically fabricates ~0 data to complete the CPU's read.

We check for that in a few places, but not in a consistent way. This series adds a PCI_ERROR_RESPONSE definition to make the checks more consistent and easier to find. Note that ~0 may indicate a PCI error, but it may also be valid read data, so you need more information (such as knowing that a register can never contain ~0) before concluding that it's an error.

This series also adds a new check for PCI_ERROR_RESPONSE in the power management code because that code frequently encounters devices in D3cold, where we previously misinterpreted ~0 data. It also uses pci_power_name() to print D-state names more consistently.

Rafael, I didn't add your Reviewed-by to "PCI / PM: Return error when changing power state from D3cold" because I made small changes to try to make the messages more consistent, and I didn't want to presume they'd be OK with you.

Changes since v1:
- Add Rafael's Reviewed-By to the first two patches
- Drop "PCI / PM: Check for error when reading PME status" because Rafael pointed out that some devices can signal PME even when in D3cold, so this would require additional rework
- Drop "PCI / PM: Check for error when reading Power State" because Rafael thinks it's mostly redundant

Bjorn Helgaas (3):
PCI: Add PCI_ERROR_RESPONSE definition
PCI / PM: Decode D3cold power state correctly
PCI / PM: Return error when changing power state from D3cold

 drivers/pci/access.c                          | 13 ++++----
 .../pci/controller/dwc/pcie-designware-host.c |  2 +-
 drivers/pci/controller/pci-aardvark.c         |  2 +-
 drivers/pci/controller/pci-mvebu.c            |  4 +--
 drivers/pci/controller/pci-thunder-ecam.c     | 20 ++++++------
 drivers/pci/controller/pci-thunder-pem.c      |  2 +-
 drivers/pci/controller/pcie-altera.c          |  2 +-
 drivers/pci/controller/pcie-iproc.c           |  2 +-
 drivers/pci/controller/pcie-mediatek.c        |  4 +--
 drivers/pci/controller/pcie-rcar.c            |  2 +-
 drivers/pci/controller/pcie-rockchip-host.c   |  2 +-
 drivers/pci/controller/vmd.c                  |  2 +-
 drivers/pci/hotplug/cpqphp_ctrl.c             | 12 +++----
 drivers/pci/hotplug/cpqphp_pci.c              | 20 ++++++------
 drivers/pci/hotplug/pciehp_hpc.c              |  6 ++--
 drivers/pci/pci.c                             | 31 ++++++++++++-------
 drivers/pci/pcie/dpc.c                        |  3 +-
 drivers/pci/pcie/pme.c                        |  4 +--
 drivers/pci/probe.c                           |  4 +--
 drivers/pci/quirks.c                          |  2 +-
 include/linux/pci.h                           |  7 +++++
 21 files changed, 81 insertions(+), 65 deletions(-)
Signature · 1 line
2.23.0.187.g17f5b7556c-goog