mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: kovedi@gmail.com
Cc: linux-kernel@vger.kernel.org, stable-bounces@kernel.org,
	davem@sunset.davemloft.net
Subject: Re: [Sparc64 BUG] hangup under booting 2.6.22.X whith Sparc64
Date: Tue, 11 Sep 2007 08:38:23 -0700 (PDT)	[thread overview]
Message-ID: <20070911.083823.15264559.davem@davemloft.net> (raw)
In-Reply-To: <406fe6c90709102233m2472e6c4h7d329a3f64692645@mail.gmail.com>


I think this patch should fix the problem.

Please give it a try, thanks.

diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 139b4cf..e8dac81 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -744,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
 {
 	struct device_node *child;
 	const u32 *reg;
-	int reglen, devfn;
+	int reglen, devfn, prev_devfn;
 	struct pci_dev *dev;
 
 	if (ofpci_verbose)
@@ -752,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
 		       node->full_name, bus->number);
 
 	child = NULL;
+	prev_devfn = -1;
 	while ((child = of_get_next_child(node, child)) != NULL) {
 		if (ofpci_verbose)
 			printk("  * %s\n", child->full_name);
 		reg = of_get_property(child, "reg", &reglen);
 		if (reg == NULL || reglen < 20)
 			continue;
+
 		devfn = (reg[0] >> 8) & 0xff;
 
+		/* This is a workaround for some device trees
+		 * which list PCI devices twice.  On the V100
+		 * for example, device number 3 is listed twice.
+		 * Once as "pm" and once again as "lomp".
+		 */
+		if (devfn == prev_devfn)
+			continue;
+		prev_devfn = devfn;
+
 		/* create a new pci_dev for this device */
 		dev = of_create_pci_dev(pbm, child, bus, devfn, 0);
 		if (!dev)

  parent reply	other threads:[~2007-09-11 15:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10 11:42 Kövedi Krisztián
2007-09-10 12:36 ` David Miller
2007-09-11  5:33   ` Kövedi Krisztián
2007-09-11 11:13     ` David Miller
2007-09-11 15:38     ` David Miller [this message]
2007-09-12  7:47       ` Kövedi Krisztián
2007-09-12  8:11         ` David Miller
2007-09-13 12:59           ` Oliver Pinter
2007-09-13 14:42             ` Greg KH
2007-09-13 21:54               ` David Miller

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=20070911.083823.15264559.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=davem@sunset.davemloft.net \
    --cc=kovedi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-bounces@kernel.org \
    /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

Powered by JetHome