From patchwork Tue Jan 17 22:19:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 136599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id A31B31007D5 for ; Wed, 18 Jan 2012 22:42:38 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RnTuQ-0002Be-WC; Wed, 18 Jan 2012 11:42:31 +0000 Received: from complete.lackof.org ([198.49.126.79]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1RnHNh-0004Tc-5S for kernel-team@lists.ubuntu.com; Tue, 17 Jan 2012 22:19:53 +0000 Received: from localhost (localhost [127.0.0.1]) by complete.lackof.org (Postfix) with ESMTP id B662333E0268 for ; Tue, 17 Jan 2012 15:19:52 -0700 (MST) X-Virus-Scanned: Debian amavisd-new at lackof.org Received: from complete.lackof.org ([127.0.0.1]) by localhost (complete.lackof.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27ILLD9RXKqr for ; Tue, 17 Jan 2012 15:19:52 -0700 (MST) Received: from fluid.dannf (localhost [127.0.0.1]) by complete.lackof.org (Postfix) with ESMTP id 1ED0B33E025F for ; Tue, 17 Jan 2012 15:19:52 -0700 (MST) Received: by fluid.dannf (Postfix, from userid 1000) id 0BC90B504F; Tue, 17 Jan 2012 15:19:52 -0700 (MST) Date: Tue, 17 Jan 2012 15:19:52 -0700 From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [maverick] [PATCH 2/2] PNP: work around Dell 1536/1546 BIOS MMCONFIG bug that breaks USB Message-ID: <20120117221952.GG1976@dannf.org> References: <20120117221603.GC1976@dannf.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120117221603.GC1976@dannf.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Wed, 18 Jan 2012 11:42:28 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Some Dell BIOSes have MCFG tables that don't report the entire MMCONFIG area claimed by the chipset. If we move PCI devices into that claimed-but-unreported area, they don't work. This quirk reads the AMD MMCONFIG MSRs and adds PNP0C01 resources as needed to cover the entire area. Example problem scenario: BIOS-e820: 00000000cfec5400 - 00000000d4000000 (reserved) Fam 10h mmconf [d0000000, dfffffff] PCI: MMCONFIG for domain 0000 [bus 00-3f] at [mem 0xd0000000-0xd3ffffff] (base 0xd0000000) pnp 00:0c: [mem 0xd0000000-0xd3ffffff] pci 0000:00:12.0: reg 10: [mem 0xffb00000-0xffb00fff] pci 0000:00:12.0: no compatible bridge window for [mem 0xffb00000-0xffb00fff] pci 0000:00:12.0: BAR 0: assigned [mem 0xd4000000-0xd40000ff] Reported-by: Lisa Salimbas Reported-by: Tested-by: dann frazier References: https://bugzilla.kernel.org/show_bug.cgi?id=31602 References: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/647043 References: https://bugzilla.redhat.com/show_bug.cgi?id=770308 Cc: stable@kernel.org # 2.6.34+ Signed-off-by: Bjorn Helgaas Signed-off-by: Jesse Barnes (backported from commit eb31aae8cb5eb54e234ed2d857ddac868195d911) BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/647043 Signed-off-by: dann frazier --- drivers/pnp/quirks.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index dfbd5a6..e496831 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -295,6 +295,45 @@ static void quirk_system_pci_resources(struct pnp_dev *dev) } } +#ifdef CONFIG_K8_NB + +#include + +static void quirk_k8_mmconfig_area(struct pnp_dev *dev) +{ + resource_size_t start, end; + struct pnp_resource *pnp_res; + struct resource *res; + struct resource mmconfig_res, *mmconfig; + + mmconfig = k8_get_mmconfig_range(&mmconfig_res); + if (!mmconfig) + return; + + list_for_each_entry(pnp_res, &dev->resources, list) { + res = &pnp_res->res; + if (res->end < mmconfig->start || res->start > mmconfig->end || + (res->start == mmconfig->start && res->end == mmconfig->end)) + continue; + + dev_info(&dev->dev, FW_BUG + "%pR covers only part of AMD MMCONFIG area %pR; adding more reservations\n", + res, mmconfig); + if (mmconfig->start < res->start) { + start = mmconfig->start; + end = res->start - 1; + pnp_add_mem_resource(dev, start, end, 0); + } + if (mmconfig->end > res->end) { + start = res->end + 1; + end = mmconfig->end; + pnp_add_mem_resource(dev, start, end, 0); + } + break; + } +} +#endif + /* * PnP Quirks * Cards or devices that need some tweaking due to incomplete resource info @@ -322,6 +361,9 @@ static struct pnp_fixup pnp_fixups[] = { /* PnP resources that might overlap PCI BARs */ {"PNP0c01", quirk_system_pci_resources}, {"PNP0c02", quirk_system_pci_resources}, +#ifdef CONFIG_K8_NB + {"PNP0c01", quirk_k8_mmconfig_area}, +#endif {""} };