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 09:57:21 +0000 (10:57 +0100)
commit12e8ae94b634ab0235b0a52cd3f7593deed63650
treed025099f3eca4b3f1f8d2e9ea9df846b1a831818
parent848fd6b17926703648a2c77933a3713163e875e4
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