diff options
author | Matthew Wilcox <matthew@wil.cx> | 2006-10-10 10:01:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:36:57 -0500 |
commit | ebf5a24829def5d066922ceebde61dd57fdc6b1e (patch) | |
tree | 5df978f750d554f2fd2cdd6f5694be943fd80e9f | |
parent | 3efe2d84c8d909567c7976a7106114127b8c3470 (diff) |
PCI: Use pci_generic_prep_mwi on sparc64
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>
-rw-r--r-- | arch/sparc64/kernel/pci.c | 9 | ||||
-rw-r--r-- | drivers/pci/pci.c | 8 | ||||
-rw-r--r-- | include/asm-sparc64/pci.h | 6 |
3 files changed, 9 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index e02f01b644af..dfc41cd4bb5d 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -646,13 +646,4 @@ int pci_domain_nr(struct pci_bus *pbus) | |||
646 | } | 646 | } |
647 | EXPORT_SYMBOL(pci_domain_nr); | 647 | EXPORT_SYMBOL(pci_domain_nr); |
648 | 648 | ||
649 | int pcibios_prep_mwi(struct pci_dev *dev) | ||
650 | { | ||
651 | /* We set correct PCI_CACHE_LINE_SIZE register values for every | ||
652 | * device probed on this platform. So there is nothing to check | ||
653 | * and this always succeeds. | ||
654 | */ | ||
655 | return 0; | ||
656 | } | ||
657 | |||
658 | #endif /* !(CONFIG_PCI) */ | 649 | #endif /* !(CONFIG_PCI) */ |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 0eaf381ae93e..bc88c30a418b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -876,8 +876,14 @@ pci_set_master(struct pci_dev *dev) | |||
876 | } | 876 | } |
877 | 877 | ||
878 | #ifndef HAVE_ARCH_PCI_MWI | 878 | #ifndef HAVE_ARCH_PCI_MWI |
879 | |||
880 | #ifndef PCI_CACHE_LINE_BYTES | ||
881 | #define PCI_CACHE_LINE_BYTES L1_CACHE_BYTES | ||
882 | #endif | ||
883 | |||
879 | /* This can be overridden by arch code. */ | 884 | /* This can be overridden by arch code. */ |
880 | u8 pci_cache_line_size = L1_CACHE_BYTES >> 2; | 885 | /* Don't forget this is measured in 32-bit words, not bytes */ |
886 | u8 pci_cache_line_size = PCI_CACHE_LINE_BYTES / 4; | ||
881 | 887 | ||
882 | /** | 888 | /** |
883 | * pci_generic_prep_mwi - helper function for pci_set_mwi | 889 | * pci_generic_prep_mwi - helper function for pci_set_mwi |
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index e1ea67bc32f2..ca6560288ae8 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #define PCI_IRQ_NONE 0xffffffff | 19 | #define PCI_IRQ_NONE 0xffffffff |
20 | 20 | ||
21 | #define PCI_CACHE_LINE_BYTES 64 | ||
22 | |||
21 | static inline void pcibios_set_master(struct pci_dev *dev) | 23 | static inline void pcibios_set_master(struct pci_dev *dev) |
22 | { | 24 | { |
23 | /* No special bus mastering setup handling */ | 25 | /* 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, | |||
291 | enum pci_mmap_state mmap_state, | 293 | enum pci_mmap_state mmap_state, |
292 | int write_combine); | 294 | int write_combine); |
293 | 295 | ||
294 | /* Platform specific MWI support. */ | ||
295 | #define HAVE_ARCH_PCI_MWI | ||
296 | extern int pcibios_prep_mwi(struct pci_dev *dev); | ||
297 | |||
298 | extern void | 296 | extern void |
299 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 297 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
300 | struct resource *res); | 298 | struct resource *res); |