mmc: Retry the switch command
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Fri, 4 Nov 2016 15:18:08 +0000 (16:18 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 16 Nov 2016 04:30:17 +0000 (13:30 +0900)
commita9003dc641cf881992897585392567811652de09
tree7830d735335d48c2de2f8acf433cb95c20bfc69d
parent29e0cfb4f77f7aa369136302cee14a91e22dca71
mmc: Retry the switch command

Some eMMC will fail at the first switch, but would succeed in a subsequent
one.

Make sure we try several times to cover those cases. The number of retries
(and the behaviour) is currently what is being used in Linux.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
drivers/mmc/mmc.c