]> 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)
commit874b7568d279f7f317f91765a073ed244a50e44e
tree2c1ecb1a570cd7a0207bcd0b2520c89a37d2cc33
parentc1fd0bedf407d35cbd353051b7b0e4091e63bbef
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