* Proposed patch for MIPS PCI autoscanning code...
@ 2003-03-24 16:00 Steven J. Hill
2003-03-24 18:08 ` Jun Sun
0 siblings, 1 reply; 3+ messages in thread
From: Steven J. Hill @ 2003-03-24 16:00 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 476 bytes --]
In the PCI autoscanning code for MIPS the assumption is made that the
generic 'pci_read_XXX' and 'pci_write_XXX' will suffice when initially
autoscanning the bus. These functions are defined in the main top-level
PCI code. For one of my platforms, this simply does not hold since the
platform specific PCI functions defined in the 'pci_ops' structure for
the 'mips_pci_channel' need to be used. I propose the following patch
to fix this. Comments before I apply this?
-Steve
[-- Attachment #2: pci_channel.h.diff --]
[-- Type: text/plain, Size: 603 bytes --]
--- pci_channel.h 2001-08-18 10:19:34.000000000 -0400
+++ pci_channel.h.new 2003-03-24 10:54:29.000000000 -0500
@@ -11,12 +11,13 @@
#include <linux/pci.h>
/*
- * Each pci channel is a top-level PCI bus seem by CPU. A machine with
+ * Each pci channel is a top-level PCI bus seen by CPU. A machine with
* multiple PCI channels may have multiple PCI host controllers or a
* single controller supporting multiple channels.
*/
struct pci_channel {
struct pci_ops *pci_ops;
+ struct pci_ops *early_pci_ops;
struct resource *io_resource;
struct resource *mem_resource;
int first_devfn;
[-- Attachment #3: pci_auto.c.diff --]
[-- Type: text/plain, Size: 711 bytes --]
--- pci_auto.c 2001-11-26 20:07:06.000000000 -0500
+++ pci_auto.c.new 2003-03-24 10:54:14.000000000 -0500
@@ -74,9 +74,14 @@
int early_##rw##_config_##size(struct pci_channel *hose, \
int top_bus, int bus, int devfn, int offset, type value) \
{ \
- return pci_##rw##_config_##size( \
- fake_pci_dev(hose, top_bus, bus, devfn), \
- offset, value); \
+ if (hose->early_pci_ops->rw##_##size != NULL) \
+ return hose->early_pci_ops->rw##_##size( \
+ fake_pci_dev(hose, top_bus, bus, devfn), \
+ offset, value); \
+ else \
+ return pci_##rw##_config_##size( \
+ fake_pci_dev(hose, top_bus, bus, devfn), \
+ offset, value); \
}
EARLY_PCI_OP(read, byte, u8 *)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Proposed patch for MIPS PCI autoscanning code...
2003-03-24 16:00 Proposed patch for MIPS PCI autoscanning code Steven J. Hill
@ 2003-03-24 18:08 ` Jun Sun
2003-03-24 19:39 ` Steven J. Hill
0 siblings, 1 reply; 3+ messages in thread
From: Jun Sun @ 2003-03-24 18:08 UTC (permalink / raw)
To: Steven J. Hill; +Cc: linux-mips, jsun
On Mon, Mar 24, 2003 at 11:00:52AM -0500, Steven J. Hill wrote:
> In the PCI autoscanning code for MIPS the assumption is made that the
> generic 'pci_read_XXX' and 'pci_write_XXX' will suffice when initially
> autoscanning the bus. These functions are defined in the main top-level
> PCI code. For one of my platforms, this simply does not hold since the
> platform specific PCI functions defined in the 'pci_ops' structure for
> the 'mips_pci_channel' need to be used. I propose the following patch
> to fix this. Comments before I apply this?
>
Can you illustrate more why the generic PCI functions won't work in your
case?
Also, if you do check in the patch, please also update all the boards
that uses pci_channel so that they will still compile.
Jun
> --- pci_channel.h 2001-08-18 10:19:34.000000000 -0400
> +++ pci_channel.h.new 2003-03-24 10:54:29.000000000 -0500
> @@ -11,12 +11,13 @@
> #include <linux/pci.h>
>
> /*
> - * Each pci channel is a top-level PCI bus seem by CPU. A machine with
> + * Each pci channel is a top-level PCI bus seen by CPU. A machine with
> * multiple PCI channels may have multiple PCI host controllers or a
> * single controller supporting multiple channels.
> */
> struct pci_channel {
> struct pci_ops *pci_ops;
> + struct pci_ops *early_pci_ops;
> struct resource *io_resource;
> struct resource *mem_resource;
> int first_devfn;
> --- pci_auto.c 2001-11-26 20:07:06.000000000 -0500
> +++ pci_auto.c.new 2003-03-24 10:54:14.000000000 -0500
> @@ -74,9 +74,14 @@
> int early_##rw##_config_##size(struct pci_channel *hose, \
> int top_bus, int bus, int devfn, int offset, type value) \
> { \
> - return pci_##rw##_config_##size( \
> - fake_pci_dev(hose, top_bus, bus, devfn), \
> - offset, value); \
> + if (hose->early_pci_ops->rw##_##size != NULL) \
> + return hose->early_pci_ops->rw##_##size( \
> + fake_pci_dev(hose, top_bus, bus, devfn), \
> + offset, value); \
> + else \
> + return pci_##rw##_config_##size( \
> + fake_pci_dev(hose, top_bus, bus, devfn), \
> + offset, value); \
> }
>
> EARLY_PCI_OP(read, byte, u8 *)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Proposed patch for MIPS PCI autoscanning code...
2003-03-24 18:08 ` Jun Sun
@ 2003-03-24 19:39 ` Steven J. Hill
0 siblings, 0 replies; 3+ messages in thread
From: Steven J. Hill @ 2003-03-24 19:39 UTC (permalink / raw)
To: Jun Sun; +Cc: linux-mips
Jun Sun wrote:
>
> Can you illustrate more why the generic PCI functions won't work in your
> case?
>
It turned out to be additional locking that was added in that I did not
know about and hence the patch should be discarded :). Oh well, it's a
Monday.
-Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-24 19:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-24 16:00 Proposed patch for MIPS PCI autoscanning code Steven J. Hill
2003-03-24 18:08 ` Jun Sun
2003-03-24 19:39 ` Steven J. Hill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox