mmc: sdhci-cadence: implement multi-block read gap tuning
authorBenoît Monin <benoit.monin@bootlin.com>
Mon, 18 Aug 2025 14:02:51 +0000 (16:02 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 19 Aug 2025 12:34:15 +0000 (14:34 +0200)
commit60613a8b9b8187d789750423132ad7664ca448c9
tree66a2ca78b18c7b4ca72f8f00f22d134046d3e44c
parent99e6cc80d5ce5af5781f84d20e4f3478d66ee8ee
mmc: sdhci-cadence: implement multi-block read gap tuning

The controller suspends the clock between blocks when reading from the
MMC as part of its flow-control, called read block gap. At higher clock
speed and with IO delay between the controller and the MMC, this clock
pause can happen too late, during the read of the next block and
trigger a read error.

To prevent this, the delay can be programmed for each mode via the pair
of registers HRS37/38. This delay is obtained during tuning, by trying
a multi-block read and increasing the delay until the read succeeds.

For now, the tuning is only done in HS200, as the read error has only
been observed at that speed.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
Link: https://lore.kernel.org/r/20250818-mobileye-emmc-for-upstream-4-v4-6-34ecb3995e96@bootlin.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-cadence.c