]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: dwmmc: only clear handled interrupts
authorJohn Keeping <john@metanate.com>
Thu, 15 Sep 2022 17:56:56 +0000 (18:56 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 24 Oct 2022 09:02:41 +0000 (18:02 +0900)
commit50754f0231b3d4128cc3b5453804d3154d53c92c
treef2d31cb0ff3a3fdefc553f31758ad1cf96e18660
parent13cbe1bd8451751c0a62574609173810e78725b8
mmc: dwmmc: only clear handled interrupts

Unconditionally clearing DTO when RXDR is set leads to spurious timeouts
in FIFO mode transfers if events occur in the following order:

mask = dwmci_readl(host, DWMCI_RINTSTS);

// Hardware asserts DWMCI_INTMSK_DTO here

dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_DTO);

if (mask & DWMCI_INTMSK_DTO) {
// Unreachable as DTO is cleared without being handled!
return 0;
}

Only clear interrupts that we have seen and are handling so that DTO is
not missed.

Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (Rock PI 4B)
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/dw_mmc.c