aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2011-02-02 12:40:44 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2018-10-05 00:54:19 +0200
commita566ba1ef6a25241d9a12eafecf5d0e5d8e49839 (patch)
treed2296a12d6ea65fd6c9b7fca58abb64d2fda134b
parentpool/2.6.25-disable-kbdrate-at-boot.diff (diff)
downloadlinux-a566ba1ef6a25241d9a12eafecf5d0e5d8e49839.tar.gz
x86/pci: add support for pci=rev-net
Scan network devices in the opposite order on each bus if pci=rev-net is found. Reviewed-by: Bertrand Jacquin <bertrand@jacquin.bzh> Signed-off-by: Bertrand Jacquin <bertrand@jacquin.bzh>
-rw-r--r--arch/x86/include/asm/pci_x86.h1
-rw-r--r--arch/x86/pci/common.c5
-rw-r--r--drivers/pci/probe.c7
3 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 959d618dbb17..a9eb23ac5692 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -39,6 +39,7 @@ do { \
#define PCI_ROOT_NO_CRS 0x100000
#define PCI_NOASSIGN_BARS 0x200000
#define PCI_BIG_ROOT_WINDOW 0x400000
+#define PCI_REV_NETWORK 0x800000
extern unsigned int pci_probe;
extern unsigned long pirq_table_addr;
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 563049c483a1..ca7de5f27a7c 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -19,6 +19,8 @@
#include <asm/pci_x86.h>
#include <asm/setup.h>
+extern int pci_reverse_net;
+
unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
PCI_PROBE_MMCONF;
@@ -605,6 +607,9 @@ char *__init pcibios_setup(char *str)
} else if (!strcmp(str, "routeirq")) {
pci_routeirq = 1;
return NULL;
+ } else if (!strcmp(str, "rev-net")) {
+ pci_reverse_net = 1;
+ return NULL;
} else if (!strcmp(str, "skip_isa_align")) {
pci_probe |= PCI_CAN_SKIP_ISA_ALIGN;
return NULL;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index a1a243ee36bb..5b817be8aa0f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -87,6 +87,8 @@ int no_pci_devices(void)
}
EXPORT_SYMBOL(no_pci_devices);
+int pci_reverse_net;
+
/*
* PCI Bus Class
*/
@@ -1010,7 +1012,10 @@ struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
child = pci_alloc_child_bus(parent, dev, busnr);
if (child) {
down_write(&pci_bus_sem);
- list_add_tail(&child->node, &parent->children);
+ if (pci_reverse_net && (dev->class >> 8) == PCI_CLASS_NETWORK_ETHERNET)
+ list_add(&child->node, &parent->children);
+ else
+ list_add_tail(&child->node, &parent->children);
up_write(&pci_bus_sem);
}
return child;