On 10/07/2011 09:11 PM, Russell King - ARM Linux wrote:
But first, you need to fix your code so you're only reading 32-bit
quantities from the FIFO register.

Hi Russel, what to you think of doing it this way instead:

                /*
                 * SDIO especially may want to send something that is
                 * not divisible by 4 (as opposed to card sectors
                 * etc), and the FIFO only accept full 32-bit reads.
                 */
                if (count < 4) {
                        unsigned char buf[4];
                        readsl(base + MMCIFIFO, buf, 1);
                        memcpy(ptr, buf, count);
                }
                else
                        readsl(base + MMCIFIFO, ptr, count >> 2);

This makes sure we only access the FIFO in a 32 bit way, and the only overhead for the "standard" case (count >= 4) is the "if" clause. I have verified this to work with our WLAN driver.

Best Regards

Stefan Nilsson
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to