Skip to content

Commit 0dd8316

Browse files
Georgii KruglovUlf Hansson
authored andcommitted
mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
If spec_reg is equal to 'SDHCI_PRESENT_STATE', esdhc_readl_fixup() fixes up register value and returns it immediately. As a result, the further block (spec_reg == SDHCI_PRESENT_STATE) &&(esdhc->quirk_ignore_data_inhibit == true), is never executed. The patch merges the second block into the first one. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1f1929f ("mmc: sdhci-of-esdhc: add quirk to ignore command inhibit for data") Signed-off-by: Georgii Kruglov <georgy.kruglov@yandex.ru> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20230321203715.3975-1-georgy.kruglov@yandex.ru Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent f6ca8f9 commit 0dd8316

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,
133133
return ret;
134134
}
135135
}
136+
136137
/*
137138
* The DAT[3:0] line signal levels and the CMD line signal level are
138139
* not compatible with standard SDHC register. The line signal levels
@@ -144,6 +145,16 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,
144145
ret = value & 0x000fffff;
145146
ret |= (value >> 4) & SDHCI_DATA_LVL_MASK;
146147
ret |= (value << 1) & SDHCI_CMD_LVL;
148+
149+
/*
150+
* Some controllers have unreliable Data Line Active
151+
* bit for commands with busy signal. This affects
152+
* Command Inhibit (data) bit. Just ignore it since
153+
* MMC core driver has already polled card status
154+
* with CMD13 after any command with busy siganl.
155+
*/
156+
if (esdhc->quirk_ignore_data_inhibit)
157+
ret &= ~SDHCI_DATA_INHIBIT;
147158
return ret;
148159
}
149160

@@ -158,19 +169,6 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,
158169
return ret;
159170
}
160171

161-
/*
162-
* Some controllers have unreliable Data Line Active
163-
* bit for commands with busy signal. This affects
164-
* Command Inhibit (data) bit. Just ignore it since
165-
* MMC core driver has already polled card status
166-
* with CMD13 after any command with busy siganl.
167-
*/
168-
if ((spec_reg == SDHCI_PRESENT_STATE) &&
169-
(esdhc->quirk_ignore_data_inhibit == true)) {
170-
ret = value & ~SDHCI_DATA_INHIBIT;
171-
return ret;
172-
}
173-
174172
ret = value;
175173
return ret;
176174
}

0 commit comments

Comments
 (0)