summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-04 11:48:08 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-03-04 11:48:08 +0000
commit00cd46a93a96b1ef31db19e915a045df4f917918 (patch)
treedf3192b1f51d759ee29c3095d9a5318060761b87 /target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch
parente717b97d56c2ae6a29085b077d6848ab51a7dc89 (diff)
ar71xx: use backported PCI patches
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35877 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch')
-rw-r--r--target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch b/target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch
new file mode 100644
index 000000000..613c7ad42
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.8/015-MIPS-avoid-possible-resource-conflict-in-register_pc.patch
@@ -0,0 +1,52 @@
+From 4da85831c8eaf2de2cadae6723e8231068c313b7 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg@openwrt.org>
+Date: Sat, 2 Feb 2013 13:18:54 +0000
+Subject: [PATCH] MIPS: avoid possible resource conflict in
+ register_pci_controller
+
+commit 222831787704c9ad9215f6b56f975b233968607c upstream.
+
+The IO and memory resources of a PCI controller
+might already have a parent resource set when
+they are passed to 'register_pci_controller'.
+
+If the parent resource is set, the request_resource
+call will fail due to resource conflict and the
+current code will not be able to register the
+PCI controller.
+
+Use the parent resource if it is available in the
+request_resource call to avoid the isssue.
+
+Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+Patchwork: http://patchwork.linux-mips.org/patch/4910/
+Signed-off-by: John Crispin <blogic@openwrt.org>
+---
+ arch/mips/pci/pci.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+--- a/arch/mips/pci/pci.c
++++ b/arch/mips/pci/pci.c
+@@ -175,9 +175,20 @@ static DEFINE_MUTEX(pci_scan_mutex);
+
+ void register_pci_controller(struct pci_controller *hose)
+ {
+- if (request_resource(&iomem_resource, hose->mem_resource) < 0)
++ struct resource *parent;
++
++ parent = hose->mem_resource->parent;
++ if (!parent)
++ parent = &iomem_resource;
++
++ if (request_resource(parent, hose->mem_resource) < 0)
+ goto out;
+- if (request_resource(&ioport_resource, hose->io_resource) < 0) {
++
++ parent = hose->io_resource->parent;
++ if (!parent)
++ parent = &ioport_resource;
++
++ if (request_resource(parent, hose->io_resource) < 0) {
+ release_resource(hose->mem_resource);
+ goto out;
+ }