public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: "Martin J. Bligh" <mbligh@aracnet.com>,
	Matthew Dobson <colpatch@us.ibm.com>,
	linux-kernel@vger.kernel.org, hohnbaum@us.ibm.com
Cc: gregkh@kroah.com, mochel@osdl.org
Subject: Re: [0/4] NUMA-Q: remove PCI bus number mangling
Date: Tue, 12 Nov 2002 15:58:24 -0800	[thread overview]
Message-ID: <20021112235824.GG22031@holomorphy.com> (raw)
In-Reply-To: <20021112225937.GA23425@holomorphy.com>

On Tue, Nov 12, 2002 at 03:53:49PM -0800, Martin J. Bligh wrote:
>> Right, I'm not against the sysdata thing, seems like a much better way
>> to do it in general (what I did was a quick hack). Was just confused
>> by the global bus number assertion, but if we use the sysdata stuff,
>> it's all a non-issue ;-)
> 
On Tue, Nov 12, 2002 at 02:59:37PM -0800, William Lee Irwin III wrote:
> Non-issue for merging...
> The pain isn't over yet. =(
> Core PCI code is assuming unique bus numbers in several places.

Okay, an attempt to remedy this world-breaking braindamage with the
fewest lines of code:

This alters PCI bus number "clash" detection to compare ->sysdata in
addition to the numbers. The bus number is not a unique identifier.

 drivers/pci/probe.c |   14 ++++++++++++--
 include/linux/pci.h |    2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)


diff -urpN pci-2.5.47-8/drivers/pci/probe.c pci-2.5.47-8-dbg/drivers/pci/probe.c
--- pci-2.5.47-8/drivers/pci/probe.c	2002-11-12 13:37:56.000000000 -0800
+++ pci-2.5.47-8-dbg/drivers/pci/probe.c	2002-11-12 14:27:54.000000000 -0800
@@ -548,11 +548,21 @@ int __devinit pci_bus_exists(const struc
 	return 0;
 }
 
-struct pci_bus * __devinit pci_alloc_primary_bus(int bus)
+static int __devinit pci_root_bus_exists(int number, void *sysdata)
+{
+	const struct pci_bus *bus;
+
+	list_for_each_entry(bus, &pci_root_buses, node)
+		if (bus->number == number && bus->sysdata == sysdata)
+			return 1;
+	return 0;
+}
+
+struct pci_bus * __devinit pci_alloc_primary_bus(int bus, void *sysdata)
 {
 	struct pci_bus *b;
 
-	if (pci_bus_exists(&pci_root_buses, bus)) {
+	if (pci_root_bus_exists(bus, sysdata)) {
 		/* If we already got to this bus through a different bridge, ignore it */
 		DBG("PCI: Bus %02x already known\n", bus);
 		return NULL;
diff -urpN pci-2.5.47-8/include/linux/pci.h pci-2.5.47-8-dbg/include/linux/pci.h
--- pci-2.5.47-8/include/linux/pci.h	2002-11-10 19:28:13.000000000 -0800
+++ pci-2.5.47-8-dbg/include/linux/pci.h	2002-11-12 14:29:13.000000000 -0800
@@ -537,7 +537,7 @@ int pcibios_write_config_dword (unsigned
 
 int pci_bus_exists(const struct list_head *list, int nr);
 struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
-struct pci_bus *pci_alloc_primary_bus(int bus);
+struct pci_bus *pci_alloc_primary_bus(int bus, void *sysdata);
 struct pci_dev *pci_scan_slot(struct pci_dev *temp);
 int pci_proc_attach_device(struct pci_dev *dev);
 int pci_proc_detach_device(struct pci_dev *dev);

  parent reply	other threads:[~2002-11-12 23:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-12 12:37 [0/4] NUMA-Q: remove PCI bus number mangling William Lee Irwin III
2002-11-12 20:52 ` William Lee Irwin III
2002-11-12 20:55   ` William Lee Irwin III
2002-11-12 21:29   ` Matthew Dobson
2002-11-12 21:35     ` William Lee Irwin III
2002-11-12 21:39       ` William Lee Irwin III
2002-11-12 22:46         ` Martin J. Bligh
2002-11-12 21:53           ` William Lee Irwin III
2002-11-12 23:53             ` Martin J. Bligh
2002-11-12 22:59               ` William Lee Irwin III
2002-11-12 23:19                 ` William Lee Irwin III
2002-11-12 23:58                 ` William Lee Irwin III [this message]
2002-11-13  0:04                   ` Greg KH
2002-11-13  0:12                     ` William Lee Irwin III
2002-11-13  0:20                       ` Greg KH
2002-11-13  0:28                         ` William Lee Irwin III
2002-11-13  1:01                           ` William Lee Irwin III
2002-11-13 12:07                           ` Ivan Kokshaysky
2002-11-13 20:59                             ` William Lee Irwin III
2002-11-13 10:10                         ` William Lee Irwin III
2002-11-13 11:20                           ` William Lee Irwin III
2003-01-01  9:28                             ` William Lee Irwin III
2002-11-12 21:48       ` William Lee Irwin III
2002-11-12 21:48       ` William Lee Irwin III
2002-11-12 20:53 ` William Lee Irwin III

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=20021112235824.GG22031@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=colpatch@us.ibm.com \
    --cc=gregkh@kroah.com \
    --cc=hohnbaum@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=mochel@osdl.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