OpenCloudOS-Kernel/drivers/pci/controller
Pali Rohár 64f160e19e PCI: aardvark: Configure PCIe resources from 'ranges' DT property
In commit 6df6ba974a ("PCI: aardvark: Remove PCIe outbound window
configuration") was removed aardvark PCIe outbound window configuration and
commit description said that was recommended solution by HW designers.

But that commit completely removed support for configuring PCIe IO
resources without removing PCIe IO 'ranges' from DTS files. After that
commit PCIe IO space started to be treated as PCIe MEM space and accessing
it just caused kernel crash.

Moreover implementation of PCIe outbound windows prior that commit was
incorrect. It completely ignored offset between CPU address and PCIe bus
address and expected that in DTS is CPU address always same as PCIe bus
address without doing any checks. Also it completely ignored size of every
PCIe resource specified in 'ranges' DTS property and expected that every
PCIe resource has size 128 MB (also for PCIe IO range). Again without any
check. Apparently none of PCIe resource has in DTS specified size of 128
MB. So it was completely broken and thanks to how aardvark mask works,
configuration was completely ignored.

This patch reverts back support for PCIe outbound window configuration but
implementation is a new without issues mentioned above. PCIe outbound
window is required when DTS specify in 'ranges' property non-zero offset
between CPU and PCIe address space. To address recommendation by HW
designers as specified in commit description of 6df6ba974a, set default
outbound parameters as PCIe MEM access without translation and therefore
for this PCIe 'ranges' it is not needed to configure PCIe outbound window.
For PCIe IO space is needed to configure aardvark PCIe outbound window.

This patch fixes kernel crash when trying to access PCIe IO space.

Link: https://lore.kernel.org/r/20210624215546.4015-2-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # 6df6ba974a ("PCI: aardvark: Remove PCIe outbound window configuration")
2021-08-20 13:40:12 +01:00
..
cadence PCI: Fix kernel-doc formatting 2021-07-06 10:37:46 -05:00
dwc pci-v5.14-changes 2021-07-08 12:06:20 -07:00
mobiveil PCI: mobiveil: Remove unused readl and writel functions 2021-06-03 17:13:55 +01:00
Kconfig PCI: ixp4xx: Add a new driver for IXP4xx 2021-06-17 11:42:48 +02:00
Makefile PCI: ixp4xx: Add a new driver for IXP4xx 2021-06-17 11:42:48 +02:00
pci-aardvark.c PCI: aardvark: Configure PCIe resources from 'ranges' DT property 2021-08-20 13:40:12 +01:00
pci-ftpci100.c PCI: ftpci100: Rename macro name collision 2021-06-03 17:27:23 +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.14-changes 2021-07-08 12:06:20 -07:00
pci-ixp4xx.c PCI: ixp4xx: Add a new driver for IXP4xx 2021-06-17 11:42:48 +02: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: Add missing MODULE_DEVICE_TABLE 2021-06-24 17:43:12 -05: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 Merge branch 'pci/kernel-doc' 2021-07-06 10:56:29 -05: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 Merge branch 'remotes/lorenzo/pci/iproc' 2021-07-06 10:56:30 -05: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 PCI: Fix kernel-doc formatting 2021-07-06 10:37:46 -05:00
pcie-iproc.h PCI: Fix kernel-doc formatting 2021-07-06 10:37:46 -05:00
pcie-mediatek-gen3.c PCI: mediatek-gen3: Add missing MODULE_DEVICE_TABLE 2021-06-22 11:16:53 +01:00
pcie-mediatek.c PCI: mediatek: Remove redundant error printing in mtk_pcie_subsys_powerup() 2021-06-03 17:45:52 +01:00
pcie-microchip-host.c PCI: microchip: Make the struct event_descs static 2021-06-03 17:11:45 +01: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: rockchip: Register IRQ handlers after device and data are ready 2021-07-01 08:46:52 -05: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