From patchwork Thu Mar 25 15:28:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 88257 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2PFSpxD007276 for ; Thu, 25 Mar 2010 15:28:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960Ab0CYP2d (ORCPT ); Thu, 25 Mar 2010 11:28:33 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:25760 "EHLO g4t0014.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754914Ab0CYP2a (ORCPT ); Thu, 25 Mar 2010 11:28:30 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g4t0014.houston.hp.com (Postfix) with ESMTP id 6F13724406; Thu, 25 Mar 2010 15:28:30 +0000 (UTC) Received: from ldl (ldl.fc.hp.com [15.11.146.30]) by g4t0018.houston.hp.com (Postfix) with ESMTP id 4CCD110086; Thu, 25 Mar 2010 15:28:30 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 379AECF003D; Thu, 25 Mar 2010 09:28:30 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8SDPC6Bd099; Thu, 25 Mar 2010 09:28:30 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id 20AD7CF000D; Thu, 25 Mar 2010 09:28:30 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id 0BA40261B9; Thu, 25 Mar 2010 09:28:30 -0600 (MDT) Subject: [PATCH 2/2] x86/PCI: truncate _CRS windows with _LEN > _MAX - _MIN + 1 To: Jesse Barnes From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Yanko Kaneti , Linus Torvalds , Thomas Renninger , maciej.rutecki@gmail.com Date: Thu, 25 Mar 2010 09:28:30 -0600 Message-ID: <20100325152829.10117.91511.stgit@bob.kio> In-Reply-To: <20100325152750.10117.81615.stgit@bob.kio> References: <20100325152750.10117.81615.stgit@bob.kio> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Mar 2010 15:28:54 +0000 (UTC) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 75ac3f8..e311602 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -123,7 +123,7 @@ setup_resource(struct acpi_resource *acpi_res, void *data) acpi_status status; unsigned long flags; struct resource *root, *conflict; - u64 start, end; + u64 start, end, max_len; status = resource_to_addr(acpi_res, &addr); if (!ACPI_SUCCESS(status)) @@ -140,6 +140,17 @@ setup_resource(struct acpi_resource *acpi_res, void *data) } else return AE_OK; + max_len = addr.maximum - addr.minimum + 1; + if (addr.address_length > max_len) { + dev_printk(KERN_DEBUG, &info->bridge->dev, + "host bridge window length %#llx doesn't fit in " + "%#llx-%#llx, trimming\n", + (unsigned long long) addr.address_length, + (unsigned long long) addr.minimum, + (unsigned long long) addr.maximum); + addr.address_length = max_len; + } + start = addr.minimum + addr.translation_offset; end = start + addr.address_length - 1;