mmc: dw_mmc: Make sure we don't get stuck when we get an error
authorDoug Anderson <dianders@chromium.org>
Wed, 13 Aug 2014 15:13:43 +0000 (08:13 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 9 Sep 2014 11:59:01 +0000 (13:59 +0200)
commit2aa354650a8b024a507f5b0fd969b7cfa3848620
tree7025e14411e53621439ef838506b898c3dae2a7d
parentb3683994843a0ede0e19daccd1ac32a46b21eb39
mmc: dw_mmc: Make sure we don't get stuck when we get an error

If we happened to get a data error at just the wrong time the dw_mmc
driver could get into a state where it would never complete its
request.  That would leave the caller just hanging there.

We fix this two ways and both of the two fixes on their own appear to
fix the problems we've seen:

1. Fix a race in the tasklet where the interrupt setting the data
   error happens _just after_ we check for it, then we get a
   EVENT_XFER_COMPLETE.  We fix this by repeating a bit of code.
2. Fix it so that if we detect that we've got an error in the "data
   busy" state and we're not going to do anything else we end the
   request and unblock anyone waiting.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@gmail.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c