sh: pci: Disable MWI and make pci_dma_burst_advice() a bit more accurate.
[safe/jmp/linux-2.6] / arch / sh / include / asm / pci.h
index 5b2e0fc..ae0da6f 100644 (file)
@@ -89,12 +89,28 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
 #endif
 
 #ifdef CONFIG_PCI
+/*
+ * None of the SH PCI controllers support MWI, it is always treated as a
+ * direct memory write.
+ */
+#define PCI_DISABLE_MWI
+
 static inline void pci_dma_burst_advice(struct pci_dev *pdev,
                                        enum pci_dma_burst_strategy *strat,
                                        unsigned long *strategy_parameter)
 {
-       *strat = PCI_DMA_BURST_INFINITY;
-       *strategy_parameter = ~0UL;
+       unsigned long cacheline_size;
+       u8 byte;
+
+       pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
+
+       if (byte == 0)
+               cacheline_size = L1_CACHE_BYTES;
+       else
+               cacheline_size = byte << 2;
+
+       *strat = PCI_DMA_BURST_MULTIPLE;
+       *strategy_parameter = cacheline_size;
 }
 #endif