]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.9.130/pci-aardvark-size-bridges-before-resources-allocation.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.130 / pci-aardvark-size-bridges-before-resources-allocation.patch
1 From 91a2968e245d6ba616db37001fa1a043078b1a65 Mon Sep 17 00:00:00 2001
2 From: Zachary Zhang <zhangzg@marvell.com>
3 Date: Fri, 29 Jun 2018 11:16:19 +0200
4 Subject: PCI: aardvark: Size bridges before resources allocation
5
6 From: Zachary Zhang <zhangzg@marvell.com>
7
8 commit 91a2968e245d6ba616db37001fa1a043078b1a65 upstream.
9
10 The PCIE I/O and MEM resource allocation mechanism is that root bus
11 goes through the following steps:
12
13 1. Check PCI bridges' range and computes I/O and Mem base/limits.
14
15 2. Sort all subordinate devices I/O and MEM resource requirements and
16 allocate the resources and writes/updates subordinate devices'
17 requirements to PCI bridges I/O and Mem MEM/limits registers.
18
19 Currently, PCI Aardvark driver only handles the second step and lacks
20 the first step, so there is an I/O and MEM resource allocation failure
21 when using a PCI switch. This commit fixes that by sizing bridges
22 before doing the resource allocation.
23
24 Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller
25 driver")
26 Signed-off-by: Zachary Zhang <zhangzg@marvell.com>
27 [Thomas: edit commit log.]
28 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
29 Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
30 Cc: <stable@vger.kernel.org>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33
34 ---
35 drivers/pci/host/pci-aardvark.c | 1 +
36 1 file changed, 1 insertion(+)
37
38 --- a/drivers/pci/host/pci-aardvark.c
39 +++ b/drivers/pci/host/pci-aardvark.c
40 @@ -976,6 +976,7 @@ static int advk_pcie_probe(struct platfo
41 return -ENOMEM;
42 }
43
44 + pci_bus_size_bridges(bus);
45 pci_bus_assign_resources(bus);
46
47 list_for_each_entry(child, &bus->children, node)