linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Manuel Lauss <mano@roarinelk.homelinux.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Matthew Wilcox <willy@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrew Patterson <andrew.patterson@hp.com>
Subject: Re: [Regression] PCI resources allocation problem on HP nx6325
Date: Fri, 7 Aug 2009 11:15:50 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908071051300.3390@localhost.localdomain> (raw)
In-Reply-To: <20090805170934.GA32274@roarinelk.homelinux.net>



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(-)

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;
 

  reply	other threads:[~2009-08-07 18:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02 14:19 [Regression] PCI resources allocation problem on HP nx6325 Rafael J. Wysocki
2009-08-02 16:39 ` Linus Torvalds
2009-08-02 17:15   ` Matthew Wilcox
2009-08-02 17:19     ` Linus Torvalds
2009-08-02 17:25       ` Matthew Wilcox
2009-08-02 20:16   ` Rafael J. Wysocki
2009-08-02 21:14     ` Linus Torvalds
2009-08-03  3:10   ` Andrew Patterson
2009-08-03 21:14     ` Andrew Patterson
2009-08-03 16:59   ` Manuel Lauss
2009-08-04 23:04     ` Linus Torvalds
2009-08-05 15:51       ` Manuel Lauss
2009-08-05 16:25         ` Linus Torvalds
2009-08-05 16:38           ` Linus Torvalds
2009-08-05 17:09             ` Manuel Lauss
2009-08-07 18:15               ` Linus Torvalds [this message]
2009-08-07 18:40                 ` Linus Torvalds
2009-08-11 16:47                   ` Manuel Lauss
2009-08-13 18:16                     ` Linus Torvalds
2009-08-13 19:28                       ` Frans Pop
2009-08-13 19:46                         ` Linus Torvalds
2009-08-13 20:35                           ` Frans Pop
2009-08-14  1:40                         ` PCI resources allocation problem on Toshiba Satellite A40 Frans Pop
2009-08-14  1:47                           ` Linus Torvalds
2009-08-14 16:50                             ` Frans Pop
2009-08-14 17:04                               ` Linus Torvalds
2009-08-14 17:35                                 ` Frans Pop
2009-08-02 16:59 ` [Regression] PCI resources allocation problem on HP nx6325 Matthew Wilcox
2009-08-02 20:18   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0908071051300.3390@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.patterson@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mano@roarinelk.homelinux.net \
    --cc=rjw@sisk.pl \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).