]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
PCI: Use pci_generic_prep_mwi on sparc64
authorMatthew Wilcox <matthew@wil.cx>
Tue, 10 Oct 2006 14:01:20 +0000 (08:01 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:36:57 +0000 (14:36 -0800)
The setting of the CACHE_LINE_SIZE register in sparc64's pci
initialisation code isn't quite adequate as the device may have
incompatible requirements.  The generic code tests for this, so switch
sparc64 over to using it.

Since sparc64 has different L1 cache line size and PCI cache line size,
it would need to override the generic code like i386 and ia64 do.  We
know what the cache line size is at compile time though, so introduce a
new optional constant PCI_CACHE_LINE_BYTES.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: David Miller <davem@davemloft.net>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc64/kernel/pci.c
drivers/pci/pci.c
include/asm-sparc64/pci.h

index e02f01b644af738ae1d19a7c1680fcbef1747964..dfc41cd4bb5d06f690fa47080e8a6dcbecb3c65e 100644 (file)
@@ -646,13 +646,4 @@ int pci_domain_nr(struct pci_bus *pbus)
 }
 EXPORT_SYMBOL(pci_domain_nr);
 
-int pcibios_prep_mwi(struct pci_dev *dev)
-{
-       /* We set correct PCI_CACHE_LINE_SIZE register values for every
-        * device probed on this platform.  So there is nothing to check
-        * and this always succeeds.
-        */
-       return 0;
-}
-
 #endif /* !(CONFIG_PCI) */
index 0eaf381ae93e6f27127e3479e85af03b589c1685..bc88c30a418b178118d8261eba594d603a15032e 100644 (file)
@@ -876,8 +876,14 @@ pci_set_master(struct pci_dev *dev)
 }
 
 #ifndef HAVE_ARCH_PCI_MWI
+
+#ifndef PCI_CACHE_LINE_BYTES
+#define PCI_CACHE_LINE_BYTES L1_CACHE_BYTES
+#endif
+
 /* This can be overridden by arch code. */
-u8 pci_cache_line_size = L1_CACHE_BYTES >> 2;
+/* Don't forget this is measured in 32-bit words, not bytes */
+u8 pci_cache_line_size = PCI_CACHE_LINE_BYTES / 4;
 
 /**
  * pci_generic_prep_mwi - helper function for pci_set_mwi
index e1ea67bc32f22f515db611a2874358679932133a..ca6560288ae826f9181f15fd5d4a6532dcc754e7 100644 (file)
@@ -18,6 +18,8 @@
 
 #define PCI_IRQ_NONE           0xffffffff
 
+#define PCI_CACHE_LINE_BYTES   64
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
@@ -291,10 +293,6 @@ extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
                               enum pci_mmap_state mmap_state,
                               int write_combine);
 
-/* Platform specific MWI support. */
-#define HAVE_ARCH_PCI_MWI
-extern int pcibios_prep_mwi(struct pci_dev *dev);
-
 extern void
 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
                        struct resource *res);