linux-mips
[Top] [All Lists]

PCI patch of the day

To: Ralf Baechle <ralf@oss.sgi.com>, "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>, linux-mips@oss.sgi.com
Subject: PCI patch of the day
From: Carsten Langgaard <carstenl@mips.com>
Date: Wed, 07 Aug 2002 10:20:39 +0200
Sender: owner-linux-mips@oss.sgi.com
It's apparently not that easy to get the PCI code right, the current
code won't compile, so here is the patch of the day.

/Carsten

--
_    _ ____  ___   Carsten Langgaard   Mailto:carstenl@mips.com
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com


Index: include/asm-mips/pci.h
===================================================================
RCS file: /cvs/linux/include/asm-mips/pci.h,v
retrieving revision 1.24.2.10
diff -u -r1.24.2.10 pci.h
--- include/asm-mips/pci.h      2002/08/07 03:33:30     1.24.2.10
+++ include/asm-mips/pci.h      2002/08/07 08:06:54
@@ -120,8 +120,8 @@
        if (direction != PCI_DMA_TODEVICE) {
                unsigned long addr;
 
-               addr = bus_to_virt(baddr_to_bus(hwdev, dma_address));
-               dma_cache_back_inv(addr, size);
+               addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev, dma_addr));
+               dma_cache_wback_inv(addr, size);
        }
 }
 
@@ -153,8 +153,8 @@
        if (direction != PCI_DMA_TODEVICE) {
                unsigned long addr;
 
-               addr = bus_to_virt(baddr_to_bus(hwdev, dma_address));
-               dma_cache_back_inv(addr, size);
+               addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev, 
dma_address));
+               dma_cache_wback_inv(addr, size);
        }
 }
 
@@ -255,7 +255,7 @@
        if (direction == PCI_DMA_NONE)
                out_of_line_bug();
 
-       addr = dma_handle - bus_to_baddr(hwdev->bus->number) + PAGE_OFFSET;
+       addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev->bus->number, 
dma_handle));
        dma_cache_wback_inv(addr, size);
 }
 
Index: include/asm-mips64/pci.h
===================================================================
RCS file: /cvs/linux/include/asm-mips64/pci.h,v
retrieving revision 1.16.2.11
diff -u -r1.16.2.11 pci.h
--- include/asm-mips64/pci.h    2002/08/07 03:33:30     1.16.2.11
+++ include/asm-mips64/pci.h    2002/08/07 08:06:55
@@ -146,8 +146,8 @@
        if (direction != PCI_DMA_TODEVICE) {
                unsigned long addr;
 
-               addr = bus_to_virt(baddr_to_bus(hwdev, dma_address));
-               dma_cache_back_inv(addr, size);
+               addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev, dma_addr));
+               dma_cache_wback_inv(addr, size);
        }
 }
 
@@ -187,8 +187,8 @@
        if (direction != PCI_DMA_TODEVICE) {
                unsigned long addr;
 
-               addr = bus_to_virt(baddr_to_bus(hwdev, dma_address));
-               dma_cache_back_inv(addr, size);
+               addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev, 
dma_address));
+               dma_cache_wback_inv(addr, size);
        }
 }
 
@@ -281,7 +281,7 @@
        if (direction == PCI_DMA_NONE)
                out_of_line_bug();
 
-       addr = dma_handle - bus_to_baddr(hwdev->bus->number) + PAGE_OFFSET;
+       addr = (dma_addr_t)bus_to_virt(baddr_to_bus(hwdev->bus->number, 
dma_handle));
        dma_cache_wback_inv(addr, size);
 }
 
<Prev in Thread] Current Thread [Next in Thread>