From patchwork Wed Mar 27 16:11:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 15704 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E55FF23E39 for ; Wed, 27 Mar 2013 16:12:07 +0000 (UTC) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by fiordland.canonical.com (Postfix) with ESMTP id 7ABDAA182B4 for ; Wed, 27 Mar 2013 16:12:07 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id lf10so6690378vcb.1 for ; Wed, 27 Mar 2013 09:12:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=CNkU4w4+1E74beBE6dYp6gjtqm/9Ca0lEKlHw9YaEzY=; b=Kn9isMx06GKY6f2AFUuh5S/rpPcGDaz6/WlxYqTCoOwu5Qs+ENaoxxkHIxKpW7Xf71 NUb0komMs0UGMKjXoeNmfXoul8dVlcntaR3Y/uf4x6QZ3fPWdue72vXEqXdFl6pHcuLW s6LPcd6AsXhNP5KllvmQ227JZE9cJ38j2Oz4lPY0CmyoFzfjt+bBr2G5fujMYvWhehjB jazNSqNswg03ahovYuz4SKKDzzFksnhWjj6L2srMAXAMBme9P9lqca143NSRAPdPX/e5 I0yI+ldDHlKl4pmzQvKbH8va557C9CK3T1BcMCnMjImD+P4+RMZA52FCASr8Ii9j207d 7zZw== X-Received: by 10.58.224.101 with SMTP id rb5mr24116088vec.17.1364400726976; Wed, 27 Mar 2013 09:12:06 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp122729ved; Wed, 27 Mar 2013 09:12:06 -0700 (PDT) X-Received: by 10.14.179.201 with SMTP id h49mr8926932eem.26.1364400725329; Wed, 27 Mar 2013 09:12:05 -0700 (PDT) Received: from eu1sys200aog123.obsmtp.com (eu1sys200aog123.obsmtp.com [207.126.144.155]) by mx.google.com with SMTP id h2si8042842eeg.57.2013.03.27.09.12.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 09:12:05 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.155 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.155; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.155 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob123.postini.com ([207.126.147.11]) with SMTP ID DSNKUVMaUFGO46ZaKoZJ093k7PFn2NAXRe+b@postini.com; Wed, 27 Mar 2013 16:12:04 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A9687153; Wed, 27 Mar 2013 16:11:45 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EDAD0542E; Wed, 27 Mar 2013 16:11:44 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id B606724C2AB; Wed, 27 Mar 2013 17:11:36 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Wed, 27 Mar 2013 17:11:44 +0100 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH] mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode Date: Wed, 27 Mar 2013 17:11:40 +0100 Message-ID: <1364400700-13161-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkYoUTdsruzx+fxLfy+5ptiZ3dVRwLP30ONawJIyilRnubpeF/bGF1HXv39B7dkJpa/oVOL From: Ulf Hansson 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 --- drivers/mmc/core/core.c | 5 ++--- include/linux/mmc/host.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index ad7decc..59ae194 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2325,14 +2325,13 @@ int mmc_detect_card_removed(struct mmc_host *host) * The card will be considered unchanged unless we have been asked to * detect a change or host requires polling to provide card detection. */ - if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL) && - !(host->caps2 & MMC_CAP2_DETECT_ON_ERR)) + if (!host->detect_change && !(host->caps & MMC_CAP_NEEDS_POLL)) return ret; host->detect_change = 0; if (!ret) { ret = _mmc_detect_card_removed(host); - if (ret && (host->caps2 & MMC_CAP2_DETECT_ON_ERR)) { + if (ret && (host->caps & MMC_CAP_NEEDS_POLL)) { /* * Schedule a detect work as soon as possible to let a * rescan handle the card removal. diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 17d7148..301892a 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -272,7 +272,6 @@ struct mmc_host { #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ MMC_CAP2_HS200_1_2V_SDR) #define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ -#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */ #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */