mmc: dw_mmc: properly address command completion in dwmci_control_clken()
authorKaustabh Chakraborty <kauschluss@disroot.org>
Fri, 17 Oct 2025 15:24:08 +0000 (20:54 +0530)
committerPeng Fan <peng.fan@nxp.com>
Thu, 30 Oct 2025 02:11:17 +0000 (10:11 +0800)
commitae4601959202f4ea21c8a1aa42c5d2d894b03d57
tree2814bf4e085cd48537e61abdde013f87a351058a
parent3a5b187b5c03eff681d4e41823313dfa28dfe845
mmc: dw_mmc: properly address command completion in dwmci_control_clken()

The current implementation polls for the DWMCI_CMD register, for the
DWMCI_CMD_START bit to turn off, which indicates that the command has
been completed. The problem with this approach is that it doesn't
address the DWMCI_INTMSK_CDONE bit in the interrupt register,
DWMCI_RINTSTS. As a result, subsequent commands result in timeout errors.

Re-implement the waiting logic by polling for said interrupt status bit
and setting it low if raised.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/dw_mmc.c