OpenCloudOS-Kernel/drivers/pci/controller
Pali Rohár f18139966d PCI: aardvark: Fix kernel panic during PIO transfer
Trying to start a new PIO transfer by writing value 0 in PIO_START register
when previous transfer has not yet completed (which is indicated by value 1
in PIO_START) causes an External Abort on CPU, which results in kernel
panic:

    SError Interrupt on CPU0, code 0xbf000002 -- SError
    Kernel panic - not syncing: Asynchronous SError Interrupt

To prevent kernel panic, it is required to reject a new PIO transfer when
previous one has not finished yet.

If previous PIO transfer is not finished yet, the kernel may issue a new
PIO request only if the previous PIO transfer timed out.

In the past the root cause of this issue was incorrectly identified (as it
often happens during link retraining or after link down event) and special
hack was implemented in Trusted Firmware to catch all SError events in EL3,
to ignore errors with code 0xbf000002 and not forwarding any other errors
to kernel and instead throw panic from EL3 Trusted Firmware handler.

Links to discussion and patches about this issue:
https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=3c7dcdac5c50
https://lore.kernel.org/linux-pci/20190316161243.29517-1-repk@triplefau.lt/
https://lore.kernel.org/linux-pci/971be151d24312cc533989a64bd454b4@www.loen.fr/
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/1541

But the real cause was the fact that during link retraining or after link
down event the PIO transfer may take longer time, up to the 1.44s until it
times out. This increased probability that a new PIO transfer would be
issued by kernel while previous one has not finished yet.

After applying this change into the kernel, it is possible to revert the
mentioned TF-A hack and SError events do not have to be caught in TF-A EL3.

Link: https://lore.kernel.org/r/20210608203655.31228-1-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Marek Behún <kabel@kernel.org>
Cc: stable@vger.kernel.org # 7fbcb5da81 ("PCI: aardvark: Don't rely on jiffies while holding spinlock")
2021-06-18 10:32:35 -05:00
..
cadence pci-v5.13-changes 2021-05-05 13:24:11 -07:00
dwc PCI: tegra194: Fix MCFG quirk build regressions 2021-06-18 10:32:34 -05:00
mobiveil PCI: mobiveil: Improve PCIE_LAYERSCAPE_GEN4 dependencies 2021-03-23 10:29:24 +00:00
Kconfig Merge branch 'remotes/lorenzo/pci/msi' 2021-05-04 10:43:30 -05:00
Makefile Merge branch 'remotes/lorenzo/pci/mediatek' 2021-05-04 10:43:28 -05:00
pci-aardvark.c PCI: aardvark: Fix kernel panic during PIO transfer 2021-06-18 10:32:35 -05:00
pci-ftpci100.c PCI: Set bridge map_irq and swizzle_irq to default functions 2020-08-04 16:36:30 +01:00
pci-host-common.c PCI/MSI: Make pci_host_common_probe() declare its reliance on MSI domains 2021-04-20 14:11:22 +01:00
pci-host-generic.c PCI: Unify ECAM constants in native PCI Express drivers 2020-12-10 14:55:49 -06:00
pci-hyperv-intf.c PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface 2019-08-22 00:25:12 -07:00
pci-hyperv.c pci-v5.13-changes 2021-05-05 13:24:11 -07:00
pci-loongson.c PCI: loongson: Simplify loongson_pci_probe() return expression 2020-10-02 12:56:31 +01:00
pci-mvebu.c PCI: mvebu: Fix duplicate resource requests 2020-11-04 13:55:30 -06:00
pci-rcar-gen2.c PCI: rcar-gen2: Use fallthrough pseudo-keyword 2020-09-07 15:17:20 +01:00
pci-tegra.c PCI: tegra: Convert to MSI domains 2021-04-20 14:11:01 +01:00
pci-thunder-ecam.c PCI: thunder: Fix compile testing 2021-03-11 15:07:46 -06:00
pci-thunder-pem.c PCI: thunder: Fix compile testing 2021-03-11 15:07:46 -06:00
pci-v3-semi.c PCI: v3-semi: Remove unneeded break 2020-10-20 10:59:55 -05:00
pci-versatile.c PCI: Set bridge map_irq and swizzle_irq to default functions 2020-08-04 16:36:30 +01:00
pci-xgene-msi.c PCI: xgene-msi: Fix race in installing chained irq handler 2021-01-18 15:48:06 +00:00
pci-xgene.c PCI: xgene: Fix cfg resource mapping 2021-03-31 10:28:38 +01:00
pcie-altera-msi.c PCI: altera-msi: Remove redundant dev_err call in altera_msi_probe() 2021-04-14 17:45:11 +01:00
pcie-altera.c Merge branch 'pci/irq-error' 2020-08-05 18:24:22 -05:00
pcie-brcmstb.c Merge branch 'pci/brcmstb' 2021-05-04 10:43:31 -05:00
pcie-hisi-error.c PCI: hip: Add handling of HiSilicon HIP PCIe controller errors 2020-09-16 10:30:42 +01:00
pcie-iproc-bcma.c PCI: iproc: Use module_bcma_driver to simplify the code 2020-10-02 12:45:26 +01:00
pcie-iproc-msi.c PCI: iproc: Fix return value of iproc_msi_irq_domain_alloc() 2021-03-22 14:18:05 +00:00
pcie-iproc-platform.c PCI: iproc: Fix using plain integer as NULL pointer in iproc_pcie_pltfm_probe 2020-10-09 13:37:57 +01:00
pcie-iproc.c Merge branch 'remotes/lorenzo/pci/iproc' 2020-12-15 15:11:12 -06:00
pcie-iproc.h PCI: iproc: Use pci_host_probe() to register host 2020-07-10 11:50:23 +01:00
pcie-mediatek-gen3.c PCI: mediatek-gen3: Add system PM support 2021-04-29 17:34:22 +01:00
pcie-mediatek.c Merge branch 'remotes/lorenzo/pci/msi' 2021-05-04 10:43:30 -05:00
pcie-microchip-host.c PCI: microchip: Remove dev_err() when handing an error from platform_get_irq() 2021-03-22 14:25:41 +00:00
pcie-rcar-ep.c PCI: rcar: Add endpoint mode support 2020-05-22 12:35:32 +01:00
pcie-rcar-host.c PCI: rcar: Convert to MSI domains 2021-04-20 14:11:21 +01:00
pcie-rcar.c PCI: rcar: Fix calculating mask for PCIEPAMR register 2020-05-11 11:29:48 +01:00
pcie-rcar.h PCI: rcar: Add endpoint mode support 2020-05-22 12:35:32 +01:00
pcie-rockchip-ep.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
pcie-rockchip-host.c PCI: Unify ECAM constants in native PCI Express drivers 2020-12-10 14:55:49 -06:00
pcie-rockchip.c PCI: rockchip: Make 'ep-gpios' DT property optional 2021-02-23 14:23:50 -06:00
pcie-rockchip.h PCI: Unify ECAM constants in native PCI Express drivers 2020-12-10 14:55:49 -06:00
pcie-xilinx-cpm.c PCI: xilinx-cpm: Fix reference count leak on error path 2021-01-25 17:27:41 +00:00
pcie-xilinx-nwl.c PCI: xilinx-nwl: Enable coherent PCIe DMA traffic using CCI 2021-04-07 16:59:23 +01:00
pcie-xilinx.c PCI: xilinx: Convert to MSI domains 2021-04-20 14:11:21 +01:00
vmd.c PCI: vmd: Disable MSI-X remapping when possible 2021-03-22 14:08:20 +00:00