Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
[sfrench/cifs-2.6.git] / arch / powerpc / sysdev / indirect_pci.c
index cfbd2aae93e8a178e665242f415894b34fce3b41..7ed8096766422759cf333062020c57f157566687 100644 (file)
@@ -24,7 +24,7 @@ static int
 indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
                     int len, u32 *val)
 {
-       struct pci_controller *hose = bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
        u32 bus_no, reg;
@@ -82,7 +82,7 @@ static int
 indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
                      int len, u32 val)
 {
-       struct pci_controller *hose = bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
        u32 bus_no, reg;
@@ -123,6 +123,12 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
                        (bus->number == hose->first_busno))
                val &= 0xffffff00;
 
+       /* Workaround for PCI_28 Errata in 440EPx/GRx */
+       if ((hose->indirect_type & PPC_INDIRECT_TYPE_BROKEN_MRM) &&
+                       offset == PCI_CACHE_LINE_SIZE) {
+               val = 0;
+       }
+
        /*
         * Note: the caller has already checked that offset is
         * suitably aligned and that len is 1, 2 or 4.