* [PATCH v1 00/11] generic pci_probe_only flag
@ 2012-02-22 18:19 Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 01/11] PCI: make pci_flags always available Bjorn Helgaas
` (10 more replies)
0 siblings, 11 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch
This series moves all architectures to a uniform way of indicating that we
shouldn't touch PCI resource assignments done by firmware. Previously, we had
a mix of using the PCI_PROBE_ONLY bit in pci_flags or arch-specific variables
like "pci_probe_only" or "use_firmware." This moves everybody to using the
PCI_PROBE_ONLY bit.
I want to do this to make it easier to move some resource assignment
functionality into the PCI core, while still allowing the architectures
to prevent resource changes.
The core has a very complicated interface for scanning buses and assigning
resources to devices, including these and probably other functions:
pci_create_root_bus
pci_scan_root_bus
pci_add_new_bus
pci_scan_bus
pci_scan_slot
pci_scan_child_bus
pci_bus_size_bridges
pci_bus_assign_resources
pci_assign_unassigned_bridge_resources
pci_claim_resource
pci_enable_bridges
pci_bus_add_devices
When you look at all the users of these interfaces (mostly architecture code
and hotplug drivers) and how many things are similar but not quite the same,
it's amazing that things work at all. I think we'll be better off if we
can make some of this functionality internal to the core and simplify the
external interface.
These patches are also available in this git repo:
git://github.com/bjorn-helgaas/linux.git pci-probe-only-v1-2bb44f1
Or you can browse them here:
https://github.com/bjorn-helgaas/linux/compare/master...pci-probe-only-v1-2bb44f1
---
Bjorn Helgaas (11):
PCI: make pci_flags always available
PCI: add pci_clear_flags()
alpha/PCI: replace pci_probe_only with pci_flags
arm/PCI: remove arch pci_flags definition
arm/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag
microblaze/PCI: remove unused pci_flags
mips/PCI: replace pci_probe_only with pci_flags
mips/PCI: removed unused pci_probe configurability
powerpc/PCI: replace pci_probe_only with pci_flags
unicore32/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag
PCI: make pci_flags non-weak
arch/alpha/include/asm/pci.h | 1 +
arch/alpha/kernel/pci.c | 15 ++++-----
arch/alpha/kernel/pci_impl.h | 3 --
arch/alpha/kernel/sys_marvel.c | 3 +-
arch/alpha/kernel/sys_titan.c | 3 +-
arch/arm/kernel/bios32.c | 7 ++--
arch/arm/mm/iomap.c | 3 --
arch/microblaze/include/asm/pci-bridge.h | 1 -
arch/microblaze/pci/pci-common.c | 48 +++++------------------------
arch/mips/include/asm/pci.h | 3 +-
arch/mips/pci/pci-bcm1480.c | 2 +
arch/mips/pci/pci-ip27.c | 2 +
arch/mips/pci/pci-lantiq.c | 3 +-
arch/mips/pci/pci-sb1250.c | 2 +
arch/mips/pci/pci-xlr.c | 2 +
arch/mips/pci/pci.c | 19 ++++-------
arch/powerpc/include/asm/ppc-pci.h | 2 -
arch/powerpc/kernel/pci-common.c | 3 --
arch/powerpc/kernel/pci_64.c | 5 ---
arch/powerpc/kernel/rtas_pci.c | 10 ++++--
arch/powerpc/kernel/setup_64.c | 1 +
arch/powerpc/platforms/iseries/pci.c | 2 +
arch/powerpc/platforms/maple/pci.c | 2 +
arch/powerpc/platforms/pasemi/pci.c | 2 +
arch/powerpc/platforms/powermac/pci.c | 2 +
arch/powerpc/platforms/powernv/pci-ioda.c | 5 +--
arch/powerpc/platforms/powernv/pci.c | 4 +-
arch/powerpc/platforms/wsp/wsp_pci.c | 2 +
arch/unicore32/kernel/pci.c | 6 ++--
drivers/pci/setup-bus.c | 3 ++
include/asm-generic/pci-bridge.h | 6 ++++
31 files changed, 67 insertions(+), 105 deletions(-)
--
Bjorn
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v1 01/11] PCI: make pci_flags always available
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 02/11] PCI: add pci_clear_flags() Bjorn Helgaas
` (9 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch
If we move resource assignment functions into the core, we'll still
need a way for architectures to prevent reassignment, e.g., the
"pci_probe_only" functionality, and we'll need a generic, always
available way the core can test for that. The "pci_flags"
arrangement used by several architectures seems like a convenient
way to do this.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/setup-bus.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 86b69f85..7b7d7e9 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -25,8 +25,11 @@
#include <linux/ioport.h>
#include <linux/cache.h>
#include <linux/slab.h>
+#include <asm-generic/pci-bridge.h>
#include "pci.h"
+unsigned int __weak pci_flags;
+
struct resource_list_x {
struct resource_list_x *next;
struct resource *res;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 02/11] PCI: add pci_clear_flags()
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 01/11] PCI: make pci_flags always available Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 03/11] alpha/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
` (8 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch
Add a pci_clear_flags() for cases when we statically initialize
pci_flags, then decide to clear things out later.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
include/asm-generic/pci-bridge.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h
index 4a5aca2..a5b5d5a 100644
--- a/include/asm-generic/pci-bridge.h
+++ b/include/asm-generic/pci-bridge.h
@@ -45,6 +45,11 @@ static inline void pci_add_flags(int flags)
pci_flags |= flags;
}
+static inline void pci_clear_flags(int flags)
+{
+ pci_flags &= ~flags;
+}
+
static inline int pci_has_flag(int flag)
{
return pci_flags & flag;
@@ -52,6 +57,7 @@ static inline int pci_has_flag(int flag)
#else
static inline void pci_set_flags(int flags) { }
static inline void pci_add_flags(int flags) { }
+static inline void pci_clear_flags(int flags) { }
static inline int pci_has_flag(int flag)
{
return 0;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 03/11] alpha/PCI: replace pci_probe_only with pci_flags
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 01/11] PCI: make pci_flags always available Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 02/11] PCI: add pci_clear_flags() Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 04/11] arm/PCI: remove arch pci_flags definition Bjorn Helgaas
` (7 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, linux-alpha
Some architectures (alpha, mips, powerpc) have an arch-specific
"pci_probe_only" flag. Others use PCI_PROBE_ONLY in pci_flags for
the same purpose. This moves alpha to the pci_flags approach so
generic code can use the same test across all architectures.
CC: linux-alpha@vger.kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/alpha/include/asm/pci.h | 1 +
arch/alpha/kernel/pci.c | 15 +++++++--------
arch/alpha/kernel/pci_impl.h | 3 ---
arch/alpha/kernel/sys_marvel.c | 3 ++-
arch/alpha/kernel/sys_titan.c | 3 ++-
5 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index 28d0497..6a3fe07 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -7,6 +7,7 @@
#include <linux/dma-mapping.h>
#include <asm/scatterlist.h>
#include <asm/machvec.h>
+#include <asm-generic/pci-bridge.h>
/*
* The following structure is used to manage multiple PCI busses.
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 8c723c1..3a5cdf2 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -43,12 +43,10 @@ const char *const pci_mem_names[] = {
const char pci_hae0_name[] = "HAE0";
-/* Indicate whether we respect the PCI setup left by console. */
/*
- * Make this long-lived so that we know when shutting down
- * whether we probed only or not.
+ * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource
+ * assignments.
*/
-int pci_probe_only;
/*
* The PCI controller list.
@@ -215,7 +213,7 @@ pdev_save_srm_config(struct pci_dev *dev)
struct pdev_srm_saved_conf *tmp;
static int printed = 0;
- if (!alpha_using_srm || pci_probe_only)
+ if (!alpha_using_srm || pci_has_flag(PCI_PROBE_ONLY))
return;
if (!printed) {
@@ -242,7 +240,7 @@ pci_restore_srm_config(void)
struct pdev_srm_saved_conf *tmp;
/* No need to restore if probed only. */
- if (pci_probe_only)
+ if (pci_has_flag(PCI_PROBE_ONLY))
return;
/* Restore SRM config. */
@@ -283,7 +281,7 @@ pcibios_fixup_bus(struct pci_bus *bus)
{
struct pci_dev *dev = bus->self;
- if (pci_probe_only && dev &&
+ if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
pci_read_bridge_bases(bus);
pcibios_fixup_device_resources(dev, bus);
@@ -374,7 +372,8 @@ pcibios_claim_one_bus(struct pci_bus *b)
if (r->parent || !r->start || !r->flags)
continue;
- if (pci_probe_only || (r->flags & IORESOURCE_PCI_FIXED))
+ if (pci_has_flag(PCI_PROBE_ONLY) ||
+ (r->flags & IORESOURCE_PCI_FIXED))
pci_claim_resource(dev, i);
}
}
diff --git a/arch/alpha/kernel/pci_impl.h b/arch/alpha/kernel/pci_impl.h
index 85457b2..2b0ac42 100644
--- a/arch/alpha/kernel/pci_impl.h
+++ b/arch/alpha/kernel/pci_impl.h
@@ -173,9 +173,6 @@ extern void pci_restore_srm_config(void);
extern struct pci_controller *hose_head, **hose_tail;
extern struct pci_controller *pci_isa_hose;
-/* Indicate that we trust the console to configure things properly. */
-extern int pci_probe_only;
-
extern unsigned long alpha_agpgart_size;
extern void common_init_pci(void);
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index 95cfc83..fc8b125 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -384,7 +384,8 @@ marvel_init_pci(void)
marvel_register_error_handlers();
- pci_probe_only = 1;
+ /* Indicate that we trust the console to configure things properly */
+ pci_set_flags(PCI_PROBE_ONLY);
common_init_pci();
locate_and_init_vga(NULL);
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index f47b30a..b8eafa0 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -331,7 +331,8 @@ titan_init_pci(void)
*/
titan_late_init();
- pci_probe_only = 1;
+ /* Indicate that we trust the console to configure things properly */
+ pci_set_flags(PCI_PROBE_ONLY);
common_init_pci();
SMC669_Init(0);
locate_and_init_vga(NULL);
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 04/11] arm/PCI: remove arch pci_flags definition
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (2 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 03/11] alpha/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 05/11] arm/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
` (6 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, Russell King, linux-arm-kernel, Rob Herring
The PCI core provides a pci_flags definition (currently __weak), so drop
the arm definition in favor of that.
We EXPORT_SYMBOL(pci_flags) as arm did previously. I'm dubious about
this: no other architecture exports it, and I didn't see any modules in
the tree that reference it.
CC: Rob Herring <rob.herring@calxeda.com>
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-arm-kernel@lists.infradead.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/arm/kernel/bios32.c | 2 ++
arch/arm/mm/iomap.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index f58ba35..f3fd52b 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -525,6 +525,7 @@ void __init pci_common_init(struct hw_pci *hw)
INIT_LIST_HEAD(&hw->buses);
+ pci_add_flags(PCI_REASSIGN_ALL_RSRC);
if (hw->preinit)
hw->preinit();
pcibios_init_hw(hw);
@@ -559,6 +560,7 @@ void __init pci_common_init(struct hw_pci *hw)
pci_bus_add_devices(bus);
}
}
+EXPORT_SYMBOL(pci_flags);
#ifndef CONFIG_PCI_HOST_ITE8152
void pcibios_set_master(struct pci_dev *dev)
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c
index e62956e..4614208 100644
--- a/arch/arm/mm/iomap.c
+++ b/arch/arm/mm/iomap.c
@@ -32,9 +32,6 @@ EXPORT_SYMBOL(pcibios_min_io);
unsigned long pcibios_min_mem = 0x01000000;
EXPORT_SYMBOL(pcibios_min_mem);
-unsigned int pci_flags = PCI_REASSIGN_ALL_RSRC;
-EXPORT_SYMBOL(pci_flags);
-
void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
{
if ((unsigned long)addr >= VMALLOC_START &&
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 05/11] arm/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (3 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 04/11] arm/PCI: remove arch pci_flags definition Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 06/11] microblaze/PCI: remove unused pci_flags Bjorn Helgaas
` (5 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, Russell King, linux-arm-kernel
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-arm-kernel@lists.infradead.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/arm/kernel/bios32.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index f3fd52b..8d7c22d 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -16,7 +16,6 @@
#include <asm/mach/pci.h>
static int debug_pci;
-static int use_firmware;
/*
* We can't use pci_find_device() here since we are
@@ -537,7 +536,7 @@ void __init pci_common_init(struct hw_pci *hw)
list_for_each_entry(sys, &hw->buses, node) {
struct pci_bus *bus = sys->bus;
- if (!use_firmware) {
+ if (!pci_has_flag(PCI_PROBE_ONLY)) {
/*
* Size the bridge windows.
*/
@@ -575,7 +574,7 @@ char * __init pcibios_setup(char *str)
debug_pci = 1;
return NULL;
} else if (!strcmp(str, "firmware")) {
- use_firmware = 1;
+ pci_add_flags(PCI_PROBE_ONLY);
return NULL;
}
return str;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 06/11] microblaze/PCI: remove unused pci_flags
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (4 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 05/11] arm/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 07/11] mips/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
` (4 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, microblaze-uclinux, Michal Simek
pci_flags is initialized to zero and never modified (I think this was just
copied from powerpc). Therefore, "(pci_flags & XX)" is always false and
"!(pci_flags & XX)" is always true, and we can remove all references
to pci_flags.
CC: Michal Simek <monstr@monstr.eu>
CC: microblaze-uclinux@itee.uq.edu.au
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/microblaze/include/asm/pci-bridge.h | 1 -
arch/microblaze/pci/pci-common.c | 48 ++++++------------------------
2 files changed, 9 insertions(+), 40 deletions(-)
diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
index e9834b2..cb5d397 100644
--- a/arch/microblaze/include/asm/pci-bridge.h
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -10,7 +10,6 @@
#include <linux/pci.h>
#include <linux/list.h>
#include <linux/ioport.h>
-#include <asm-generic/pci-bridge.h>
struct device_node;
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 85f2ac1..8a257a7 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -46,9 +46,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;
-
static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
unsigned long isa_io_base;
@@ -833,11 +830,7 @@ int pci_proc_domain(struct pci_bus *bus)
{
struct pci_controller *hose = pci_bus_to_host(bus);
- if (!(pci_flags & PCI_ENABLE_PROC_DOMAINS))
- return 0;
- if (pci_flags & PCI_COMPAT_DOMAIN_0)
- return hose->global_number != 0;
- return 1;
+ return 0;
}
void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
@@ -910,13 +903,7 @@ static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
struct resource *res = dev->resource + i;
if (!res->flags)
continue;
- /* On platforms that have PCI_PROBE_ONLY set, we don't
- * consider 0 as an unassigned BAR value. It's technically
- * a valid value, but linux doesn't like it... so when we can
- * re-assign things, we do so, but if we can't, we keep it
- * around and hope for the best...
- */
- if (res->start == 0 && !(pci_flags & PCI_PROBE_ONLY)) {
+ if (res->start == 0) {
pr_debug("PCI:%s Resource %d %016llx-%016llx [%x]" \
"is unassigned\n",
pci_name(dev), i,
@@ -959,10 +946,6 @@ static int __devinit pcibios_uninitialized_bridge_resource(struct pci_bus *bus,
u16 command;
int i;
- /* We don't do anything if PCI_PROBE_ONLY is set */
- if (pci_flags & PCI_PROBE_ONLY)
- return 0;
-
/* Job is a bit different between memory and IO */
if (res->flags & IORESOURCE_MEM) {
/* If the BAR is non-0 (res != pci_mem_offset) then it's
@@ -1107,9 +1090,6 @@ EXPORT_SYMBOL(pcibios_fixup_bus);
static int skip_isa_ioresource_align(struct pci_dev *dev)
{
- if ((pci_flags & PCI_CAN_SKIP_ISA_ALIGN) &&
- !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA))
- return 1;
return 0;
}
@@ -1236,8 +1216,6 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
* and as such ensure proper re-allocation
* later.
*/
- if (pci_flags & PCI_REASSIGN_ALL_RSRC)
- goto clear_resource;
pr = pci_find_parent_resource(bus->self, res);
if (pr == res) {
/* this happens when the generic PCI
@@ -1422,27 +1400,19 @@ void __init pcibios_resource_survey(void)
list_for_each_entry(b, &pci_root_buses, node)
pcibios_allocate_bus_resources(b);
- if (!(pci_flags & PCI_REASSIGN_ALL_RSRC)) {
- pcibios_allocate_resources(0);
- pcibios_allocate_resources(1);
- }
+ pcibios_allocate_resources(0);
+ pcibios_allocate_resources(1);
/* Before we start assigning unassigned resource, we try to reserve
* the low IO area and the VGA memory area if they intersect the
* bus available resources to avoid allocating things on top of them
*/
- if (!(pci_flags & PCI_PROBE_ONLY)) {
- list_for_each_entry(b, &pci_root_buses, node)
- pcibios_reserve_legacy_regions(b);
- }
+ list_for_each_entry(b, &pci_root_buses, node)
+ pcibios_reserve_legacy_regions(b);
- /* Now, if the platform didn't decide to blindly trust the firmware,
- * we proceed to assigning things that were left unassigned
- */
- if (!(pci_flags & PCI_PROBE_ONLY)) {
- pr_debug("PCI: Assigning unassigned resources...\n");
- pci_assign_unassigned_resources();
- }
+ /* Now proceed to assigning things that were left unassigned */
+ pr_debug("PCI: Assigning unassigned resources...\n");
+ pci_assign_unassigned_resources();
}
#ifdef CONFIG_HOTPLUG
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 07/11] mips/PCI: replace pci_probe_only with pci_flags
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (5 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 06/11] microblaze/PCI: remove unused pci_flags Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 08/11] mips/PCI: removed unused pci_probe configurability Bjorn Helgaas
` (3 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, linux-mips, Ralf Baechle
Some architectures (alpha, mips, powerpc) have an arch-specific
"pci_probe_only" flag. Others use PCI_PROBE_ONLY in pci_flags for
the same purpose. This moves mips to the pci_flags approach so
generic code can use the same test across all architectures.
CC: Ralf Baechle <ralf@linux-mips.org>
CC: linux-mips@linux-mips.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/mips/include/asm/pci.h | 3 +--
arch/mips/pci/pci-bcm1480.c | 2 +-
arch/mips/pci/pci-ip27.c | 2 +-
arch/mips/pci/pci-lantiq.c | 3 ++-
arch/mips/pci/pci-sb1250.c | 2 +-
arch/mips/pci/pci-xlr.c | 2 +-
arch/mips/pci/pci.c | 13 +++++--------
7 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 576397c..1e4fa3d 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -92,6 +92,7 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
#include <asm/scatterlist.h>
#include <linux/string.h>
#include <asm/io.h>
+#include <asm-generic/pci-bridge.h>
struct pci_dev;
@@ -145,8 +146,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
#define arch_setup_msi_irqs arch_setup_msi_irqs
#endif
-extern int pci_probe_only;
-
extern char * (*pcibios_plat_setup)(char *str);
#endif /* _ASM_PCI_H */
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index af8c319..37b52dc 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -204,7 +204,7 @@ static int __init bcm1480_pcibios_init(void)
uint64_t reg;
/* CFE will assign PCI resources */
- pci_probe_only = 1;
+ pci_set_flags(PCI_PROBE_ONLY);
/* Avoid ISA compat ranges. */
PCIBIOS_MIN_IO = 0x00008000UL;
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index 193e949..0fbe4c0 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -50,7 +50,7 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
bridge_t *bridge;
int slot;
- pci_probe_only = 1;
+ pci_set_flags(PCI_PROBE_ONLY);
printk("a bridge\n");
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
index be1e1af..030c77e 100644
--- a/arch/mips/pci/pci-lantiq.c
+++ b/arch/mips/pci/pci-lantiq.c
@@ -270,7 +270,8 @@ static int __devinit ltq_pci_probe(struct platform_device *pdev)
{
struct ltq_pci_data *ltq_pci_data =
(struct ltq_pci_data *) pdev->dev.platform_data;
- pci_probe_only = 0;
+
+ pci_clear_flags(PCI_PROBE_ONLY);
ltq_pci_irq_map = ltq_pci_data->irq;
ltq_pci_membase = ioremap_nocache(PCI_CR_BASE_ADDR, PCI_CR_SIZE);
ltq_pci_mapped_cfg =
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
index 1711e8e..dd97f3a 100644
--- a/arch/mips/pci/pci-sb1250.c
+++ b/arch/mips/pci/pci-sb1250.c
@@ -213,7 +213,7 @@ static int __init sb1250_pcibios_init(void)
uint64_t reg;
/* CFE will assign PCI resources */
- pci_probe_only = 1;
+ pci_set_flags(PCI_PROBE_ONLY);
/* Avoid ISA compat ranges. */
PCIBIOS_MIN_IO = 0x00008000UL;
diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c
index 3d701a9..1644805 100644
--- a/arch/mips/pci/pci-xlr.c
+++ b/arch/mips/pci/pci-xlr.c
@@ -292,7 +292,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
static int __init pcibios_init(void)
{
/* PSB assigns PCI resources */
- pci_probe_only = 1;
+ pci_set_flags(PCI_PROBE_ONLY);
pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20);
/* Extend IO port for memory mapped io */
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index aec2b11..2a11045 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -20,12 +20,9 @@
#include <asm/cpu-info.h>
/*
- * Indicate whether we respect the PCI setup left by the firmware.
- *
- * Make this long-lived so that we know when shutting down
- * whether we probed only or not.
+ * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource
+ * assignments.
*/
-int pci_probe_only;
#define PCI_ASSIGN_ALL_BUSSES 1
@@ -92,7 +89,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
if (!hose->iommu)
PCI_DMA_BUS_IS_PHYS = 1;
- if (hose->get_busno && pci_probe_only)
+ if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY))
next_busno = (*hose->get_busno)();
pci_add_resource(&resources, hose->mem_resource);
@@ -115,7 +112,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
need_domain_info = 1;
}
- if (!pci_probe_only) {
+ if (!pci_has_flag(PCI_PROBE_ONLY)) {
pci_bus_size_bridges(bus);
pci_bus_assign_resources(bus);
pci_enable_bridges(bus);
@@ -282,7 +279,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
struct list_head *ln;
struct pci_dev *dev = bus->self;
- if (pci_probe_only && dev &&
+ if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
pci_read_bridge_bases(bus);
pcibios_fixup_device_resources(dev, bus);
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 08/11] mips/PCI: removed unused pci_probe configurability
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (6 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 07/11] mips/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
` (2 subsequent siblings)
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, linux-mips, Ralf Baechle
We never assign anything other than PCI_ASSIGN_ALL_BUSSES to pci_probe,
so just remove the indirection. If configurability is required in the
future, please use the pci_flags/PCI_REASSIGN_ALL_BUS functionality
as is done for powerpc.
CC: Ralf Baechle <ralf@linux-mips.org>
CC: linux-mips@linux-mips.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/mips/pci/pci.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 2a11045..19f6d19 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -24,10 +24,6 @@
* assignments.
*/
-#define PCI_ASSIGN_ALL_BUSSES 1
-
-unsigned int pci_probe = PCI_ASSIGN_ALL_BUSSES;
-
/*
* The PCI controller list.
*/
@@ -238,7 +234,7 @@ static int pcibios_enable_resources(struct pci_dev *dev, int mask)
unsigned int pcibios_assign_all_busses(void)
{
- return (pci_probe & PCI_ASSIGN_ALL_BUSSES) ? 1 : 0;
+ return 1;
}
int pcibios_enable_device(struct pci_dev *dev, int mask)
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (7 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 08/11] mips/PCI: removed unused pci_probe configurability Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-22 18:19 ` [PATCH v1 10/11] unicore32/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 11/11] PCI: make pci_flags non-weak Bjorn Helgaas
10 siblings, 2 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, Benjamin Herrenschmidt, linuxppc-dev
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. Note that we must set the ppc64
default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
the platform .setup_arch() method, which may override the default.
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 | 2 --
arch/powerpc/kernel/pci-common.c | 3 ---
arch/powerpc/kernel/pci_64.c | 5 -----
arch/powerpc/kernel/rtas_pci.c | 10 +++++++---
arch/powerpc/kernel/setup_64.c | 1 +
arch/powerpc/platforms/iseries/pci.c | 2 +-
arch/powerpc/platforms/maple/pci.c | 2 +-
arch/powerpc/platforms/pasemi/pci.c | 2 +-
arch/powerpc/platforms/powermac/pci.c | 2 +-
arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++---
arch/powerpc/platforms/powernv/pci.c | 4 ++--
arch/powerpc/platforms/wsp/wsp_pci.c | 2 +-
12 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 6d42297..a96d012 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -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
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index cce98d7..6d03da4 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -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;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 3318d39..75417fd 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -33,8 +33,6 @@
#include <asm/machdep.h>
#include <asm/ppc-pci.h>
-unsigned long pci_probe_only = 1;
-
/* 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
*/
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 6cd8f01..140735c 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -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,
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4cb8f1e..639baa9 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -590,6 +590,7 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif
+ pci_add_flags(PCI_PROBE_ONLY);
if (ppc_md.setup_arch)
ppc_md.setup_arch();
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index c754128..171b2f3 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -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
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 401e3f3..465ee8f 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -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)
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index b6a0ec4..b27d886 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -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)
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 31a7d3a..c829e58 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1060,7 +1060,7 @@ void __init pmac_pci_init(void)
/* pmac_check_ht_link(); */
/* We can allocate missing resources if any */
- pci_probe_only = 0;
+ pci_clear_flags(PCI_PROBE_ONLY);
#else /* CONFIG_PPC64 */
init_p2pbridge();
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 5e155df..fbdd74d 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -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);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index f92b9ef..30abdd7 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -561,10 +561,10 @@ 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);
/* We do not want to just probe */
- pci_probe_only = 0;
+ pci_clear_flags(PCI_PROBE_ONLY);
/* OPAL absent, try POPAL first then RTAS detection of PHBs */
if (!firmware_has_feature(FW_FEATURE_OPAL)) {
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c
index d24b3ac..c5924ce 100644
--- a/arch/powerpc/platforms/wsp/wsp_pci.c
+++ b/arch/powerpc/platforms/wsp/wsp_pci.c
@@ -682,7 +682,7 @@ static int __init wsp_setup_one_phb(struct device_node *np)
/* XXX Force re-assigning of everything for now */
pci_add_flags(PCI_REASSIGN_ALL_BUS | PCI_REASSIGN_ALL_RSRC |
PCI_ENABLE_PROC_DOMAINS);
- pci_probe_only = 0;
+ pci_clear_flags(PCI_PROBE_ONLY);
/* Calculate how the TCE space is divided */
phb->dma32_base = 0;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 10/11] unicore32/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (8 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 11/11] PCI: make pci_flags non-weak Bjorn Helgaas
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch, Guan Xuetao
CC: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/unicore32/kernel/pci.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c
index a8f07fe..6c1248f 100644
--- a/arch/unicore32/kernel/pci.c
+++ b/arch/unicore32/kernel/pci.c
@@ -19,9 +19,9 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/io.h>
+#include <asm-generic/pci-bridge.h>
static int debug_pci;
-static int use_firmware;
#define CONFIG_CMD(bus, devfn, where) \
(0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
@@ -276,7 +276,7 @@ static int __init pci_common_init(void)
pci_fixup_irqs(pci_common_swizzle, pci_puv3_map_irq);
- if (!use_firmware) {
+ if (!pci_has_flag(PCI_PROBE_ONLY)) {
/*
* Size the bridge windows.
*/
@@ -303,7 +303,7 @@ char * __devinit pcibios_setup(char *str)
debug_pci = 1;
return NULL;
} else if (!strcmp(str, "firmware")) {
- use_firmware = 1;
+ pci_add_flags(PCI_PROBE_ONLY);
return NULL;
}
return str;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v1 11/11] PCI: make pci_flags non-weak
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
` (9 preceding siblings ...)
2012-02-22 18:19 ` [PATCH v1 10/11] unicore32/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
@ 2012-02-22 18:19 ` Bjorn Helgaas
10 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
To: linux-pci; +Cc: linux-arch
No architecture defines its own pci_flags, so the core symbol does not
need to be weak.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/setup-bus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 7b7d7e9..c172ebb 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -28,7 +28,7 @@
#include <asm-generic/pci-bridge.h>
#include "pci.h"
-unsigned int __weak pci_flags;
+unsigned int pci_flags;
struct resource_list_x {
struct resource_list_x *next;
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 18:19 ` [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
@ 2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-23 18:49 ` Bjorn Helgaas
2012-03-05 3:54 ` Olof Johansson
2012-02-22 21:41 ` Benjamin Herrenschmidt
1 sibling, 2 replies; 18+ messages in thread
From: Benjamin Herrenschmidt @ 2012-02-22 21:41 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-arch, linuxppc-dev, Olof Johansson
On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
> int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
> diff --git a/arch/powerpc/platforms/pasemi/pci.c
> b/arch/powerpc/platforms/pasemi/pci.c
> index b6a0ec4..b27d886 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -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);
> }
Olof, do you remember why you used to set that on pasemi ?
I would have expected it to be clear, so the kernel can re-assign things
if needed. We really only want it set for pseries because of the
hypervisor being a PITA :-)
Cheers,
Ben.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 18:19 ` [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
2012-02-22 21:41 ` Benjamin Herrenschmidt
@ 2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-22 22:47 ` Bjorn Helgaas
1 sibling, 1 reply; 18+ messages in thread
From: Benjamin Herrenschmidt @ 2012-02-22 21:41 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-arch, linuxppc-dev
On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
> 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.
Ah yes, those flags are now common indeed.
> The PCI core provides a pci_flags definition (currently __weak), so drop
> the powerpc definitions in favor of that. Note that we must set the ppc64
> default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
> the platform .setup_arch() method, which may override the default.
Ah wait, I have a patch about to hit -next that flips the ppc64
default...
Maybe it's easier if you just pick it up and stick it in your series,
that will avoid integration clashes..
http://patchwork.ozlabs.org/patch/141225/
Cheers,
Ben.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 21:41 ` Benjamin Herrenschmidt
@ 2012-02-22 22:47 ` Bjorn Helgaas
0 siblings, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-22 22:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linux-pci, linux-arch, linuxppc-dev
On Wed, Feb 22, 2012 at 1:41 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
>> 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.
>
> Ah yes, those flags are now common indeed.
>
>> The PCI core provides a pci_flags definition (currently __weak), so drop
>> the powerpc definitions in favor of that. Note that we must set the ppc64
>> default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
>> the platform .setup_arch() method, which may override the default.
>
> Ah wait, I have a patch about to hit -next that flips the ppc64
> default...
>
> Maybe it's easier if you just pick it up and stick it in your series,
> that will avoid integration clashes..
>
> http://patchwork.ozlabs.org/patch/141225/
Sure, I'll pick up that patch and repost the series. I'll wait until
tomorrow or so in case anybody else has comments.
Thanks,
Bjorn
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 21:41 ` Benjamin Herrenschmidt
@ 2012-02-23 18:49 ` Bjorn Helgaas
2012-03-05 3:54 ` Olof Johansson
1 sibling, 0 replies; 18+ messages in thread
From: Bjorn Helgaas @ 2012-02-23 18:49 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linux-pci, linux-arch, linuxppc-dev, Olof Johansson
On Wed, Feb 22, 2012 at 1:41 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
>> int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
>> diff --git a/arch/powerpc/platforms/pasemi/pci.c
>> b/arch/powerpc/platforms/pasemi/pci.c
>> index b6a0ec4..b27d886 100644
>> --- a/arch/powerpc/platforms/pasemi/pci.c
>> +++ b/arch/powerpc/platforms/pasemi/pci.c
>> @@ -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);
>> }
>
> Olof, do you remember why you used to set that on pasemi ?
>
> I would have expected it to be clear, so the kernel can re-assign things
> if needed. We really only want it set for pseries because of the
> hypervisor being a PITA :-)
Speaking of the hypervisor, powerpc has this of_scan_bus() thing which
seems to discover PCI devices using the OF device tree rather than
using PCI config accesses. This seems related to the "pci_probe_only"
idea.
I wonder whether it would be possible/feasible/desirable to implement
this by using config space accessors that would internally look at the
OF device tree. Then we possibly could use the standard PCI scan bus
path. Maybe the core could detect non-changeable BARs somehow and
mark them, e.g., with IORESOURCE_PCI_FIXED.
Just a pie-in-the sky thought for now; I have no concrete plans to do
anything like this, but it seems like it might allow more unification
if it were possible.
Bjorn
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-23 18:49 ` Bjorn Helgaas
@ 2012-03-05 3:54 ` Olof Johansson
2012-03-05 3:59 ` Olof Johansson
1 sibling, 1 reply; 18+ messages in thread
From: Olof Johansson @ 2012-03-05 3:54 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Bjorn Helgaas, linux-pci, linux-arch, linuxppc-dev
On Thu, Feb 23, 2012 at 08:41:39AM +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
> > int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
> > diff --git a/arch/powerpc/platforms/pasemi/pci.c
> > b/arch/powerpc/platforms/pasemi/pci.c
> > index b6a0ec4..b27d886 100644
> > --- a/arch/powerpc/platforms/pasemi/pci.c
> > +++ b/arch/powerpc/platforms/pasemi/pci.c
> > @@ -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);
> > }
>
> Olof, do you remember why you used to set that on pasemi ?
Oops, going through email backlog. Sorry for the slow response.
> I would have expected it to be clear, so the kernel can re-assign things
> if needed. We really only want it set for pseries because of the
> hypervisor being a PITA :-)
Well, we did have some hypervisor work done at PA Semi too, and chances
are it's from there. But it's unlikely since I think we booted pseries
(PAPR) kernels under rHype.
I suspect we just went with it for whatever legacy reasons and didn't
revisit later -- since our firmware enumerated busses reliably there
was no reason to redo it from the kernel.
I've booted a system with pci_probe_only off here, and it seems happy
enough. I'll send you a patch.
Bjorn, that means you can drop this chunk of the patch, I suppose.
-Olof
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
2012-03-05 3:54 ` Olof Johansson
@ 2012-03-05 3:59 ` Olof Johansson
0 siblings, 0 replies; 18+ messages in thread
From: Olof Johansson @ 2012-03-05 3:59 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Bjorn Helgaas, linux-pci, linux-arch, linuxppc-dev
On Sun, Mar 4, 2012 at 7:54 PM, Olof Johansson <olof@lixom.net> wrote:
> On Thu, Feb 23, 2012 at 08:41:39AM +1100, Benjamin Herrenschmidt wrote:
>> On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
>> > int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
>> > diff --git a/arch/powerpc/platforms/pasemi/pci.c
>> > b/arch/powerpc/platforms/pasemi/pci.c
>> > index b6a0ec4..b27d886 100644
>> > --- a/arch/powerpc/platforms/pasemi/pci.c
>> > +++ b/arch/powerpc/platforms/pasemi/pci.c
>> > @@ -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);
>> > }
>>
>> Olof, do you remember why you used to set that on pasemi ?
>
> Oops, going through email backlog. Sorry for the slow response.
>
>> I would have expected it to be clear, so the kernel can re-assign things
>> if needed. We really only want it set for pseries because of the
>> hypervisor being a PITA :-)
>
> Well, we did have some hypervisor work done at PA Semi too, and chances
> are it's from there. But it's unlikely since I think we booted pseries
> (PAPR) kernels under rHype.
>
> I suspect we just went with it for whatever legacy reasons and didn't
> revisit later -- since our firmware enumerated busses reliably there
> was no reason to redo it from the kernel.
>
> I've booted a system with pci_probe_only off here, and it seems happy
> enough. I'll send you a patch.
>
> Bjorn, that means you can drop this chunk of the patch, I suppose.
Sorry to comment to myself so quickly but since I just noticed that
the patch is in -next, don't worry about rebasing your work -- we'll
take out the flag use later.
-Olof
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2012-03-05 3:59 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22 18:19 [PATCH v1 00/11] generic pci_probe_only flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 01/11] PCI: make pci_flags always available Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 02/11] PCI: add pci_clear_flags() Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 03/11] alpha/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 04/11] arm/PCI: remove arch pci_flags definition Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 05/11] arm/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 06/11] microblaze/PCI: remove unused pci_flags Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 07/11] mips/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 08/11] mips/PCI: removed unused pci_probe configurability Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags Bjorn Helgaas
2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-23 18:49 ` Bjorn Helgaas
2012-03-05 3:54 ` Olof Johansson
2012-03-05 3:59 ` Olof Johansson
2012-02-22 21:41 ` Benjamin Herrenschmidt
2012-02-22 22:47 ` Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 10/11] unicore32/PCI: use pci_flags PCI_PROBE_ONLY instead of arm-specific flag Bjorn Helgaas
2012-02-22 18:19 ` [PATCH v1 11/11] PCI: make pci_flags non-weak Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).