No subject


Fri Oct 22 17:57:35 EDT 2010


I went down to the kernel and found the following problem. I will start in =
jffs2_flash_writev() from fs/jffs2/wbuf.c. There is a for loop running thro=
ugh a vector invec. Inside the loop data is written to the write buffer (wb=
uf). If the buffer is full __jffs2_flush_wbuf will be called. If now an una=
ligned amount of data was written the next call c->mtd->write() inside the =
next condition will fail, because the pointer (v) is not aligned. This poin=
ter is directly written to the dma. This results in the crash above.

I suggest the following patch. For me this works fine.

--- linux-2.6.33.7.orig/drivers/mtd/nand/omap2.c 2010-08-02 19:27:18.000000=
000 +0200
+++ linux-2.6.33.7/drivers/mtd/nand/omap2.c 2011-04-11 17:11:53.000000000 +=
0200
@@ -503,9 +506,11 @@
=C2=A0{
=C2=A0 if (len <=3D mtd->oobsize)
=C2=A0 omap_write_buf_pref(mtd, buf, len);
+ else if (!IS_ALIGNED((unsigned long)buf, 4))
+ omap_write_buf_pref(mtd, buf, len);
=C2=A0 else
=C2=A0 /* start transfer in DMA mode */
- omap_nand_dma_transfer(mtd, buf, len, 0x1);
+ omap_nand_dma_transfer(mtd, (void*)buf, len, 0x1);
=C2=A0}
=C2=A0
=C2=A0/**
Thanks very much!


=C2=A0
___________________________________________________________
Empfehlen Sie WEB.DE DSL Ihren Freunden und Bekannten und wir  =20
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.web.de



More information about the linux-mtd mailing list