From patchwork Tue May 5 08:54:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 48019 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1892C2121F for ; Tue, 5 May 2015 08:55:11 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf48588826lbc.1 for ; Tue, 05 May 2015 01:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=v6JUVXDIuX8c0m9OeOiu9lX7iXCeUNN5vjyztmjDFxw=; b=UK/YZdR/UKIL08SS73Zm68cCzl+w2dJolXYu9nSerSwqJbS3eysdalIgsRvm8+ca9F UCGqbFgKAB0lk+P2KbMUCc3eYkD56T2EqpDQIcG1WzjuymdR+vdJSGRD+7uBtwVppi5X XrPnT5q8k9oR7CbixPHv0kxfjxTs/WQnuicFtQBnAGN8UW2BJPVOX7TUaRUjGmGwo3EL Tb4KLocTqJ1XtC+TDLuRMISf8T7x52IiDgZBkhv/MLdNCcaTsnhCHyHgeMOqp4i1kdVk XL54pPXipk2UcEPjDNwTCraF2icrcUrjzwPcAcpql+MMi12PebXliVtrf4YMnt4lHaB1 ERQA== X-Gm-Message-State: ALoCoQmigwlGqAWrrhjjRmvkYhtUR4ByAFusmefAako2bkGdi+flLwvARxIjPyp6nVMo1M+KeN3x X-Received: by 10.112.142.170 with SMTP id rx10mr21420853lbb.12.1430816109987; Tue, 05 May 2015 01:55:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.99 with SMTP id c3ls786418laf.96.gmail; Tue, 05 May 2015 01:55:09 -0700 (PDT) X-Received: by 10.152.88.1 with SMTP id bc1mr23180751lab.79.1430816109844; Tue, 05 May 2015 01:55:09 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id e4si11876924lab.140.2015.05.05.01.55.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2015 01:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagv1 with SMTP id v1so122075725lag.3 for ; Tue, 05 May 2015 01:55:09 -0700 (PDT) X-Received: by 10.112.125.138 with SMTP id mq10mr1881516lbb.35.1430816109671; Tue, 05 May 2015 01:55:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2114458lbt; Tue, 5 May 2015 01:55:08 -0700 (PDT) X-Received: by 10.67.15.102 with SMTP id fn6mr50642478pad.120.1430816108023; Tue, 05 May 2015 01:55:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id es10si23362910pac.102.2015.05.05.01.55.07; Tue, 05 May 2015 01:55:08 -0700 (PDT) Received-SPF: none (google.com: linux-mmc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031033AbbEEIzG (ORCPT + 3 others); Tue, 5 May 2015 04:55:06 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:35832 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031013AbbEEIzD (ORCPT ); Tue, 5 May 2015 04:55:03 -0400 Received: by pdbqd1 with SMTP id qd1so189244759pdb.2 for ; Tue, 05 May 2015 01:55:03 -0700 (PDT) X-Received: by 10.70.44.199 with SMTP id g7mr49395043pdm.27.1430816102980; Tue, 05 May 2015 01:55:02 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by mx.google.com with ESMTPSA id p1sm15206136pdl.60.2015.05.05.01.54.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 May 2015 01:55:01 -0700 (PDT) From: Zhangfei Gao To: Jaehoon Chung Cc: linux-mmc@vger.kernel.org, Zhangfei Gao Subject: [PATCH] mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE Date: Tue, 5 May 2015 16:54:49 +0800 Message-Id: <1430816089-8857-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When non-removable is used for emmc, MMC_CAP_NONREMOVABLE should also be checked, otherwise detection fail since present=0 Signed-off-by: Zhangfei Gao --- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 488a8af..5d327e4 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1308,7 +1308,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc) int gpio_cd = mmc_gpio_get_cd(mmc); /* Use platform get_cd function, else try onboard card detect */ - if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) + if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) || + (mmc->caps & MMC_CAP_NONREMOVABLE)) present = 1; else if (!IS_ERR_VALUE(gpio_cd)) present = gpio_cd;