[Bug 1223] SD card no longer operational with 2.6.24 (the never-ending saga)

Mike (mwester) mwester at dls.net
Tue Feb 19 05:10:15 CET 2008


Mike (mwester) wrote:
> Mike (mwester) wrote:
>> Tested.  The write fix is *definitely* needed as well; revision 4080 
>> fixes both read and write.  Thanks all - we're pretty close to being 
>> able to call the .24 kernel "stable" for the gta01, I think.
>
> No we're not.  I spoke too soon, that'll teach me to always test 
> thoroughly.  Reads work fine with this change, but writes fail in 
> strange ways.  My apologies to anyone inconvenienced by my erroneous 
> declaration of success :(
>
> We need to decrement fifo as we write the unaligned data out in the 
> first loop (s3cmci.c):

Still not there (yikes!).  The commit for svn4082 committed the change 
from this last email, but it got applied to a different area of the 
source file.  So that commit didn't fix the problem.  (That's the bad news).

Now the good news: that commit exposed a similar problem in a different 
area of the code -- same loop structure, needs the same fixes.  This 
time around I spent a little extra time doing a review of the two 
functions, and ended up changing the structure of the loops slightly:  
"while ((condition1) && fifo--)" is a bad idea if you need to ensure 
that fifo doesn't go below zero when the loop exits (follow the code 
with the case where we have an unaligned buffer, and need to read or 
write 1 byte).

Anyway, this time, to avoid ambiguity, here's a URL [1] to the patch 
that should be applied to the svn4082 s3cmci.c source file.  The entire 
source file is also available [2].

With this, I sure hope this undead dragon will finally stay dead.

Mike (mwester)

[1] http://moko.mwester.net/s3cmci_diff_from_svn4082.patch
[2] http://moko.mwester.net/s3cmci.c




More information about the openmoko-kernel mailing list