mmc: core: use mrq->sbc when sending CMD23 for RPMB
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 26 Nov 2018 13:38:13 +0000 (14:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Dec 2018 18:19:51 +0000 (19:19 +0100)
commit105819c8a545589849eecf5f2a04caf5045b08e0
tree7a17b992fc6cafd2d44ca23bacb1eb127bd4e5ca
parente1e99fea907a42c1ad9c988458699b90ed567eb0
mmc: core: use mrq->sbc when sending CMD23 for RPMB

commit a44f7cb937321d4961bfc8f28912126b06e701c5 upstream.

When sending out CMD23 in the blk preparation, the comment there
rightfully says:

 * However, it is not sufficient to just send CMD23,
 * and avoid the final CMD12, as on an error condition
 * CMD12 (stop) needs to be sent anyway. This, coupled
 * with Auto-CMD23 enhancements provided by some
 * hosts, means that the complexity of dealing
 * with this is best left to the host. If CMD23 is
 * supported by card and host, we'll fill sbc in and let
 * the host deal with handling it correctly.

Let's do this behaviour for RPMB as well, and not send CMD23
independently. Otherwise IP cores (like Renesas SDHI) may timeout
because of automatic CMD23/CMD12 handling.

Reported-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Clément Péron <peron.clem@gmail.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
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