diff mbox series

[3/4] mmc: sdhci-omap: Fix busy detection by enabling MMC_CAP_NEED_RSP_BUSY

Message ID 20200310153340.5593-4-ulf.hansson@linaro.org
State New
Headers show
Series mmc: Fix busy detection timeouts for some SDHCI variant | expand

Commit Message

Ulf Hansson March 10, 2020, 3:33 p.m. UTC
It has turned out that the sdhci-omap controller requires the R1B response,
for commands that has this response associated with them. So, converting
from an R1B to an R1 response for a CMD6 for example, leads to problems
with the HW busy detection support.

Fix this by informing the mmc core about the requirement, via setting the
host cap, MMC_CAP_NEED_RSP_BUSY.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Anders Roxell <anders.roxell@linaro.org>
Reported-by: Faiz Abbas <faiz_abbas@ti.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/mmc/host/sdhci-omap.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.20.1

Comments

Faiz Abbas March 11, 2020, 9:38 a.m. UTC | #1
Hi Uffe,

On 10/03/20 9:03 pm, Ulf Hansson wrote:
> It has turned out that the sdhci-omap controller requires the R1B response,
> for commands that has this response associated with them. So, converting
> from an R1B to an R1 response for a CMD6 for example, leads to problems
> with the HW busy detection support.
> 
> Fix this by informing the mmc core about the requirement, via setting the
> host cap, MMC_CAP_NEED_RSP_BUSY.
> 
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Reported-by: Anders Roxell <anders.roxell@linaro.org>
> Reported-by: Faiz Abbas <faiz_abbas@ti.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Thanks for sending this fix. I will more look into the underlying
behaviour once I'm back in office next week.

Tested-by: Faiz Abbas <faiz_abbas@ti.com>

Regards,
Faiz
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 882053151a47..c4978177ef88 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1192,6 +1192,9 @@  static int sdhci_omap_probe(struct platform_device *pdev)
 	if (of_find_property(dev->of_node, "dmas", NULL))
 		sdhci_switch_external_dma(host, true);
 
+	/* R1B responses is required to properly manage HW busy detection. */
+	mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
+
 	ret = sdhci_setup_host(host);
 	if (ret)
 		goto err_put_sync;