mmc: core: Fixup support for HW busy detection for HPI commands
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 4 Feb 2020 08:54:48 +0000 (09:54 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Mar 2020 13:35:40 +0000 (14:35 +0100)
commit892bf1001459fc38c7e9bc248633681ca628e614
tree1d5840ec35378a22d19aa018da23c28e2771227b
parent490ff95f8e2c89d7541f187bae78d340b20d0ef0
mmc: core: Fixup support for HW busy detection for HPI commands

In case the host specify a max_busy_timeout, we need to validate that the
needed timeout for the HPI command conforms to that requirement. If that's
not the case, let's convert from a R1B response to a R1 response, as to
instruct the host to avoid HW busy detection.

Additionally, when R1B is used we must also inform the host about the busy
timeout for the command, so let's do that via updating cmd.busy_timeout.

Finally, when R1B is used and in case the host supports HW busy detection,
there should be no need for doing polling, so then skip that.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Baolin Wang <baolin.wang7@gmail.com>
Tested-by: Ludovic Barre <ludovic.barre@st.com>
Reviewed-by: Ludovic Barre <ludovic.barre@st.com>
Link: https://lore.kernel.org/r/20200204085449.32585-12-ulf.hansson@linaro.org
drivers/mmc/core/mmc_ops.c