Linux MIPS Architecture development
 help / color / mirror / Atom feed
* file corruption with highmem kernel
@ 2010-08-02 13:29 Anoop P.A.
  2010-08-05 13:43 ` Anoop P.A.
  0 siblings, 1 reply; 4+ messages in thread
From: Anoop P.A. @ 2010-08-02 13:29 UTC (permalink / raw)
  To: linux-mips, Ralf Baechle

List,

I am running 2.6.18 (highmem) kernel in RM9000 based SOC with 2 Gig RAM.
I have observed file corruption and system hangs (Easily reproducible on
remounting file system) when doing file copy to SATA disk / USB disk (
SATA/ USB controller over PCI) . How ever when I limit memory with
option mem=512M from command line everything seems to be working fine.

Issue is reproducible with 2.6.18-stable lmo git sources .

I have modified dma-noncoherent.c as follows and I am no more
experiencing system hang. But file's are getting corrupted (observed bus
error / segmentation fault / illegal instruction error few times)
occasionally.  One more observation I have made is file corruption is
more if I use root file system from onboard USB flash, than running a
NFS root mount.


--- arch/mips/mm/dma-noncoherent.c.orig	2010-08-02 23:53:17.000000000
+0530
+++ arch/mips/mm/dma-noncoherent.c	2010-08-02 23:56:19.000000000
+0530
@@ -132,12 +132,13 @@
 	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;
-		}
+		addr = (unsigned long) page_address(sg->page) +
sg->offset;
+		if (addr) 
+			__dma_sync(addr, sg->length, direction);
+		
+		sg->dma_address = (dma_addr_t)page_to_phys(sg->page)
+					+ sg->offset;
+		
 	}
 
 	return nents;
@@ -187,9 +188,9 @@
 		return;
 
 	for (i = 0; i < nhwentries; i++, sg++) {
-		addr = (unsigned long) page_address(sg->page);
+		addr = (unsigned long) page_address(sg->page) +
sg->offset;
 		if (addr)
-			__dma_sync(addr + sg->offset, sg->length,
direction);
+			__dma_sync(addr , sg->length, direction);
 	}
 }


It will be great if any body can give me some pointers / help to fix the
issue.

Thanks
Anoop

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-06 10:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 13:29 file corruption with highmem kernel Anoop P.A.
2010-08-05 13:43 ` Anoop P.A.
2010-08-05 18:25   ` Ralf Baechle
2010-08-06 10:12     ` Anoop P.A.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox