[Bug 1223] SD card no longer operational with 2.6.24

Mike (mwester) mwester at dls.net
Sun Feb 17 08:47:45 CET 2008


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):

                host->pio_bytes -= fifo;
                host->pio_count += fifo;

                /* we might have an unaligned start of data */
-                while ((unsigned long)host->pio_ptr & 0x03)
+                while (((unsigned long)host->pio_ptr & 0x03) && fifo--)
                        writeb(*(host->pio_ptr++), host->base + 
host->sdidata_b);

                /* and a major chunk of data in the middle */
                for (; fifo >= 4; fifo -=4) {
                        writel(*(u32 *) host->pio_ptr, to_ptr);
                        host->pio_ptr += 4;
                }

                /* as well as some non-modulo-four trailer */
                while (fifo--)
                        writeb(*(host->pio_ptr++), host->base + 
host->sdidata_b);
        }

        enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);


Still not thoroughly tested, and it sure is slow with all that debug 
going to the console, but it works better than it did a few minutes ago.

Mike (mwester)




More information about the openmoko-kernel mailing list