Per SDHCI v3.00 the controller only generates Buffer Read Ready
(SDHCI_INT_DATA_AVAIL) during a tuning sequence; CMD_COMPLETE does
not fire. Switch the wait mask for CMD19/21 so HS200 tuning can
converge. Mirrors the arasan-sdhci driver.

This is done only to put the finger on this issue. The next commit
will replace the rockchip specific rk_sdhci_send_cmd() with the
generic sdhci_send_command() which does the same.

Assisted-by: Claude Opus 4.7
Signed-off-by: Sascha Hauer <[email protected]>
---
 drivers/mci/rockchip-dwcmshc-sdhci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mci/rockchip-dwcmshc-sdhci.c 
b/drivers/mci/rockchip-dwcmshc-sdhci.c
index 57d5fe1369..1fdea7c4ab 100644
--- a/drivers/mci/rockchip-dwcmshc-sdhci.c
+++ b/drivers/mci/rockchip-dwcmshc-sdhci.c
@@ -333,6 +333,10 @@ static int rk_sdhci_send_cmd(struct mci_host *mci, struct 
mci_cmd *cmd)
        sdhci_write32(&host->sdhci, SDHCI_ARGUMENT, cmd->cmdarg);
        sdhci_write16(&host->sdhci, SDHCI_COMMAND, command);
 
+       /* CMD19/21 generate _only_ Buffer Read Ready interrupt */
+       if (mmc_op_tuning(cmd->cmdidx))
+               mask = SDHCI_INT_DATA_AVAIL;
+
        ret = sdhci_wait_for_done(&host->sdhci, mask);
        if (ret) {
                sdhci_teardown_data(&host->sdhci, data, dma);

-- 
2.47.3


Reply via email to