[PATCH] x86/PCI: ignore Consumer/Producer bit and parse additional _CRS resources

Previous thread: no kernel events by kees schoenmakers on Tuesday, March 16, 2010 - 1:07 pm. (1 message)

Next thread: [PATCH] x86/PCI: pci=use_crs regression fix by Bjorn Helgaas on Tuesday, March 16, 2010 - 1:11 pm. (1 message)
From: Bjorn Helgaas
Date: Tuesday, March 16, 2010 - 1:11 pm

We previously used only resources marked "Producer," i.e., those the bridge
forwards downstream.  But BIOSes haven't used that bit consistently, so it's
useless.  For bridge devices, we have to assume *all* ACPI resources are
forwarded downstream.  Non-Producer bridge resources typically appear in
PCI config space and are not described in ACPI.

In addition to ACPI_RESOURCE_TYPE_ADDRESS{16,32,64}, parse these types:

    ACPI_RESOURCE_TYPE_IO
    ACPI_RESOURCE_TYPE_FIXED_IO
    ACPI_RESOURCE_TYPE_MEMORY24
    ACPI_RESOURCE_TYPE_MEMORY32
    ACPI_RESOURCE_TYPE_FIXED_MEMORY32
    ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64

This basically reimplements what drivers/pnp/pnpacpi/rsparser.c already
does, and I plan to take advantage of that, but we're not quite ready to
do it yet because it will require converting pci_root.c from an ACPI
driver to a PNP driver.

This is a possible fix for http://bugzilla.kernel.org/show_bug.cgi?id=15533
reported by Pete Zaitcev <zaitcev@redhat.com>.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---

 arch/x86/pci/acpi.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 71 insertions(+), 6 deletions(-)


diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index d255ce8..e0f45c2 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -65,14 +65,79 @@ resource_to_addr(struct acpi_resource *resource,
 			struct acpi_resource_address64 *addr)
 {
 	acpi_status status;
+	struct acpi_resource_io *io;
+	struct acpi_resource_fixed_io *fixed_io;
+	struct acpi_resource_memory24 *memory24;
+	struct acpi_resource_memory32 *memory32;
+	struct acpi_resource_fixed_memory32 *fixed_memory32;
+	struct acpi_resource_extended_address64 *ext_addr64;
+
+	memset(addr, 0, sizeof(*addr));
+
+	switch (resource->type) {
+	case ACPI_RESOURCE_TYPE_IO:
+		io = &resource->data.io;
+		addr->resource_type = ACPI_IO_RANGE;
+		addr->minimum = io->minimum;
+		addr->address_length = io->address_length;
+		return AE_OK;
+
+	case ...
From: Jesse Barnes
Date: Friday, March 19, 2010 - 1:38 pm

On Tue, 16 Mar 2010 14:11:34 -0600

Applied to my for-linus tree, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center
--

Previous thread: no kernel events by kees schoenmakers on Tuesday, March 16, 2010 - 1:07 pm. (1 message)

Next thread: [PATCH] x86/PCI: pci=use_crs regression fix by Bjorn Helgaas on Tuesday, March 16, 2010 - 1:11 pm. (1 message)