RE: file corruption with highmem kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



List,

With a slightly modified patched (copied below) I have reached a point
where I am no more seeing errors like segmentation fault, bus error
(which was due to memory corruption I believe).
How ever I am still seeing some kind of file corruption. 

I believe this file corruption happening because cache is not getting
invalidated before a highmem dma. I am not sure which routine to call to
invalidate cache for a highmem address. 

Hope to see response from linux-mips gurus

Thank you,
Anoop   

--- arch/mips/mm/dma-noncoherent.c.orig	2010-08-02 23:53:17.000000000
+0530
+++ arch/mips/mm/dma-noncoherent.c	2010-08-06 00:17:21.000000000
+0530
@@ -131,13 +131,14 @@
 
 	for (i = 0; i < nents; i++, sg++) {
 		unsigned long addr;
-
-		addr = (unsigned long) page_address(sg->page);
-		if (addr) {
-			__dma_sync(addr + sg->offset, sg->length,
direction);
-			sg->dma_address =
(dma_addr_t)page_to_phys(sg->page)
-					  + sg->offset;
+		if (!PageHighMem(sg->page)){
+			addr = (unsigned long)page_address(sg->page) +
sg->offset;
+			__dma_sync(addr , sg->length, direction);
 		}
+
+		sg->dma_address = (dma_addr_t)page_to_phys(sg->page)
+					+ sg->offset;
+		
 	}
 
 	return nents;
@@ -187,9 +188,10 @@
 		return;
 
 	for (i = 0; i < nhwentries; i++, sg++) {
-		addr = (unsigned long) page_address(sg->page);
-		if (addr)
-			__dma_sync(addr + sg->offset, sg->length,
direction);
+		if (!PageHighMem(sg->page)){
+			addr = (unsigned long)page_address(sg->page) +
sg->offset;
+			__dma_sync(addr , sg->length, direction);
+		}
 	}
 }




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux