[PATCH -v3 3/3] pci: don't allocate from a BUSY bus resource

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai
Date: Tuesday, April 13, 2010 - 2:24 pm

Drivers typically use pci_request_regions() to reserve the resources
  they use, but that fails if the resource is already busy.  Therefore,
  we should ignore busy resources when we're assigning resources to a
  device.

[commit log is from Bjorn]

Tested-by: Andy Isaacson <adi@hexapodia.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/pci/bus.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6/drivers/pci/bus.c
===================================================================
--- linux-2.6.orig/drivers/pci/bus.c
+++ linux-2.6/drivers/pci/bus.c
@@ -103,6 +103,10 @@ pci_bus_alloc_resource(struct pci_bus *b
 		if (!r)
 			continue;
 
+		/* Driver can not reserve it later, so don't use it */
+		if (r->flags & IORESOURCE_BUSY)
+			continue;
+
 		/* type_mask must match */
 		if ((res->flags ^ r->flags) & type_mask)
 			continue;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] x86: Reserve legacy VGA MMIO area for x86_64 a ..., yinghai.lu@oracle.com, (Mon Apr 12, 12:55 pm)
[PATCH -v3 3/3] pci: don't allocate from a BUSY bus resource, Yinghai, (Tue Apr 13, 2:24 pm)
[PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, Yinghai, (Tue Apr 20, 10:35 pm)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, Bjorn Helgaas, (Wed Apr 21, 8:21 am)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, Yinghai Lu, (Wed Apr 21, 9:45 am)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, Bjorn Helgaas, (Wed Apr 21, 9:59 am)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, H. Peter Anvin, (Wed Apr 21, 3:33 pm)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, Bjorn Helgaas, (Wed Apr 21, 4:04 pm)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, H. Peter Anvin, (Wed Apr 21, 4:10 pm)
Re: [PATCH 3/3] x86,pci,acpi: Handle invalid _CRS, H. Peter Anvin, (Wed Apr 21, 5:02 pm)
[PATCH -v5] reserve a0000 - 0x10000, Yinghai, (Mon Apr 26, 3:04 pm)
[PATCH -v5 2/3] x86: Remove probe_roms for 32bit, Yinghai, (Mon Apr 26, 3:04 pm)