[source] kernel: update MIPS pci fix to the accepted version

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 8 05:30:32 PDT 2017


mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/136718a3d91bb392de8bc04d9fd59d86b4f460c0

commit 136718a3d91bb392de8bc04d9fd59d86b4f460c0
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Mar 25 12:18:56 2017 +0100

    kernel: update MIPS pci fix to the accepted version
    
    Fix the list order instead of adjusting the controller scan order.
    Revert the former required changes to the lantiq PCIe driver.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 ...add-controllers-before-the-specified-head.patch | 31 ++++++++++++++++++++++
 ...PCI-scan-PCI-controllers-in-reverse-order.patch | 31 ----------------------
 .../0001-MIPS-lantiq-add-pcie-driver.patch         |  5 ++--
 3 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/target/linux/generic/patches-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch b/target/linux/generic/patches-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch
new file mode 100644
index 0000000..b6db663
--- /dev/null
+++ b/target/linux/generic/patches-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch
@@ -0,0 +1,31 @@
+From: Mathias Kresin <dev at kresin.me>
+Date: Sun, 26 Mar 2017 19:05:36 +0200
+Subject: MIPS: PCI: add controllers before the specified head
+
+With commit 23dac14d058f ("MIPS: PCI: Use struct list_head lists") new
+controllers are added after the specified head where they were added
+before the specified head previously.
+
+Use list_add_tail to restore the former order.
+
+This patches fixes the following PCI error on lantiq:
+
+  pci 0000:01:00.0: BAR 0: error updating (0x1c000004 != 0x000000)
+
+Fixes: 23dac14d058f ("MIPS: PCI: Use struct list_head lists")
+Signed-off-by: Mathias Kresin <dev at kresin.me>
+---
+ arch/mips/pci/pci-legacy.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/pci/pci-legacy.c
++++ b/arch/mips/pci/pci-legacy.c
+@@ -190,7 +190,7 @@ void register_pci_controller(struct pci_
+ 	}
+ 
+ 	INIT_LIST_HEAD(&hose->list);
+-	list_add(&hose->list, &controllers);
++	list_add_tail(&hose->list, &controllers);
+ 
+ 	/*
+ 	 * Do not panic here but later - this might happen before console init.
diff --git a/target/linux/generic/patches-4.9/170-MIPS-PCI-scan-PCI-controllers-in-reverse-order.patch b/target/linux/generic/patches-4.9/170-MIPS-PCI-scan-PCI-controllers-in-reverse-order.patch
deleted file mode 100644
index 74b54e9..0000000
--- a/target/linux/generic/patches-4.9/170-MIPS-PCI-scan-PCI-controllers-in-reverse-order.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Mathias Kresin <dev at kresin.me>
-Date: Tue, 14 Mar 2017 22:12:12 +0100
-Subject: [PATCH v2] MIPS: PCI: scan PCI controllers in reverse order
-
-Commit 23dac14d058f ("MIPS: PCI: Use struct list_head lists") changed
-the controller list from reverse to straight order without taking care
-of the changed order for the scan of the recorded PCI controllers.
-
-Traverse the list in reverse order to restore the former behaviour.
-
-This patches fixes the following PCI error on lantiq:
-
-  pci 0000:01:00.0: BAR 0: error updating (0x1c000004 != 0x000000)
-
-Fixes: 23dac14d058f ("MIPS: PCI: Use struct list_head lists")
-Signed-off-by: Mathias Kresin <dev at kresin.me>
----
- arch/mips/pci/pci-legacy.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/arch/mips/pci/pci-legacy.c
-+++ b/arch/mips/pci/pci-legacy.c
-@@ -222,7 +222,7 @@ static int __init pcibios_init(void)
- 	struct pci_controller *hose;
- 
- 	/* Scan all of the recorded PCI controllers.  */
--	list_for_each_entry(hose, &controllers, list)
-+	list_for_each_entry_reverse(hose, &controllers, list)
- 		pcibios_scanbus(hose);
- 
- 	pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);
diff --git a/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch
index 16d3f55..59d29d8 100644
--- a/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch
+++ b/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch
@@ -4143,7 +4143,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +
 --- a/arch/mips/pci/pci-legacy.c
 +++ b/arch/mips/pci/pci-legacy.c
-@@ -300,3 +300,31 @@ char *__init pcibios_setup(char *str)
+@@ -300,3 +300,30 @@ char *__init pcibios_setup(char *str)
  		return pcibios_plat_setup(str);
  	return str;
  }
@@ -4164,8 +4164,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +    int bus_nr = 0;
 +    struct pci_controller *hose;
 +
-+    if (!list_empty(&controllers))
-+        hose = list_last_entry(&controllers, struct pci_controller, list);
++    hose = list_first_entry_or_null(&controllers, struct pci_controller, list);
 +
 +    if (hose != NULL) {
 +        if (hose->bus != NULL) {



More information about the lede-commits mailing list