From patchwork Thu Nov 24 11:04:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9445211 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 71DC26077B 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 6EFF81FF1E for ; Thu, 24 Nov 2016 11:05:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63DB22715B; 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 4AB6E27CF5 for ; Thu, 24 Nov 2016 11:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940999AbcKXLFD (ORCPT ); Thu, 24 Nov 2016 06:05:03 -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 S937926AbcKXLFC (ORCPT ); Thu, 24 Nov 2016 06:05:02 -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-42-5836c94de0da Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 0B.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 3/3] mmc: dw_mmc: display the clock message only one time when card is polling Date: Thu, 24 Nov 2016 20:04:42 +0900 Message-id: <20161124110442.22058-3-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+NgFrrOLMWRmVeSWpSXmKPExsVy+t9jAV3fk2YRBg1N4hY3frWxWhz5389o cefJelaL42vDHVg87lzbw+bxd9Z+Fo++LasYPT5vkgtgiXKzyUhNTEktUkjNS85PycxLt1UK DXHTtVBSyEvMTbVVitD1DQlSUihLzCkF8owM0ICDc4B7sJK+XYJbxt3p85kLvvFVfHx0lLGB 8R93FyMnh4SAicT91rWMELaYxIV769lAbCGBpYwSrc/Uuhi5gOwfjBKfP09mBkmwCehIbP92 nAnEFhGQlfj55wJYA7NAnMSioz/ZQWxhgQSJv83LweIsAqoS0x7tZQGxeQWsJdYt+cEGsUxe 4sLVU2BxTgEbiSuLjkIttpboP3mUfQIj7wJGhlWMEqkFyQXFSem5Rnmp5XrFibnFpXnpesn5 uZsYwYH6THoH4+Fd7ocYBTgYlXh4O0zMIoRYE8uKK3MPMUpwMCuJ8HYcBQrxpiRWVqUW5ccX leakFh9iNAU6bCKzlGhyPjCK8kriDU3MTcyNDSzMLS1NjJTEeRtnPwsXEkhPLEnNTk0tSC2C 6WPi4JRqYGxr8PLsv50up/5HJuu4XvOyz9s1PFeeFHuw8/AEbs4X3cvMNDdXWq5Z9E/+8udg 3d8dD35by5i812TvW/zx54Rb4jIfl9zgEWjw/rZp74Lrmd951V89nxXKdUj43tLXi08LxNp7 OKmfNbyqL5f9+ljeKa0QTcUkr4CsiP6dX/QkHrZMtPB40qDEUpyRaKjFXFScCADco3TFagIA AA== 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 When card is polling (broken-cd), there is a spamming messge related to clock. After applied this patch, display the message only one time at boot time. It's enough to check which clock values is used. Also prevent to display the spamming message. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 13 ++++++++++++- drivers/mmc/host/dw_mmc.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index d508225..dd7e95d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1176,13 +1176,24 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) div = (host->bus_hz != clock) ? DIV_ROUND_UP(div, 2) : 0; - if (clock != slot->__clk_old || force_clkinit) + if ((clock != slot->__clk_old && + !test_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags)) || + force_clkinit) { dev_info(&slot->mmc->class_dev, "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ div = %d)\n", slot->id, host->bus_hz, clock, div ? ((host->bus_hz / div) >> 1) : host->bus_hz, div); + /* + * If card is polling, display the message only + * one time at boot time. + */ + if (slot->mmc->caps & MMC_CAP_NEEDS_POLL && + slot->mmc->f_min == clock) + set_bit(DW_MMC_CARD_NEEDS_POLL, &slot->flags); + } + /* disable clock */ mci_writel(host, CLKENA, 0); mci_writel(host, CLKSRC, 0); diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 4a6ae750..c594658 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -272,6 +272,7 @@ struct dw_mci_slot { #define DW_MMC_CARD_NEED_INIT 1 #define DW_MMC_CARD_NO_LOW_PWR 2 #define DW_MMC_CARD_NO_USE_HOLD 3 +#define DW_MMC_CARD_NEEDS_POLL 4 int id; int sdio_id; };