[0/1] Fix race between stop command and start of next command in atmel-mci

Message ID 20221230194315.809903-1-t.schramm@manjaro.org
Headers
Series Fix race between stop command and start of next command in atmel-mci |

Message

Tobias Schramm Dec. 30, 2022, 7:43 p.m. UTC
  Hey,

while using both slots on controller version 0x210 I noticed a race
condition in atmel-mci. When sending a stop command the command ready
interrupt is enabled before writing to the command register. This causes
the associated interrupt to fire immediately, making the state machine
believe that the stop command has completed already.
Usually this does not seem to cause a problem. I suspect the roudtrip of
mmc command completion through the kernel simply takes long enough that
the stop command has usually completed once a new command is queued.
However when using both slots a command might be queued for the other
slot already, causing immediate dispatch of that command to the
controller. This then interrupts the stop command still being sent and
also corrupts the new command.

I have only tested this patch with controller version 0x210, but from
documentation it seems like this should be a correct fix also for other
controller versions.

Cheers,
Tobias

Tobias Schramm (1):
  mmc: atmel-mci: fix race between stop command and start of next
    command

 drivers/mmc/host/atmel-mci.c | 3 ---
 1 file changed, 3 deletions(-)