Blob Blame History Raw
From: mputtash@in.ibm.com
Subject: powerpc: Add an option to disable static PCI bus numbering
References: bsc#1122159
Patch-mainline: never, SUSE-specific patch for compatibility purpose

The static PCI bus numbering is not compatible with the previous
(fully dynamic) way of numbering PCI buses. In order to ease the
migration from SLES 12 SP3 to SP4, introduce a SUSE-specific kernel
command line option to disable the new static PCI bus numbering.

Customers can either use this option when migrating a SLES 12 SP3
server to SP4, or run a script which will convert the PCI bus number
in 70-persistent-net.rules.

Acked-by: Jean Delvare <jdelvare@suse.de>
---
 arch/powerpc/kernel/pci-common.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -73,6 +73,14 @@ const struct dma_map_ops *get_pci_dma_op
 }
 EXPORT_SYMBOL(get_pci_dma_ops);
 
+static bool disable_fixed_phb;
+static int __init parse_disable_fixed_phb(char *p)
+{
+	disable_fixed_phb = true;
+	return 0;
+}
+early_param("disable_fixed_phb", parse_disable_fixed_phb);
+
 static int get_phb_number(struct device_node *dn)
 {
 	int ret, phb_id = -1;
@@ -83,6 +91,9 @@ static int get_phb_number(struct device_
 	u32 prop_32;
 	u64 prop;
 
+	if (disable_fixed_phb)
+		goto dynamic;
+
 	/*
 	 * Try fixed PHB numbering first, by checking archs and reading
 	 * the respective device-tree properties. Firstly, try powernv by
@@ -101,6 +112,7 @@ static int get_phb_number(struct device_
 	if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
 		goto out_unlock;
 
+ dynamic:
 	/*
 	 * If not pseries nor powernv, or if fixed PHB numbering tried to add
 	 * the same PHB number twice, then fallback to dynamic PHB numbering.