From patchwork Thu Nov 24 11:04:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9445209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E7F160778 for ; Thu, 24 Nov 2016 11:05:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E6481FF1E for ; Thu, 24 Nov 2016 11:05:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 432D527D7F; Thu, 24 Nov 2016 11:05:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29DBD2715B for ; Thu, 24 Nov 2016 11:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938997AbcKXLFC (ORCPT ); Thu, 24 Nov 2016 06:05:02 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:59475 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940999AbcKXLFB (ORCPT ); Thu, 24 Nov 2016 06:05:01 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OH5034GM83XHCD0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Thu, 24 Nov 2016 20:04:45 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-41-5836c94d8c93 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id BA.4D.16530.D49C6385; Thu, 24 Nov 2016 20:04:45 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OH500DQD83W0G60@mmp1.samsung.com>; Thu, 24 Nov 2016 20:04:45 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH 2/3] mmc: dw_mmc: add the debug message for polling and non-removable Date: Thu, 24 Nov 2016 20:04:41 +0900 Message-id: <20161124110442.22058-2-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161124110442.22058-1-jh80.chung@samsung.com> References: <20161124110442.22058-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsVy+t9jAV3fk2YRBu3X+S1u/GpjtTjyv5/R 4s6T9awWx9eGO7B43Lm2h83j76z9LB59W1YxenzeJBfAEuVmk5GamJJapJCal5yfkpmXbqsU GuKma6GkkJeYm2qrFKHrGxKkpFCWmFMK5BkZoAEH5wD3YCV9uwS3jJetXawFs7gq1j+dxd7A uIiji5GTQ0LAROLBjG/sELaYxIV769m6GLk4hASWMkr8ePmcFcL5wSjx+fNkZpAqNgEdie3f jjOB2CICshI//1xgA7GZBeIkFh39CTSJg0NYIFxiyhVZEJNFQFXi9PxUkApeAWuJNxd/M0Hs kpe4cPUUC4jNKWAjcWXRUbApQkA1/SePsk9g5F3AyLCKUSK1ILmgOCk91ygvtVyvODG3uDQv XS85P3cTIzhMn0nvYDy8y/0QowAHoxIPb4eJWYQQa2JZcWXuIUYJDmYlEd6Oo0Ah3pTEyqrU ovz4otKc1OJDjKZAd01klhJNzgfGUF5JvKGJuYm5sYGFuaWliZGSOG/j7GfhQgLpiSWp2amp BalFMH1MHJxSDYwcok+tktl+GtmW/NQ677wt6UOMht/Uy4Jpu6p2Zf4L+XaAOVk4peLaxR25 l84r6O6cdOzBvd4ViTp3ap95aC2WqKpccsPp3frTjG7O3Wuy1XfOcLts1ZK8P2A93565UnOO eN/wWiZzc6qnY8Idze81D54/PTa1beWRFJclKTp/jmn/MAueHRKoxFKckWioxVxUnAgA7Xh7 WmkCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If card is polling or non-removable, display the more exact message. It's helpful to debug which detecting scheme is using. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index c6cc618..d508225 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1525,9 +1525,23 @@ 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 ((mmc->caps & MMC_CAP_NEEDS_POLL) || !mmc_card_is_removable(mmc)) + if (((mmc->caps & MMC_CAP_NEEDS_POLL) + || !mmc_card_is_removable(mmc))) { present = 1; - else if (gpio_cd >= 0) + + if (!test_bit(DW_MMC_CARD_PRESENT, &slot->flags)) { + if (mmc->caps & MMC_CAP_NEEDS_POLL) { + dev_info(&mmc->class_dev, + "card is polling.\n"); + } else { + dev_info(&mmc->class_dev, + "card is non-removable.\n"); + } + set_bit(DW_MMC_CARD_PRESENT, &slot->flags); + } + + return present; + } else if (gpio_cd >= 0) present = gpio_cd; else present = (mci_readl(slot->host, CDETECT) & (1 << slot->id))