public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>,
	"Grover, Andrew" <andrew.grover@intel.com>,
	Linus Torvalds <torvalds@transmeta.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	"Martin J. Bligh" <Martin.Bligh@us.ibm.com>,
	linux-kernel@vger.kernel.org,
	Michael Hohnbaum <hohnbaum@us.ibm.com>,
	jgarzik@mandrakesoft.com, "Diefenbaugh,
	Paul S" <paul.s.diefenbaugh@intel.com>,
	hannal@us.ibm.com
Subject: Re: [patch] PCI Cleanup
Date: Mon, 19 Aug 2002 16:41:33 -0700	[thread overview]
Message-ID: <3D61822D.3060409@us.ibm.com> (raw)
In-Reply-To: 20020816223451.GA6323@kroah.com

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

Greg,
	Here is the numaq portion of the cleanup.  This is the part that I was 
originally intending to fix when this whole thing started.  This patch makes 
the PCI busses on the secondary quads for NUMA-Q working.

Please add this to the pile of PCI cleanups.

Thanks!

-Matt

Greg KH wrote:
> On Thu, Aug 15, 2002 at 09:36:45AM -0700, Greg KH wrote:
> 
>>If there are no complaints, I think I'll go implement this, and move the
>>functions into the main pci code so that other parts of the kernel (like
>>ACPI) can use them.
> 
> 
> Ok, here's the patch that goes on top of Matt's previous patch, moving
> the pci_ops functions to be pci_bus based instead of pci_dev, like they
> are today.  This enables us to get rid of all of the pci_*_nodev
> functions in the pci hotplug core (that's 245 lines removed :)  It's
> currently running on the machine I'm typing this from.
> 
> I used the devfn as a paramater instead of the function and slot, as
> some archs just take the devfn and move it around before using it.  If
> there were two paramaters, we would be splitting the values apart, and
> then putting them back together for every function.
> 
> This is only for i386, if there's no complaints I'll knock out the other
> archs before submitting it.
> 
> thanks,
> 
> greg k-h

[-- Attachment #2: numaq_pci_fix-2531.patch --]
[-- Type: text/plain, Size: 2569 bytes --]

diff -Nur linux-2.5.31-patched/arch/i386/pci/numa.c linux-2.5.31-numaq/arch/i386/pci/numa.c
--- linux-2.5.31-patched/arch/i386/pci/numa.c	Wed Aug 14 11:07:13 2002
+++ linux-2.5.31-numaq/arch/i386/pci/numa.c	Wed Aug 14 11:11:58 2002
@@ -1,19 +1,19 @@
 /*
  * numa.c - Low-level PCI access for NUMA-Q machines
  */
+
 #include <linux/pci.h>
 #include <linux/init.h>
-
 #include "pci.h"
 
 #define BUS2QUAD(global) (mp_bus_id_to_node[global])
 #define BUS2LOCAL(global) (mp_bus_id_to_local[global])
 #define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
 
-#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
+#define PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg) \
 	(0x80000000 | (BUS2LOCAL(bus) << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
 
-static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf1_mq_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
 {
 	unsigned long flags;
 
@@ -22,7 +22,7 @@
 
 	spin_lock_irqsave(&pci_config_lock, flags);
 
-	outl_quad(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+	outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
 
 	switch (len) {
 	case 1:
@@ -41,7 +41,7 @@
 	return 0;
 }
 
-static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf1_mq_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
 {
 	unsigned long flags;
 
@@ -50,7 +50,7 @@
 
 	spin_lock_irqsave(&pci_config_lock, flags);
 
-	outl_quad(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+	outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
 
 	switch (len) {
 	case 1:
@@ -69,6 +69,25 @@
 	return 0;
 }
 
+#undef PCI_CONF1_MQ_ADDRESS
+
+static int pci_conf1_mq_read(struct pci_dev *dev, int where, int size, u32 *value)
+{
+	return __pci_conf1_mq_read(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, size, value);
+}
+
+static int pci_conf1_mq_write(struct pci_dev *dev, int where, int size, u32 value)
+{
+	return __pci_conf1_mq_write(0, dev->bus->number, PCI_SLOT(dev->devfn), 
+		PCI_FUNC(dev->devfn), where, size, value);
+}
+
+static struct pci_ops pci_direct_conf1_mq = {
+	read:	pci_conf1_mq_read,
+	write:	pci_conf1_mq_write
+};
+
 
 static void __devinit pci_fixup_i450nx(struct pci_dev *d)
 {
@@ -102,8 +121,7 @@
 {
 	int quad;
 
-	pci_config_read = pci_conf1_read;
-	pci_config_write = pci_conf1_write;
+	pci_root_ops = &pci_direct_conf1_mq;
 
 	if (pcibios_scanned++)
 		return 0;

  reply	other threads:[~2002-08-19 23:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15  2:24 [patch] PCI Cleanup Grover, Andrew
2002-08-15  7:38 ` [PATCH] Fixup pci_alloc_consistent with 64bit DMA masks on i386 Steffen Persvold
2002-08-15  7:49 ` [patch] PCI Cleanup Martin Mares
2002-08-15 15:58 ` Kai Germaschewski
2002-08-15 16:36   ` Greg KH
2002-08-16 22:34     ` Greg KH
2002-08-19 23:41       ` Matthew Dobson [this message]
2002-08-15 18:28 ` Patrick Mochel
  -- strict thread matches above, loose matches on Subject: below --
2002-08-15 20:23 Grover, Andrew
2002-08-15 20:54 ` Patrick Mochel
2002-08-13  0:08 Matthew Dobson
2002-08-13 11:45 ` Alan Cox
2002-08-13 14:17   ` Martin J. Bligh
2002-08-13 14:57     ` Alan Cox
2002-08-13 15:15       ` Martin J. Bligh
2002-08-13 17:00       ` Matthew Dobson
2002-08-13 17:23         ` Linus Torvalds
2002-08-13 19:57           ` Martin J. Bligh
2002-08-13 20:13             ` Alan Cox
2002-08-13 20:26               ` Linus Torvalds
2002-08-13 22:29                 ` Matthew Dobson
2002-08-13 22:46                   ` Linus Torvalds
2002-08-14  0:57                     ` Matthew Dobson
2002-08-15  0:23                     ` Matthew Dobson
2002-08-14  7:08               ` Martin Mares
2002-08-13 14:55   ` Martin J. Bligh
2002-08-13 15:07     ` Alan Cox

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=3D61822D.3060409@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=Martin.Bligh@us.ibm.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrew.grover@intel.com \
    --cc=greg@kroah.com \
    --cc=hannal@us.ibm.com \
    --cc=hohnbaum@us.ibm.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=kai@tp1.ruhr-uni-bochum.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.s.diefenbaugh@intel.com \
    --cc=torvalds@transmeta.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