From patchwork Thu Apr 18 09:02:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 16188 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A80623974 for ; Thu, 18 Apr 2013 09:03:10 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l14sf3656942yen.6 for ; Thu, 18 Apr 2013 02:02:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf: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 :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=QbpO4+WMT0n2ELKlRl7yfOJsT3LQmcVS1dHD7J7hess=; b=PyqbVvzFgB31XBE8U1JBWfzlNwkIfmZBjteAV6rX4oGNT5zcunDbhAERQmceO60cdg Bl6Zt3fHAD0aDg5hBZ68Ux67UaOmO0X9EuhbNsvdStDffQNLeHxuzgYXtXKlbsM9SEWd M6aQ2T6l00Xzj3A2qV3D3fEUjaS1i9sbx0WDTIGHIHCHVBcg7FsXZSwjWdxQjkwfveuY lU3r9vUdCgyYr5bctvpZHJ6RBPpkMX/G6BHrA6+zm0szgt0QOuGS8sFheYbQ5UpHEEo1 o0TwV5ZTmZQSO75rrE8H9iH0kmA/Zx2CTKzUujNaOihOle1SdNRi0IFHnzlx3vxz2wwo gZ9Q== X-Received: by 10.58.29.136 with SMTP id k8mr3983327veh.8.1366275753183; Thu, 18 Apr 2013 02:02:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.236 with SMTP id 12ls1413537qeh.89.gmail; Thu, 18 Apr 2013 02:02:33 -0700 (PDT) X-Received: by 10.220.19.8 with SMTP id y8mr7614488vca.31.1366275753040; Thu, 18 Apr 2013 02:02:33 -0700 (PDT) Received: from mail-vb0-x235.google.com (mail-vb0-x235.google.com [2607:f8b0:400c:c02::235]) by mx.google.com with ESMTPS id k19si6129118vcu.60.2013.04.18.02.02.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 02:02:32 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::235; Received: by mail-vb0-f53.google.com with SMTP id i3so2065154vbh.26 for ; Thu, 18 Apr 2013 02:02:32 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr6402360vdu.8.1366275752823; Thu, 18 Apr 2013 02:02:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp112951veb; Thu, 18 Apr 2013 02:02:31 -0700 (PDT) X-Received: by 10.194.88.138 with SMTP id bg10mr17047464wjb.13.1366275751464; Thu, 18 Apr 2013 02:02:31 -0700 (PDT) Received: from eu1sys200aog108.obsmtp.com (eu1sys200aog108.obsmtp.com [207.126.144.125]) by mx.google.com with SMTP id u3si14467820eeg.89.2013.04.18.02.02.28 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Apr 2013 02:02:31 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.125 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.125; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP ID DSNKUW+2o2cIOlI2RdVyaR1MOuvUNnog3NeL@postini.com; Thu, 18 Apr 2013 09:02:31 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 B2A29190; Thu, 18 Apr 2013 09:02:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2D9394CC4; Thu, 18 Apr 2013 09:02:08 +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 relay2.stm.gmessaging.net (Postfix) with ESMTPS id D4EEAA8074; Thu, 18 Apr 2013 11:02:07 +0200 (CEST) Received: from steludxu1397.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Thu, 18 Apr 2013 11:02:11 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [RESEND PATCH] mmc: core: Re-use code for MMC_CAP2_DETECT_ON_ERR in polling mode Date: Thu, 18 Apr 2013 11:02:07 +0200 Message-ID: <1366275727-6380-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl7GKa9FqpZkYlwSJSE12M63EA4AIqIfARwthV1qStJQ0SmnjSMJITLZ0TglDw2d5CC37D/ X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Kevin Liu --- 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 */