kernel: add MIPS pci fix send upstream
[openwrt/openwrt.git] / target / linux / generic / patches-4.9 / 170-MIPS-PCI-scan-PCI-controllers-in-reverse-order.patch
1 From: Mathias Kresin <dev@kresin.me>
2 Date: Tue, 14 Mar 2017 22:12:12 +0100
3 Subject: [PATCH v2] MIPS: PCI: scan PCI controllers in reverse order
4
5 Commit 23dac14d058f ("MIPS: PCI: Use struct list_head lists") changed
6 the controller list from reverse to straight order without taking care
7 of the changed order for the scan of the recorded PCI controllers.
8
9 Traverse the list in reverse order to restore the former behaviour.
10
11 This patches fixes the following PCI error on lantiq:
12
13 pci 0000:01:00.0: BAR 0: error updating (0x1c000004 != 0x000000)
14
15 Fixes: 23dac14d058f ("MIPS: PCI: Use struct list_head lists")
16 Signed-off-by: Mathias Kresin <dev@kresin.me>
17 ---
18 arch/mips/pci/pci-legacy.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 --- a/arch/mips/pci/pci-legacy.c
22 +++ b/arch/mips/pci/pci-legacy.c
23 @@ -222,7 +222,7 @@ static int __init pcibios_init(void)
24 struct pci_controller *hose;
25
26 /* Scan all of the recorded PCI controllers. */
27 - list_for_each_entry(hose, &controllers, list)
28 + list_for_each_entry_reverse(hose, &controllers, list)
29 pcibios_scanbus(hose);
30
31 pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);