mmc: sdhci-of-dwcmshc: fix rpmb access
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Tue, 29 Dec 2020 08:16:25 +0000 (16:16 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 11 Jan 2021 16:50:51 +0000 (17:50 +0100)
commitca1219c0a7432272324660fc9f61a9940f90c50b
tree6f8f04b57802f4c4fd9f33a6505dbdfae56bb7d5
parent7c53f6b671f4aba70ff15e1b05148b10d58c2837
mmc: sdhci-of-dwcmshc: fix rpmb access

Commit a44f7cb93732 ("mmc: core: use mrq->sbc when sending CMD23 for
RPMB") began to use ACMD23 for RPMB if the host supports ACMD23. In
RPMB ACM23 case, we need to set bit 31 to CMD23 argument, otherwise
RPMB write operation will return general fail.

However, no matter V4 is enabled or not, the dwcmshc's ARGUMENT2
register is 32-bit block count register which doesn't support stuff
bits of CMD23 argument. So let's handle this specific ACMD23 case.

From another side, this patch also prepare for future v4 enabling
for dwcmshc, because from the 4.10 spec, the ARGUMENT2 register is
redefined as 32bit block count which doesn't support stuff bits of
CMD23 argument.

Fixes: a44f7cb93732 ("mmc: core: use mrq->sbc when sending CMD23 for RPMB")
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20201229161625.38255233@xhacker.debian
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-dwcmshc.c