]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/PCI: replace pci_probe_only with pci_flags
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:58 +0000 (20:18 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Feb 2012 03:18:58 +0000 (20:18 -0700)
We already use pci_flags, so this just sets pci_flags directly and removes
the intermediate step of figuring out pci_probe_only, then using it to set
pci_flags.

The PCI core provides a pci_flags definition (currently __weak), so drop
the powerpc definitions in favor of that.

CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/powerpc/include/asm/ppc-pci.h
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/rtas_pci.c
arch/powerpc/platforms/iseries/pci.c
arch/powerpc/platforms/maple/pci.c
arch/powerpc/platforms/pasemi/pci.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/pseries/setup.c

index 43268f15004e8082148cc1a57de8766fdad75c7d..f4f7ad89c5a850130ee4ffbf4012ca83c553d870 100644 (file)
@@ -45,8 +45,6 @@ extern void init_pci_config_tokens (void);
 extern unsigned long get_phb_buid (struct device_node *);
 extern int rtas_setup_phb(struct pci_controller *phb);
 
-extern unsigned long pci_probe_only;
-
 /* ---- EEH internal-use-only related routines ---- */
 #ifdef CONFIG_EEH
 
index cce98d76e905ad2188ce0d27e985308abaa2a433..6d03da4755725e3533d9a8a6c950dad4346b8c42 100644 (file)
@@ -50,9 +50,6 @@ static int global_phb_number;         /* Global phb counter */
 /* ISA Memory physical address */
 resource_size_t isa_mem_base;
 
-/* Default PCI flags is 0 on ppc32, modified at boot on ppc64 */
-unsigned int pci_flags = 0;
-
 
 static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
 
index f627eb7be9e2f08ad80b3ee8c8382325a2742f19..75417fdc773ca4d67ccd70b7b59b18aaa3431749 100644 (file)
@@ -33,8 +33,6 @@
 #include <asm/machdep.h>
 #include <asm/ppc-pci.h>
 
-unsigned long pci_probe_only = 0;
-
 /* pci_io_base -- the base address from which io bars are offsets.
  * This is the lowest I/O base address (so bar values are always positive),
  * and it *must* be the start of ISA space if an ISA bus exists because
@@ -55,9 +53,6 @@ static int __init pcibios_init(void)
         */
        ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
 
-       if (pci_probe_only)
-               pci_add_flags(PCI_PROBE_ONLY);
-
        /* On ppc64, we always enable PCI domains and we keep domain 0
         * backward compatible in /proc for video cards
         */
index 6cd8f0196b6d4401af0f91e368f67caa53cad133..140735c18c367aaec577784206e86cb0ddc57409 100644 (file)
@@ -276,7 +276,7 @@ void __init find_and_init_phbs(void)
        pci_devs_phb_init();
 
        /*
-        * pci_probe_only and pci_assign_all_buses can be set via properties
+        * PCI_PROBE_ONLY and PCI_REASSIGN_ALL_BUS can be set via properties
         * in chosen.
         */
        if (of_chosen) {
@@ -284,8 +284,12 @@ void __init find_and_init_phbs(void)
 
                prop = of_get_property(of_chosen,
                                "linux,pci-probe-only", NULL);
-               if (prop)
-                       pci_probe_only = *prop;
+               if (prop) {
+                       if (*prop)
+                               pci_add_flags(PCI_PROBE_ONLY);
+                       else
+                               pci_clear_flags(PCI_PROBE_ONLY);
+               }
 
 #ifdef CONFIG_PPC32 /* Will be made generic soon */
                prop = of_get_property(of_chosen,
index c75412884625f53cd0add4b5b8348238748d0ad1..171b2f30d6adcfa6c71eab457e54c7c84c874a5d 100644 (file)
@@ -868,7 +868,7 @@ void __init iSeries_pcibios_init(void)
        /* Install IO hooks */
        ppc_pci_io = iseries_pci_io;
 
-       pci_probe_only = 1;
+       pci_add_flags(PCI_PROBE_ONLY);
 
        /* iSeries has no IO space in the common sense, it needs to set
         * the IO base to 0
index 401e3f3f74c8f4e3774cb97f6e99f7aa37fa9e2a..465ee8f5c0868070d9ea8364a340a5aa1a5b6bda 100644 (file)
@@ -620,7 +620,7 @@ void __init maple_pci_init(void)
        }
 
        /* Tell pci.c to not change any resource allocations.  */
-       pci_probe_only = 1;
+       pci_add_flags(PCI_PROBE_ONLY);
 }
 
 int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
index b6a0ec45c69554c7558ec45f478ce40b5cf1411c..b27d8861116b7a21b7d4f56795787c0c0d3db8b9 100644 (file)
@@ -231,7 +231,7 @@ void __init pas_pci_init(void)
        pci_devs_phb_init();
 
        /* Use the common resource allocation mechanism */
-       pci_probe_only = 1;
+       pci_add_flags(PCI_PROBE_ONLY);
 }
 
 void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
index 5e155dfc4320ab011589d678408002dd05503a96..fbdd74dac3ac6573277ba4e6e853c5311ff8e0df 100644 (file)
@@ -1299,15 +1299,14 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np)
        /* Setup MSI support */
        pnv_pci_init_ioda_msis(phb);
 
-       /* We set both probe_only and PCI_REASSIGN_ALL_RSRC. This is an
+       /* We set both PCI_PROBE_ONLY and PCI_REASSIGN_ALL_RSRC. This is an
         * odd combination which essentially means that we skip all resource
         * fixups and assignments in the generic code, and do it all
         * ourselves here
         */
-       pci_probe_only = 1;
        ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb;
        ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook;
-       pci_add_flags(PCI_REASSIGN_ALL_RSRC);
+       pci_add_flags(PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC);
 
        /* Reset IODA tables to a clean state */
        rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET);
index a053f4fe5db8a42c3022f106f9a0e1cbc2bd2604..69dca5a8ada8928f69a8da53da374f764bb09eaf 100644 (file)
@@ -555,7 +555,7 @@ void __init pnv_pci_init(void)
 {
        struct device_node *np;
 
-       pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
+       pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
        /* OPAL absent, try POPAL first then RTAS detection of PHBs */
        if (!firmware_has_feature(FW_FEATURE_OPAL)) {
index 386e2656c2315c4d67c1fc39027daf17adb855df..fc2a6f60f665aa398baceb64b9c21f2fd498be89 100644 (file)
@@ -380,8 +380,8 @@ static void __init pSeries_setup_arch(void)
 
        fwnmi_init();
 
-       /* By default, only probe PCI (can be overriden by rtas_pci */
-       pci_probe_only = 1;
+       /* By default, only probe PCI (can be overriden by rtas_pci) */
+       pci_add_flags(PCI_PROBE_ONLY);
 
        /* Find and initialize PCI host bridges */
        init_pci_config_tokens();