From 15b6993ce68956022af5df22d110898f8b61a252 Mon Sep 17 00:00:00 2001 From: John Bowler Date: Mon, 14 Nov 2005 06:29:32 +0000 Subject: nslu2-kernel: upgrade to 2.6.14.2 nslu2-kernel: add (only semi working) 2.6.15-rc1 --- .../nslu2-kernel/2.6.15/mtd-unaligned-read-fix | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 packages/linux/nslu2-kernel/2.6.15/mtd-unaligned-read-fix (limited to 'packages/linux/nslu2-kernel/2.6.15/mtd-unaligned-read-fix') diff --git a/packages/linux/nslu2-kernel/2.6.15/mtd-unaligned-read-fix b/packages/linux/nslu2-kernel/2.6.15/mtd-unaligned-read-fix new file mode 100644 index 0000000000..f4f468ce85 --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.15/mtd-unaligned-read-fix @@ -0,0 +1,40 @@ +diff -u linux-2.6-working/drivers/mtd/maps/ixp4xx.c linux-2.6-working/drivers/mtd/maps/ixp4xx.c +--- linux-2.6.15/drivers/mtd/maps/ixp4xx.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/drivers/mtd/maps/ixp4xx.c 1970-01-01 00:00:00.000000000 +0000 +@@ -53,19 +53,28 @@ + static void ixp4xx_copy_from(struct map_info *map, void *to, + unsigned long from, ssize_t len) + { +- int i; + u8 *dest = (u8 *) to; + void __iomem *src = map->virt + from; +- u16 data; + +- for (i = 0; i < (len / 2); i++) { +- data = le16_to_cpu(readw(src + 2*i)); +- dest[i * 2] = BYTE0(data); +- dest[i * 2 + 1] = BYTE1(data); ++ if (len <= 0) ++ return; ++ ++ if (from & 1) { ++ *dest++ = BYTE1(le16_to_cpu(readw(src))); ++ src++; ++ --len; ++ } ++ ++ while (len >= 2) { ++ u16 data = le16_to_cpu(readw(src)); ++ *dest++ = BYTE0(data); ++ *dest++ = BYTE1(data); ++ src += 2; ++ len -= 2; + } + +- if (len & 1) +- dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i))); ++ if (len > 0) ++ *dest++ = BYTE0(le16_to_cpu(readw(src))); + } + + /* -- cgit v1.2.3