linux/drivers/pci/controller
Geert Uytterhoeven bdb32a0f67 PCI: host-generic: Set driver_data before calling gen_pci_init()
On MicroChip MPFS Icicle:

  microchip-pcie 2000000000.pcie: host bridge /soc/pcie@2000000000 ranges:
  microchip-pcie 2000000000.pcie: Parsing ranges property...
  microchip-pcie 2000000000.pcie:      MEM 0x2008000000..0x2087ffffff -> 0x0008000000
  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000368
  Current swapper/0 pgtable: 4K pagesize, 39-bit VAs, pgdp=0x00000000814f1000
  [0000000000000368] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
  Oops [#1]
  Modules linked in:
  CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.15.0-rc1-icicle-00003-gafc0a570bb61 #232 NONE
  Hardware name: Microchip PolarFire-SoC Icicle Kit (DT)
  [...]
  [<ffffffff803fb8a4>] plda_pcie_setup_iomems+0xe/0x78
  [<ffffffff803fc246>] mc_platform_init+0x80/0x1d2
  [<ffffffff803f9c88>] pci_ecam_create+0x104/0x1e2
  [<ffffffff8000adbe>] pci_host_common_init+0x120/0x228
  [<ffffffff8000af42>] pci_host_common_probe+0x7c/0x8a

The initialization of driver_data was moved after the call to
gen_pci_init(), while the pci_ecam_ops.init() callback
mc_platform_init() expects it has already been initialized.

Fix this by moving the initialization of driver_data up.

Fixes: afc0a570bb ("PCI: host-generic: Extract an ECAM bridge creation helper from pci_host_common_probe()")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/774290708a6f0f683711914fda110742c18a7fb2.1750787223.git.geert+renesas@glider.be
Link: https://patch.msgid.link/20250625111806.4153773-2-maz@kernel.org
History 2025-06-30 12:30:03 -05:00
..
cadence Merge branch 'pci/controller/dw-rockchip' 2025-06-04 10:50:38 -05:00
dwc pci-v6.16-changes 2025-06-04 11:26:17 -07:00
mobiveil pci-v6.16-changes 2025-06-04 11:26:17 -07:00
plda pci-v6.16-changes 2025-06-04 11:26:17 -07:00
Kconfig pci-v6.16-changes 2025-06-04 11:26:17 -07:00
Makefile PCI: microchip: Move pcie-microchip-host.c to PLDA directory 2024-05-28 11:15:28 -05:00
pci-aardvark.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pci-ftpci100.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pci-host-common.c PCI: host-generic: Set driver_data before calling gen_pci_init() 2025-06-30 12:30:03 -05:00
pci-host-common.h Merge branch 'pci/controller/dw-rockchip' 2025-06-04 10:50:38 -05:00
pci-host-generic.c PCI: host-common: Convert to library for host controller drivers 2025-05-30 12:21:57 -05: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 hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
pci-ixp4xx.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pci-loongson.c PCI: loongson: Enable MSI in LS7A Root Complex 2024-07-19 10:07:01 -05:00
pci-mvebu.c pci-v6.16-changes 2025-06-04 11:26:17 -07:00
pci-rcar-gen2.c PCI: rcar-gen2: Use devm_platform_get_and_ioremap_resource() 2023-07-13 18:12:35 +00:00
pci-tegra.c PCI: tegra: Convert to MSI parent infrastructure 2025-05-16 21:32:20 +02:00
pci-thunder-ecam.c PCI: host-common: Convert to library for host controller drivers 2025-05-30 12:21:57 -05:00
pci-thunder-pem.c PCI: host-common: Convert to library for host controller drivers 2025-05-30 12:21:57 -05:00
pci-v3-semi.c Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
pci-versatile.c PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules 2023-02-17 08:47:58 -06:00
pci-xgene-msi.c PCI: xgene: Convert to MSI parent infrastructure 2025-05-16 21:32:20 +02:00
pci-xgene.c PCI: Rename CRS Completion Status to RRS 2024-09-10 19:52:30 -05:00
pcie-altera-msi.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-altera.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-apple.c PCI: apple: Add tracking of probed root ports 2025-06-30 12:29:05 -05:00
pcie-brcmstb.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-hisi-error.c PCI: controller: Switch back to struct platform_driver::remove() 2024-10-03 16:44:49 -05:00
pcie-iproc-bcma.c PCI: Add defines for normal and subtractive PCI bridges 2022-02-17 15:29:35 -06:00
pcie-iproc-msi.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-iproc-platform.c PCI: controller: Switch back to struct platform_driver::remove() 2024-10-03 16:44:49 -05:00
pcie-iproc.c PCI: Rename CRS Completion Status to RRS 2024-09-10 19:52:30 -05:00
pcie-iproc.h PCI: iproc: Convert to platform remove callback returning void 2023-06-24 14:12:36 +00:00
pcie-mediatek-gen3.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-mediatek.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-mt7621.c PCI: mt7621: Use helper function for_each_available_child_of_node_scoped() 2025-03-06 09:31:45 +00:00
pcie-rcar-ep.c PCI: endpoint: Align pci_epc_set_msi(), pci_epc_ops::set_msi() nr_irqs encoding 2025-05-28 16:47:56 -05:00
pcie-rcar-host.c PCI: Fix typos 2025-03-08 15:08:45 -06: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: Avoid defines prefixed with CONFIG 2023-03-10 13:34:27 +01:00
pcie-rockchip-ep.c Merge branch 'pci/controller/rockchip' 2025-06-04 10:50:43 -05:00
pcie-rockchip-host.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-rockchip.c PCI: rockchip: Refactor rockchip_pcie_disable_clocks() signature 2025-01-15 18:24:12 +00:00
pcie-rockchip.h PCI: rockchip: Fix order of rockchip_pci_core_rsts 2025-04-19 19:17:02 +05:30
pcie-xilinx-common.h PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver 2023-10-26 15:02:02 +00:00
pcie-xilinx-cpm.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-xilinx-dma-pl.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-xilinx-nwl.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
pcie-xilinx.c PCI: Switch to irq_domain_create_linear() 2025-05-16 21:06:10 +02:00
vmd.c pci-v6.15-changes 2025-03-28 19:36:53 -07:00