From patchwork Tue Nov 10 17:11:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 59102 X-Patchwork-Delegate: lenb@kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAAHBlXu026372 for ; Tue, 10 Nov 2009 17:11:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757181AbZKJRLe (ORCPT ); Tue, 10 Nov 2009 12:11:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757285AbZKJRLe (ORCPT ); Tue, 10 Nov 2009 12:11:34 -0500 Received: from g1t0028.austin.hp.com ([15.216.28.35]:47966 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757284AbZKJRLd (ORCPT ); Tue, 10 Nov 2009 12:11:33 -0500 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g1t0028.austin.hp.com (Postfix) with ESMTP id E019E1C398; Tue, 10 Nov 2009 17:11:38 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0018.houston.hp.com (Postfix) with ESMTP id C2AA71003D; Tue, 10 Nov 2009 17:11:38 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id A95F4CF000C; Tue, 10 Nov 2009 10:11:38 -0700 (MST) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sxlKhYCc01pn; Tue, 10 Nov 2009 10:11:38 -0700 (MST) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 942A4CF0007; Tue, 10 Nov 2009 10:11:38 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 7186726160; Tue, 10 Nov 2009 10:11:38 -0700 (MST) Subject: [PATCH v2 2/3] ACPI: pci_root: save downstream bus range To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org Date: Tue, 10 Nov 2009 10:11:38 -0700 Message-ID: <20091110171138.10645.99610.stgit@bob.kio> In-Reply-To: <20091110170802.10645.91272.stgit@bob.kio> References: <20091110170802.10645.91272.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index aa9eeee..a3e6f0e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -485,16 +485,22 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) /* Check _CRS first, then _BBN. If no _BBN, default to zero. */ secondary.start = 0; + secondary.end = 0xFF; status = try_get_root_bridge_busnr(device->handle, &secondary); - if (ACPI_SUCCESS(status)) { - bus = secondary.start; - } else { + if (ACPI_FAILURE(status)) { + /* + * We need both the start and end of the downstream bus range + * to interpret _CBA (MMCONFIG base address), so it really is + * supposed to be in _CRS. + */ + printk(KERN_WARNING FW_BUG PREFIX + "no secondary bus range in _CRS\n"); status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, &bus); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { - printk(KERN_ERR PREFIX - "no bus number in _CRS and can't evaluate _BBN\n"); + printk(KERN_ERR PREFIX "can't evaluate _BBN\n"); return -ENODEV; } + secondary.start = bus; } root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); @@ -504,7 +510,8 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) INIT_LIST_HEAD(&root->node); root->device = device; root->segment = segment & 0xFFFF; - root->bus_nr = bus & 0xFF; + root->bus_nr = secondary.start & 0xFF; + root->subordinate_bus_nr = secondary.end & 0xFF; strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); device->driver_data = root; diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 3cd9ccd..3d6e6e8 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -371,6 +371,7 @@ struct acpi_pci_root { struct pci_bus *bus; u16 segment; u8 bus_nr; + u8 subordinate_bus_nr; u32 osc_support_set; /* _OSC state of support bits */ u32 osc_control_set; /* _OSC state of control bits */