[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-sparc
Subject: Re: javastation krups mtd patch detecting wrong amount of flash
From: Jasper van der Neut <jvanderneut () home ! nl>
Date: 2003-04-14 8:23:03
[Download RAW message or body]
On Wed, Apr 02, 2003 at 07:59:01AM +0300, Jarno Manninen wrote:
> > If I erase the a partition, copy a jffs2 image to it, I get CRC errors when
> > I mount it. When I mount an empty jffs2 partition, it already has used
> > blocks, which, I think, is not normal.
>
> At least to my experience you have to mount and unmount jffs2 partition after
> writing its initial content. Jffs2 then "fills" or "scans" the whole
> partition for it's use.
It seems jffs2 reads from flash in blocks of any size, not just a multiple
of 4. With the modification below, the jffs2 filesystem works, no more CRC
errors.
[snip]
> diff -urN -X dontdiff linux-2.4.20/drivers/mtd/maps/jsflash.c
[snip]
> +static void jsflash_copy_from(struct map_info *map, void *to,
> + unsigned long from, ssize_t len)
> +{
> + union byte4 {
> + char s[4];
> + unsigned int n;
> + } b;
> +
> + while (len >= 4) {
> + len -= 4;
> + b.n = jsflash_read32(map, from);
> + memcpy(to, b.s, 4);
> + from += 4;
> + to += 4;
> + }
if (len > 0) {
b.n = jsflash_read32(map, from);
memcpy(to, b.s, len);
}
> +}
Jasper
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic