Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-of-esdhc: Don't walk device-tree on every interrupt

Commit b214fe592ab7 ("mmc: sdhci-of-esdhc: add erratum eSDHC7 support")
added code to check for a specific compatible string in the device-tree
on every esdhc interrupat. Instead of doing this record the quirk in
struct sdhci_esdhc and lookup the struct in esdhc_irq.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20200903012029.25673-1-chris.packham@alliedtelesis.co.nz
Fixes: b214fe592ab7 ("mmc: sdhci-of-esdhc: add erratum eSDHC7 support")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Chris Packham and committed by
Ulf Hansson
060522d8 a395acf0

+7 -3
+7 -3
drivers/mmc/host/sdhci-of-esdhc.c
··· 81 81 bool quirk_tuning_erratum_type2; 82 82 bool quirk_ignore_data_inhibit; 83 83 bool quirk_delay_before_data_reset; 84 + bool quirk_trans_complete_erratum; 84 85 bool in_sw_tuning; 85 86 unsigned int peripheral_clock; 86 87 const struct esdhc_clk_fixup *clk_fixup; ··· 1178 1177 1179 1178 static u32 esdhc_irq(struct sdhci_host *host, u32 intmask) 1180 1179 { 1180 + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 1181 + struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host); 1181 1182 u32 command; 1182 1183 1183 - if (of_find_compatible_node(NULL, NULL, 1184 - "fsl,p2020-esdhc")) { 1184 + if (esdhc->quirk_trans_complete_erratum) { 1185 1185 command = SDHCI_GET_CMD(sdhci_readw(host, 1186 1186 SDHCI_COMMAND)); 1187 1187 if (command == MMC_WRITE_MULTIPLE_BLOCK && ··· 1336 1334 esdhc->clk_fixup = match->data; 1337 1335 np = pdev->dev.of_node; 1338 1336 1339 - if (of_device_is_compatible(np, "fsl,p2020-esdhc")) 1337 + if (of_device_is_compatible(np, "fsl,p2020-esdhc")) { 1340 1338 esdhc->quirk_delay_before_data_reset = true; 1339 + esdhc->quirk_trans_complete_erratum = true; 1340 + } 1341 1341 1342 1342 clk = of_clk_get(np, 0); 1343 1343 if (!IS_ERR(clk)) {