linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/25] Unify PCI error response checking
@ 2021-11-18 14:03 Naveen Naidu
  2021-11-18 14:03 ` [PATCH v4 01/25] PCI: Add PCI_ERROR_RESPONSE and it's related definitions Naveen Naidu
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: Naveen Naidu @ 2021-11-18 14:03 UTC (permalink / raw)
  To: bhelgaas
  Cc: Naveen Naidu, linux-kernel-mentees, linux-pci, linux-kernel,
	linux-arm-kernel, linux-hyperv, linux-mediatek, linuxppc-dev,
	linux-renesas-soc, linux-rockchip, linux-samsung-soc,
	Rob Herring, Pali Rohár, skhan, Robert Richter,
	Lorenzo Pieralisi, Krzysztof Wilczyński, Ray Jui,
	Scott Branden, maintainer:BROADCOM IPROC ARM ARCHITECTURE,
	Ryder Lee, Jianjun Wang, Matthias Brugger, Jingoo Han,
	Krzysztof Kozlowski, Shawn Guo, Xiaowei Song, Binghui Wang,
	Thomas Petazzoni, Joyce Ooi, Marek Vasut, Yoshihiro Shimoda,
	Shawn Lin, Heiko Stuebner, Nirmal Patel, Jonathan Derrick,
	Kuppuswamy Sathyanarayanan, Lukas Wunner, Amey Narkhede,
	Russell Currey, Oliver O'Halloran, Sean V Kelley, Qiuxu Zhuo,
	Marc Zyngier, K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
	Wei Liu, Dexuan Cui, Toan Le, Kishon Vijay Abraham I

An MMIO read from a PCI device that doesn't exist or doesn't respond
causes a PCI error.  There's no real data to return to satisfy the 
CPU read, so most hardware fabricates ~0 data.

This patch series adds PCI_ERROR_RESPONSE definition and other helper
definition PCI_SET_ERROR_RESPONSE and PCI_POSSIBLE_ERROR and uses it
where appropriate to make these checks consistent and easier to find.

This helps unify PCI error response checking and make error check
consistent and easier to find.

This series also ensures that the error response fabrication now happens
in the PCI_OP_READ and PCI_USER_READ_CONFIG. This removes the
responsibility from controller drivers to do the error response setting. 

Patch 1:
    - Adds the PCI_ERROR_RESPONSE and other related defintions
    - All other patches are dependent on this patch. This patch needs to
      be applied first, before the others

Patch 2:
    - Error fabrication happens in PCI_OP_READ and PCI_USER_READ_CONFIG
      whenever the data read via the controller driver fails.
    - This patch needs to be applied before, Patch 4/24 to Patch 15/24 are
      applied.

Patch 3:
    - Uses PCI_SET_ERROR_RESPONSE() when device is not found 

Patch 4 - 15:
    - Removes redundant error fabrication that happens in controller 
      drivers when the read from a PCI device fails.
    - These patches are dependent on Patch 2/24 of the series.
    - These can be applied in any order.

Patch 16 - 22:
    - Uses PCI_POSSIBLE_ERROR() to check the reads from hardware
    - Patches can be applied in any order.

Patch 23 - 25:
    - Edits the comments to include PCI_ERROR_RESPONSE alsong with
      0xFFFFFFFF, so that it becomes easier to grep for faulty 
      hardware reads.

Changelog
=========
v4:
   - Rename SET_PCI_ERROR_RESPONSE to PCI_SET_ERROR_RESPONSE
   - Rename RESPONSE_IS_PCI_ERROR to PCI_POSSIBLE_ERROR

v3:
   - Change RESPONSE_IS_PCI_ERROR macro definition
   - Fix the macros, Add () around macro parameters
   - Fix alignment issue in Patch 2/24
   - Add proper receipients for all the patches

v2:
    - Instead of using SET_PCI_ERROR_RESPONSE in all controller drivers
      to fabricate error response, only use them in PCI_OP_READ and
      PCI_USER_READ_CONFIG

Naveen Naidu (25):
 [PATCH v4 1/25] PCI: Add PCI_ERROR_RESPONSE and it's related definitions
 [PATCH v4 2/25] PCI: Set error response in config access defines when ops->read() fails
 [PATCH v4 3/25] PCI: Use PCI_SET_ERROR_RESPONSE() when device not found
 [PATCH v4 4/25] PCI: Remove redundant error fabrication when device read fails
 [PATCH v4 5/25] PCI: thunder: Remove redundant error fabrication when device read fails
 [PATCH v4 6/25] PCI: iproc: Remove redundant error fabrication when device read fails
 [PATCH v4 7/25] PCI: mediatek: Remove redundant error fabrication when device read fails
 [PATCH v4 8/25] PCI: exynos: Remove redundant error fabrication when device read fails
 [PATCH v4 9/25] PCI: histb: Remove redundant error fabrication when device read fails
 [PATCH v4 10/25] PCI: kirin: Remove redundant error fabrication when device read fails
 [PATCH v4 11/25] PCI: aardvark: Remove redundant error fabrication when device read fails
 [PATCH v4 12/25] PCI: mvebu: Remove redundant error fabrication when device read fails
 [PATCH v4 13/25] PCI: altera: Remove redundant error fabrication when device read fails
 [PATCH v4 14/25] PCI: rcar: Remove redundant error fabrication when device read fails
 [PATCH v4 15/25] PCI: rockchip: Remove redundant error fabrication when device read fails
 [PATCH v4 16/25] PCI/ERR: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 17/25] PCI: vmd: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 18/25] PCI: pciehp: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 19/25] PCI/DPC: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 20/25] PCI/PME: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 21/25] PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check read from hardware
 [PATCH v4 22/25] PCI: Use PCI_ERROR_RESPONSE to specify hardware error
 [PATCH v4 23/25] PCI: keystone: Use PCI_ERROR_RESPONSE to specify hardware error
 [PATCH v4 24/25] PCI: hv: Use PCI_ERROR_RESPONSE to specify hardware read error
 [PATCH v4 25/25] PCI: xgene: Use PCI_ERROR_RESPONSE to specify hardware error

 drivers/pci/access.c                        | 32 +++++++-------
 drivers/pci/controller/dwc/pci-exynos.c     |  4 +-
 drivers/pci/controller/dwc/pci-keystone.c   |  4 +-
 drivers/pci/controller/dwc/pcie-histb.c     |  4 +-
 drivers/pci/controller/dwc/pcie-kirin.c     |  4 +-
 drivers/pci/controller/pci-aardvark.c       |  4 +-
 drivers/pci/controller/pci-hyperv.c         |  2 +-
 drivers/pci/controller/pci-mvebu.c          |  8 +---
 drivers/pci/controller/pci-thunder-ecam.c   | 46 +++++++--------------
 drivers/pci/controller/pci-thunder-pem.c    |  4 +-
 drivers/pci/controller/pci-xgene.c          |  8 ++--
 drivers/pci/controller/pcie-altera.c        |  4 +-
 drivers/pci/controller/pcie-iproc.c         |  4 +-
 drivers/pci/controller/pcie-mediatek.c      | 11 +----
 drivers/pci/controller/pcie-rcar-host.c     |  4 +-
 drivers/pci/controller/pcie-rockchip-host.c |  4 +-
 drivers/pci/controller/vmd.c                |  2 +-
 drivers/pci/hotplug/cpqphp_ctrl.c           |  4 +-
 drivers/pci/hotplug/pciehp_hpc.c            | 10 ++---
 drivers/pci/pci.c                           | 10 ++---
 drivers/pci/pcie/dpc.c                      |  4 +-
 drivers/pci/pcie/pme.c                      |  4 +-
 drivers/pci/probe.c                         | 10 ++---
 include/linux/pci.h                         |  9 ++++
 24 files changed, 84 insertions(+), 116 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-11-18 20:44 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 14:03 [PATCH v4 00/25] Unify PCI error response checking Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 01/25] PCI: Add PCI_ERROR_RESPONSE and it's related definitions Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 02/25] PCI: Set error response in config access defines when ops->read() fails Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 03/25] PCI: Use PCI_SET_ERROR_RESPONSE() when device not found Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 04/25] PCI: Remove redundant error fabrication when device read fails Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 05/25] PCI: thunder: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 06/25] PCI: iproc: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 07/25] PCI: mediatek: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 08/25] PCI: exynos: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 09/25] PCI: histb: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 10/25] PCI: kirin: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 11/25] PCI: aardvark: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 12/25] PCI: mvebu: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 13/25] PCI: altera: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 14/25] PCI: rcar: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 15/25] PCI: rockchip: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 16/25] PCI/ERR: Use PCI_POSSIBLE_ERROR() to check read from hardware Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 17/25] PCI: vmd: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 18/25] PCI: pciehp: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 19/25] PCI/DPC: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 20/25] PCI/PME: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 21/25] PCI: cpqphp: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 22/25] PCI: Use PCI_ERROR_RESPONSE to specify hardware error Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 23/25] PCI: keystone: " Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 24/25] PCI: hv: Use PCI_ERROR_RESPONSE to specify hardware read error Naveen Naidu
2021-11-18 14:03 ` [PATCH v4 25/25] PCI: xgene: Use PCI_ERROR_RESPONSE to specify hardware error Naveen Naidu
2021-11-18 20:44 ` [PATCH v4 00/25] Unify PCI error response checking Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).