mmc: block: Add CMD13 polling for MMC IOCTLS with R1B response
authorChaotian Jing <chaotian.jing@mediatek.com>
Thu, 5 Sep 2019 07:53:18 +0000 (15:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 10:04:23 +0000 (11:04 +0100)
commit89c6e88294693dbbbd3d94f22940320f67f7792d
treef28217dca64b85c7025f67bef306bb1d6ec1969b
parent0cc2b0e6e5b6b9ff105115ce4d6dfdb2c8165b27
mmc: block: Add CMD13 polling for MMC IOCTLS with R1B response

commit a0d4c7eb71dd08a89ad631177bb0cbbabd598f84 upstream.

MMC IOCTLS with R1B responses may cause the card to enter the busy state,
which means it's not ready to receive a new request. To prevent new
requests from being sent to the card, use a CMD13 polling loop to verify
that the card returns to the transfer state, before completing the request.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/block.c