Skip to content

Commit b689167

Browse files
Ulf Hanssoncjb
authored andcommitted
mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode
Previously the MMC_CAP2_DETECT_ON_ERR was invented for detecting slow card removal. In was never a realy good solution and a proper fix has been merged using gpio debouncing instead. We remove this cap in this patch. Although when using polling card detect mode, the code invented for MMC_CAP2_DETECT_ON_ERR is re-used to complete card removal in an earlier phase. There are no need waiting for the polling timeout to elapse in this case. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Liu <kliu5@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
1 parent 810e08e commit b689167

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/mmc/core/core.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,14 +2325,13 @@ int mmc_detect_card_removed(struct mmc_host *host)
23252325
* The card will be considered unchanged unless we have been asked to
23262326
* detect a change or host requires polling to provide card detection.
23272327
*/
2328-
if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL) &&
2329-
!(host->caps2 & MMC_CAP2_DETECT_ON_ERR))
2328+
if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL))
23302329
return ret;
23312330

23322331
host->detect_change = 0;
23332332
if (!ret) {
23342333
ret = _mmc_detect_card_removed(host);
2335-
if (ret && (host->caps2 & MMC_CAP2_DETECT_ON_ERR)) {
2334+
if (ret && (host->caps & MMC_CAP_NEEDS_POLL)) {
23362335
/*
23372336
* Schedule a detect work as soon as possible to let a
23382337
* rescan handle the card removal.

‎include/linux/mmc/host.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ struct mmc_host {
272272
#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
273273
MMC_CAP2_HS200_1_2V_SDR)
274274
#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
275-
#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
276275
#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
277276
#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
278277
#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */

0 commit comments

Comments
 (0)