Skip to content

Commit 060522d

Browse files
cpackham-atlnzstorulf
authored andcommitted
mmc: sdhci-of-esdhc: Don't walk device-tree on every interrupt
Commit b214fe5 ("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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: b214fe5 ("mmc: sdhci-of-esdhc: add erratum eSDHC7 support") Cc: [email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent a395acf commit 060522d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/mmc/host/sdhci-of-esdhc.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct sdhci_esdhc {
8181
bool quirk_tuning_erratum_type2;
8282
bool quirk_ignore_data_inhibit;
8383
bool quirk_delay_before_data_reset;
84+
bool quirk_trans_complete_erratum;
8485
bool in_sw_tuning;
8586
unsigned int peripheral_clock;
8687
const struct esdhc_clk_fixup *clk_fixup;
@@ -1177,10 +1178,11 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host,
11771178

11781179
static u32 esdhc_irq(struct sdhci_host *host, u32 intmask)
11791180
{
1181+
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
1182+
struct sdhci_esdhc *esdhc = sdhci_pltfm_priv(pltfm_host);
11801183
u32 command;
11811184

1182-
if (of_find_compatible_node(NULL, NULL,
1183-
"fsl,p2020-esdhc")) {
1185+
if (esdhc->quirk_trans_complete_erratum) {
11841186
command = SDHCI_GET_CMD(sdhci_readw(host,
11851187
SDHCI_COMMAND));
11861188
if (command == MMC_WRITE_MULTIPLE_BLOCK &&
@@ -1334,8 +1336,10 @@ static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host)
13341336
esdhc->clk_fixup = match->data;
13351337
np = pdev->dev.of_node;
13361338

1337-
if (of_device_is_compatible(np, "fsl,p2020-esdhc"))
1339+
if (of_device_is_compatible(np, "fsl,p2020-esdhc")) {
13381340
esdhc->quirk_delay_before_data_reset = true;
1341+
esdhc->quirk_trans_complete_erratum = true;
1342+
}
13391343

13401344
clk = of_clk_get(np, 0);
13411345
if (!IS_ERR(clk)) {

0 commit comments

Comments
 (0)