summaryrefslogtreecommitdiffstats
path: root/sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch')
-rw-r--r--sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch b/sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch
new file mode 100644
index 00000000..e0b95a2c
--- /dev/null
+++ b/sys-kernel/boest-v4.14.127/0006-x86-pci-add-support-for-pci-rev-net.patch
@@ -0,0 +1,75 @@
+From 4140558399d7edd514a69ab019acdad4726893a9 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Wed, 2 Feb 2011 12:40:44 +0100
+Subject: [PATCH 06/19] 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>
+---
+ arch/x86/include/asm/pci_x86.h | 1 +
+ arch/x86/pci/common.c | 5 +++++
+ drivers/pci/probe.c | 7 ++++++-
+ 3 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
+index 7a5d6695abd3..5dbc1fd39e10 100644
+--- a/arch/x86/include/asm/pci_x86.h
++++ b/arch/x86/include/asm/pci_x86.h
+@@ -38,6 +38,7 @@ do { \
+ #define PCI_NOASSIGN_ROMS 0x80000
+ #define PCI_ROOT_NO_CRS 0x100000
+ #define PCI_NOASSIGN_BARS 0x200000
++#define PCI_REV_NETWORK 0x400000
+
+ 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 7a5350d08cef..c25f1e127c0c 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;
+
+@@ -600,6 +602,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 e23bfd9845b1..d361e7020a0d 100644
+--- a/drivers/pci/probe.c
++++ b/drivers/pci/probe.c
+@@ -85,6 +85,8 @@ int no_pci_devices(void)
+ }
+ EXPORT_SYMBOL(no_pci_devices);
+
++int pci_reverse_net;
++
+ /*
+ * PCI Bus Class
+ */
+@@ -943,7 +945,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;