]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: dw_mmc: clear TXDR/RXDR ints before enabling
authorJames Hogan <james.hogan@imgtec.com>
Fri, 24 Jun 2011 12:54:06 +0000 (13:54 +0100)
committerChris Ball <cjb@laptop.org>
Wed, 20 Jul 2011 21:20:57 +0000 (17:20 -0400)
commit888f9649ff1c07048d6494b434407454c8c36fb3
tree2c1ecb1a570cd7a0207bcd0b2520c89a37d2cc33
parent3a7bfb12689403dc571c6817893dbc9c88802c65
mmc: dw_mmc: clear TXDR/RXDR ints before enabling

DMA is only used for transactions exceeding a certain length, otherwise
PIO is used. The TXDR and RXDR interrupts are masked when in DMA mode
but still fire. When switching to PIO mode (e.g. to get SCR field when
an SD card is inserted) these interrupts are not cleared and so they
trigger the ISR as soon as they are unmasked. If the previous DMA did a
write, then the ISR will handle the TXDR interrupt even if the
transaction is a read, completing the transaction without modifying the
read buffer.

This is fixed primarily by clearing these two interrupts before
unmasking them when setting up PIO mode, and also by making the ISR more
robust by only handling TXDR/RXDR in the correct read/write direction.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/dw_mmc.c