mmc: dw_mmc: Make sure we don't get stuck when we get an error
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 <49983c4a76b998672954ed5edf4a62db4a336502@chromium.org>
Signed-off-by: Yuvaraj Kumar C D <980739df097cc0d4dea586831cee2749df8102fd@gmail.com>
Acked-by: Seungwon Jeon <a133bc924ee401eac4c4f97927180f14b8a9baec@samsung.com>
Signed-off-by: Ulf Hansson <fe47b31f388f85ce6ddf64bf3a0cf6b46077d0e6@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs