mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
mmc: sdhci-of-at91: fix CALCR register being rewritten
When enabling calibration at reset, the CALCR register was completely
rewritten. This may cause certain bits being deleted unintentedly.
Fix by issuing a read-modify-write operation.
Fixes: 727d836a37
("mmc: sdhci-of-at91: add DT property to enable calibration on full reset")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Link: https://lore.kernel.org/r/20200527105659.142560-1-eugen.hristev@microchip.com
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
16e40e5b1e
commit
dbdea70f71
@ -121,9 +121,12 @@ static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
|
||||
|| mmc_gpio_get_cd(host->mmc) >= 0)
|
||||
sdhci_at91_set_force_card_detect(host);
|
||||
|
||||
if (priv->cal_always_on && (mask & SDHCI_RESET_ALL))
|
||||
sdhci_writel(host, SDMMC_CALCR_ALWYSON | SDMMC_CALCR_EN,
|
||||
if (priv->cal_always_on && (mask & SDHCI_RESET_ALL)) {
|
||||
u32 calcr = sdhci_readl(host, SDMMC_CALCR);
|
||||
|
||||
sdhci_writel(host, calcr | SDMMC_CALCR_ALWYSON | SDMMC_CALCR_EN,
|
||||
SDMMC_CALCR);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
|
||||
|
Loading…
Reference in New Issue
Block a user