Index: arch/mips/kernel/pci-dma.c =================================================================== RCS file: /cvs/linux/arch/mips/kernel/pci-dma.c,v retrieving revision 1.7.2.1 diff -u -r1.7.2.1 pci-dma.c --- arch/mips/kernel/pci-dma.c 2002/08/01 12:40:14 1.7.2.1 +++ arch/mips/kernel/pci-dma.c 2002/08/05 12:54:19 @@ -30,11 +30,11 @@ if (ret != NULL) { memset(ret, 0, size); + *dma_handle = virt_to_bus(ret); #ifdef CONFIG_NONCOHERENT_IO dma_cache_wback_inv((unsigned long) ret, size); ret = UNCAC_ADDR(ret); #endif - *dma_handle = virt_to_bus(ret); } return ret; Index: include/asm-mips/page.h =================================================================== RCS file: /cvs/linux/include/asm-mips/page.h,v retrieving revision 1.14.2.9 diff -u -r1.14.2.9 page.h --- include/asm-mips/page.h 2002/08/01 12:40:14 1.14.2.9 +++ include/asm-mips/page.h 2002/08/05 12:54:32 @@ -125,8 +125,8 @@ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#define UNCAC_ADDR(addr) ((addr) - (PAGE_OFFSET + UNCAC_BASE)) -#define CAC_ADDR(addr) ((addr) - (UNCAC_BASE + PAGE_OFFSET)) +#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE) +#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET) /* * Memory above this physical address will be considered highmem. Index: include/asm-mips/pci.h =================================================================== RCS file: /cvs/linux/include/asm-mips/pci.h,v retrieving revision 1.24.2.7 diff -u -r1.24.2.7 pci.h --- include/asm-mips/pci.h 2002/08/01 12:40:14 1.24.2.7 +++ include/asm-mips/pci.h 2002/08/05 12:54:32 @@ -180,7 +180,7 @@ else if (!sg->address && !sg->page) out_of_line_bug(); - if (sg[i].address) { + if (sg->address) { dma_cache_wback_inv((unsigned long)sg->address, sg->length); sg->dma_address = virt_to_bus(sg->address); @@ -317,7 +317,7 @@ * returns, or alternatively stop on the first sg_dma_len(sg) which * is 0. */ -#define sg_dma_address(sg) ((sg)->address) +#define sg_dma_address(sg) ((sg)->dma_address) #define sg_dma_len(sg) ((sg)->length) #endif /* __KERNEL__ */