mmc: block: Unhalt the command queue before releasing mmc host

In the IOCTL path, the command queue is halted before servicing
the ioctl requests. Once the ioctl request is serviced, the ioctl
context releases mmc host and then unhalts the controller. This can
cause race conditions where mmc driver would end up in a bad state.
If another context B, which wants to send a legacy command, comes up
between the time ioctl releases the host and unhalts the controller.
Then the context B will see that cmdq is already halted and will prepare
a legacy command. Once context B sends the legacy command, the ioctl
context may unhalt the cmdq. This will mask the legacy interrupts and
context B will never receive interrupts for the command it sent.

To prevent this, unhalt the controller before the ioctl context releases
the host.

Change-Id: I65d3b4a709813549e7e5d48d94065a753164f9d0
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
1 file changed