From patchwork Wed Nov 4 17:45:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 57742 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 nA4HlOfH015848 for ; Wed, 4 Nov 2009 17:47:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbZKDRpk (ORCPT ); Wed, 4 Nov 2009 12:45:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752779AbZKDRpk (ORCPT ); Wed, 4 Nov 2009 12:45:40 -0500 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:18828 "EHLO g6t0187.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbZKDRpj (ORCPT ); Wed, 4 Nov 2009 12:45:39 -0500 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g6t0187.atlanta.hp.com (Postfix) with ESMTP id D27CD2836F; Wed, 4 Nov 2009 17:45:43 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0018.houston.hp.com (Postfix) with ESMTP id 7351C10245; Wed, 4 Nov 2009 17:45:43 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 5D13ECF000B; Wed, 4 Nov 2009 10:45:43 -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 EbzVuOBqeLg2; Wed, 4 Nov 2009 10:45:43 -0700 (MST) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 47D93CF0007; Wed, 4 Nov 2009 10:45:43 -0700 (MST) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 28FC926142; Wed, 4 Nov 2009 10:45:43 -0700 (MST) Subject: [PATCH] ACPI: pci_root: show entire downstream bus range To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Date: Wed, 04 Nov 2009 10:45:43 -0700 Message-ID: <20091104174543.17835.86910.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 1af8081..aa9eeee 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(acpi_is_root_bridge); static acpi_status get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) { - int *busnr = data; + struct resource *res = data; struct acpi_resource_address64 address; if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && @@ -162,28 +162,27 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) acpi_resource_to_address64(resource, &address); if ((address.address_length > 0) && - (address.resource_type == ACPI_BUS_NUMBER_RANGE)) - *busnr = address.minimum; + (address.resource_type == ACPI_BUS_NUMBER_RANGE)) { + res->start = address.minimum; + res->end = address.minimum + address.address_length - 1; + } return AE_OK; } static acpi_status try_get_root_bridge_busnr(acpi_handle handle, - unsigned long long *bus) + struct resource *res) { acpi_status status; - int busnum; - busnum = -1; + res->start = -1; status = acpi_walk_resources(handle, METHOD_NAME__CRS, - get_root_bridge_busnr_callback, &busnum); + get_root_bridge_busnr_callback, res); if (ACPI_FAILURE(status)) return status; - /* Check if we really get a bus number from _CRS */ - if (busnum == -1) + if (res->start == -1) return AE_ERROR; - *bus = busnum; return AE_OK; } @@ -474,6 +473,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) acpi_handle handle; struct acpi_device *child; u32 flags, base_flags; + struct resource secondary; segment = 0; status = acpi_evaluate_integer(device->handle, METHOD_NAME__SEG, NULL, @@ -484,9 +484,11 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) } /* Check _CRS first, then _BBN. If no _BBN, default to zero. */ - bus = 0; - status = try_get_root_bridge_busnr(device->handle, &bus); - if (ACPI_FAILURE(status)) { + secondary.start = 0; + status = try_get_root_bridge_busnr(device->handle, &secondary); + if (ACPI_SUCCESS(status)) { + bus = secondary.start; + } else { status = acpi_evaluate_integer(device->handle, METHOD_NAME__BBN, NULL, &bus); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { printk(KERN_ERR PREFIX @@ -521,9 +523,10 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) /* TBD: Locking */ list_add_tail(&root->node, &acpi_pci_roots); - printk(KERN_INFO PREFIX "%s [%s] (%04x:%02x)\n", + printk(KERN_INFO PREFIX "%s [%s] (domain %04x [bus %02x-%02x])\n", acpi_device_name(device), acpi_device_bid(device), - root->segment, root->bus_nr); + root->segment, + (unsigned int) secondary.start, (unsigned int) secondary.end); /* * Scan the Root Bridge