From patchwork Mon Feb 3 11:15:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3568881 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD22EC02DE for ; Mon, 3 Feb 2014 11:15:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1180A201E9 for ; Mon, 3 Feb 2014 11:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FF6620131 for ; Mon, 3 Feb 2014 11:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750899AbaBCLPo (ORCPT ); Mon, 3 Feb 2014 06:15:44 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:49506 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750936AbaBCLPl (ORCPT ); Mon, 3 Feb 2014 06:15:41 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0F006DL3A4V0C0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Mon, 03 Feb 2014 20:15:40 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id A6.4B.09028.B5A7FE25; Mon, 03 Feb 2014 20:15:39 +0900 (KST) X-AuditID: cbfee68e-b7f566d000002344-dd-52ef7a5befc0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 3B.80.28157.B5A7FE25; Mon, 03 Feb 2014 20:15:39 +0900 (KST) Received: from [10.252.81.186] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0F001CY3A3AF40@mmp1.samsung.com>; Mon, 03 Feb 2014 20:15:39 +0900 (KST) Message-id: <52EF7A5B.3030902@samsung.com> Date: Mon, 03 Feb 2014 20:15:39 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Seungwon Jeon , Ulf Hansson Subject: [PATCH v3 8/8] mmc: dw_mmc: fix the checking whether card is present Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsWyRsSkRDe66n2Qwbb/phYTLm9ntDjyv5/R 4sP9i8wWx9eGO7B43Lm2h83jxquFTB59W1YxenzeJBfAEsVlk5Kak1mWWqRvl8CV8fV6D2vB Z86Kq/d3MTUwLuPoYuTkkBAwkfjRepMJwhaTuHBvPVsXIxeHkMBSRokbn9eywRT9eXqACSKx iFHi6vtp7BDOa0aJPW2nwKp4BbQkdj/ayw5iswioSsyZvZsZxGYT0JHY/u042ApRgTCJqSeu skDUC0r8mHwPyObgEBGwlmj+LQsSZhbIl5hw8wcjiC0s4Cvx53cLK0RcR2J/6zQ2CFteYvOa t8wgN0gITGeXOPOqkxFir4DEt8mHwGZKCMhKbDrADPGApMTBFTdYJjCKzEKyeRaSsbOQjF3A yLyKUTS1ILmgOCm9yEivODG3uDQvXS85P3cTIzA6Tv971reD8eYB60OMyUArJzJLiSbnA6Mr ryTe0NjMyMLUxNTYyNzSjDRhJXHeRQ+TgoQE0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUw+ndP n96/4qLXV5v49Vd/vxed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000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Broken card detection is assumed "the card is present". Non-removable card didn't call get_cd(). dw-mmc controller didn't check whether card is present or not. Because DW_MMC_CARD_PRESENT flag is set into dw_mci_get_cd(). If cd-pin is used, then dw_mci_get_cd() is called. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index ac2907d..0d6ab8f 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -910,6 +910,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) { struct dw_mci_slot *slot = mmc_priv(mmc); struct dw_mci *host = slot->host; + struct dw_mci_board *brd = host->pdata; WARN_ON(slot->mrq); @@ -920,7 +921,8 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq) */ spin_lock_bh(&host->lock); - if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) { + if (!(brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) && + !test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) { spin_unlock_bh(&host->lock); mrq->cmd->error = -ENOMEDIUM; mmc_request_done(mmc, mrq);