Datasheet specifies that at the end of calibration the SDMMC_CALCR_EN
bit will be cleared. No commands should be send before calibration is
done.
Fixes: dbdea70f71d67 ("mmc: sdhci-of-at91: fix CALCR register being rewritten")
Fixes: 727d836a375ad ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
Signed-off-by: Claudiu Beznea <redacted>
---
drivers/mmc/host/sdhci-of-at91.c | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Nicolas Ferre <nicolas.ferre@microchip.com> Date: 2021-09-15 12:04:17
On 15/09/2021 at 12:28, Claudiu Beznea wrote:
Datasheet specifies that at the end of calibration the SDMMC_CALCR_EN
bit will be cleared. No commands should be send before calibration is
done.
Fixes: dbdea70f71d67 ("mmc: sdhci-of-at91: fix CALCR register being rewritten")
Fixes: 727d836a375ad ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
Signed-off-by: Claudiu Beznea <redacted>
Indeed, needed. Thanks Claudiu,
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Best regards,
Nicolas
From: Adrian Hunter <adrian.hunter@intel.com> Date: 2021-09-23 09:02:32
On 15/09/21 1:28 pm, Claudiu Beznea wrote:
quoted hunk
Datasheet specifies that at the end of calibration the SDMMC_CALCR_EN
bit will be cleared. No commands should be send before calibration is
done.
Fixes: dbdea70f71d67 ("mmc: sdhci-of-at91: fix CALCR register being rewritten")
Fixes: 727d836a375ad ("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
Signed-off-by: Claudiu Beznea <redacted>
---
drivers/mmc/host/sdhci-of-at91.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Please use a polling macro (include <linux/iopoll.h>)
i.e.
if (read_poll_timeout(sdhci_readl, tmp, !(tmp & SDMMC_CALCR_EN),
10, 20000, false, host, SDMMC_CALCR))
dev_err(mmc_dev(host->mmc), "Failed to calibrate\n");