Re: [PATCH 1/4] mmc: mmci: Bugfix in pio read for small packets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux