]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: host-common: Request bus reassignment when not probe-only
authorRatheesh Kannoth <rkannoth@marvell.com>
Tue, 14 Apr 2026 08:17:30 +0000 (13:47 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 18 Jun 2026 17:13:14 +0000 (12:13 -0500)
pci_host_common_init() is used by several generic ECAM host drivers.
After PCI core changes around pci_flags and preserve_config, these hosts
no longer opted into full bus number reassignment the way they did
before, which broke enumeration of devices on a Marvell CN106XX board.

When PCI_PROBE_ONLY is not set, add PCI_REASSIGN_ALL_BUS so
pci_scan_bridge_extend() takes the reassignment path: bus numbers can be
assigned from firmware EA data (e.g. pci_ea_fixed_busnrs()). Skip the
flag in probe-only mode so existing assignments are not overridden.

Fixes: 7246a4520b4b ("PCI: Use preserve_config in place of pci_flags")
Closes: https://lore.kernel.org/all/abkqm_LCd9zAM8cW@rkannoth-OptiPlex-7090/
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
[mani: added stable tag]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: add problem report link]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Cc: Vidya Sagar <vidyas@nvidia.com>
Link: https://patch.msgid.link/20260414081730.3864372-1-rkannoth@marvell.com
drivers/pci/controller/pci-host-common.c

index d6258c1cffe5ec480fd2a7e50b3af39ef6ac4c8c..99952fb7189b1a6247c4013908d7c798e03f84ac 100644 (file)
@@ -68,6 +68,10 @@ int pci_host_common_init(struct platform_device *pdev,
        if (IS_ERR(cfg))
                return PTR_ERR(cfg);
 
+       /* Do not reassign bus numbers if probe only */
+       if (!pci_has_flag(PCI_PROBE_ONLY))
+               pci_add_flags(PCI_REASSIGN_ALL_BUS);
+
        bridge->sysdata = cfg;
        bridge->ops = (struct pci_ops *)&ops->pci_ops;
        bridge->enable_device = ops->enable_device;