]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: core: Fix error propagation for some ioctl commands
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 13 Sep 2023 11:29:21 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2023 08:35:21 +0000 (09:35 +0100)
commit1fae817d3ecb23dfa75e3a5ece8f842902f56aab
tree2a831688dca33a340518a7f3a9c912d12535ea17
parent719c01f28130261ca9fdc274152c3a6c8ae22dc5
mmc: core: Fix error propagation for some ioctl commands

[ Upstream commit f19c5a73e6f78d69efce66cfdce31148c76a61a6 ]

Userspace has currently no way of checking the internal R1 response error
bits for some commands. This is a problem for some commands, like RPMB for
example. Typically, we may detect that the busy completion has successfully
ended, while in fact the card did not complete the requested operation.

To fix the problem, let's always poll with CMD13 for these commands and
during the polling, let's also aggregate the R1 response bits. Before
completing the ioctl request, let's propagate the R1 response bits too.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Co-developed-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230913112921.553019-1-ulf.hansson@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/core/block.c