From patchwork Fri Aug 7 18:15:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 39986 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 n77IJ8IH019937 for ; Fri, 7 Aug 2009 18:19:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754929AbZHGSTF (ORCPT ); Fri, 7 Aug 2009 14:19:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932174AbZHGSTF (ORCPT ); Fri, 7 Aug 2009 14:19:05 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:59200 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754929AbZHGSTE (ORCPT ); Fri, 7 Aug 2009 14:19:04 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n77IFqYb013651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Aug 2009 11:15:53 -0700 Received: from localhost (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n77IFoUv026388; Fri, 7 Aug 2009 11:15:51 -0700 Date: Fri, 7 Aug 2009 11:15:50 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Manuel Lauss cc: "Rafael J. Wysocki" , Matthew Wilcox , LKML , Linux PCI , Andrew Morton , Andrew Patterson Subject: Re: [Regression] PCI resources allocation problem on HP nx6325 In-Reply-To: <20090805170934.GA32274@roarinelk.homelinux.net> Message-ID: References: <200908021619.48285.rjw@sisk.pl> <20090803165909.GA12824@roarinelk.homelinux.net> <20090805155102.GA31646@roarinelk.homelinux.net> <20090805170934.GA32274@roarinelk.homelinux.net> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 X-Spam-Status: No, hits=-3.965 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, 5 Aug 2009, Manuel Lauss wrote: > > On Wed, Aug 05, 2009 at 09:38:52AM -0700, Linus Torvalds wrote: > > > > Manuel, could you compile your kernel with CONFIG_PCI_DEBUG enabled, and > > then boot it with "pci=earlydump", and send me the dmesg of a kernel boot? > > Linux version 2.6.31-rc5-00246-g90bc1a6 (mano@scarran) (gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.1) ) #1 Wed Aug 5 18:57:04 CEST 2009 Thanks, sorry for the delay. > pci 0000:00:1e.0 config space: > 00: 86 80 48 24 07 01 80 80 83 00 04 06 00 00 01 00 > 10: 00 00 00 00 00 00 00 00 00 02 02 40 d0 d0 80 22 > 20: 60 ff 60 ff a0 de a0 de 00 00 00 00 00 00 00 00 Ok, this is your PCI-PCI bridge to Bus#2, and it has two memory windows: pci 0000:00:1e.0: transparent bridge pci 0000:00:1e.0: bridge io port: [0xd000-0xdfff] pci 0000:00:1e.0: bridge 32bit mmio: [0xff600000-0xff6fffff] pci 0000:00:1e.0: bridge 32bit mmio pref: [0xdea00000-0xdeafffff] so I was wrong - that 0xff600000-0xff6fffff is non-prefetchable. So I'm really not seeing why you then et that pci 0000:02:03.0: BAR 6: address space collision on of device [0xff680000-0xff69ffff] because while we've marked the ROM window prefetchable, it should fit perfectly fine into a non-prefetchable PCI bus window. Odd. Mind trying this patch? It hacks up %pR to print out more of the resource information, and also makes your failure case print out the root resource we're trying to insert into. Linus --- drivers/pci/setup-res.c | 19 ++++++++++--------- lib/vsprintf.c | 4 +++- 2 files changed, 13 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1898c7b..ab9ad65 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -98,23 +98,24 @@ void pci_update_resource(struct pci_dev *dev, int resno) int pci_claim_resource(struct pci_dev *dev, int resource) { + const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; struct resource *res = &dev->resource[resource]; struct resource *root; int err; root = pci_find_parent_resource(dev, res); - err = -EINVAL; - if (root != NULL) - err = request_resource(root, res); + if (!root) { + dev_err(&dev->dev, "BAR %d: no parent resource for %s resource %pR\n", + resource, dtype, res); + return -EINVAL; + } + + err = request_resource(root, res); if (err) { - const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; - dev_err(&dev->dev, "BAR %d: %s of %s %pR\n", - resource, - root ? "address space collision on" : - "no parent found for", - dtype, res); + dev_err(&dev->dev, "BAR %d: unable to insert %s resource %pR in %pR\n", + resource, dtype, res, root); } return err; diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 756ccaf..aadf760 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -609,7 +609,7 @@ static char *resource_string(char *buf, char *end, struct resource *res, .flags = SPECIAL | SMALL | ZEROPAD, }; /* room for the actual numbers, the two "0x", -, [, ] and the final zero */ - char sym[4*sizeof(resource_size_t) + 8]; + char sym[4*sizeof(resource_size_t) + 8 + 9]; char *p = sym, *pend = sym + sizeof(sym); int size = -1; @@ -623,6 +623,8 @@ static char *resource_string(char *buf, char *end, struct resource *res, p = number(p, pend, res->start, num_spec); *p++ = '-'; p = number(p, pend, res->end, num_spec); + *p++ = ':'; + p = number(p, pend, res->flags, num_spec); *p++ = ']'; *p = 0;