Root/target/linux/omap35xx/patches-2.6.36/004-nand_subpage_align.patch

1diff -urN linux-2.6.38.old/drivers/mtd/nand/omap2.c linux-2.6.38/drivers/mtd/nand/omap2.c
2--- linux-2.6.38.old/drivers/mtd/nand/omap2.c 2011-03-15 02:20:32.000000000 +0100
3+++ linux-2.6.38/drivers/mtd/nand/omap2.c 2011-03-21 15:05:21.000000000 +0100
4@@ -245,6 +245,18 @@
5     int ret = 0;
6     u32 *p = (u32 *)buf;
7 
8+ /* u32 align the buffer and read */
9+ /* NB: This assumes the buf ptr can be aligned *down* which is a valid.
10+ * Assumption when dealing with ecc buffers etc.
11+ */
12+ u32 addr = (u32)p;
13+
14+ int diff = addr & 3;
15+ addr -= diff;
16+ len += diff;
17+ len = (len + 3) & ~3;
18+ p = (u32 *)addr;
19+
20     /* take care of subpage reads */
21     if (len % 4) {
22         if (info->nand.options & NAND_BUSWIDTH_16)
23

Archive Download this file



interactive