[PATCH] fix root cause of NAND trouble

Ben Dooks ben-linux at fluff.org
Sat Nov 1 21:38:57 CET 2008

On Sat, Nov 01, 2008 at 01:54:53PM -0200, Werner Almesberger wrote:
> Andy Green wrote:
> > It seems its moot since the patch is not accepted as the solution...
> Not so hasty :-) Ben thought this was something else entirely.
> Let's see if he likes it better now that I've explained what's
> really going on.
> > you have some time to dig further into it to see where the unaligned
> > reads are suddenly coming from?
> They're coming from nand_read_subpage and are just what the code
> there intends to do. There are (at least) three ways to fix this:
> 1) declare non-word accesses generally illegal, which means that
>    nand_read_subpage needs to change
> 2) make the driver support non-word accesses. This is what my
>    patch does.

I think this should be ok if it is as you say that the driver is
only reading three bytes from the ECC. My only comment would be
that a slightly better solution would be to do:

	u8 *ptr = buf + (len & ~3);
	for (i = 0; i < (len & 3); i++)
		ptr[i] = readb(_pointertodataregister);
so we always read the requisting number of data bytes from the data

> 3) add some means for the driver to inform the NAND layer that it
>    has special alignment constraints.
> 1) and 2) would be straightforward to do. 3) would make an
> already hard to understand interface a little more complex.
> - Werner


Q:      What's a light-year?
A:      One-third less calories than a regular year.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20081101/2668cce8/attachment.pgp 

More information about the openmoko-kernel mailing list