From patchwork Wed Aug 31 05:51:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9306321 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 C742F60487 for ; Wed, 31 Aug 2016 05:51:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7AA728D70 for ; Wed, 31 Aug 2016 05:51:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9C6428E19; Wed, 31 Aug 2016 05:51:33 +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 00A3228D70 for ; Wed, 31 Aug 2016 05:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751644AbcHaFvc (ORCPT ); Wed, 31 Aug 2016 01:51:32 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:59996 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbcHaFvb (ORCPT ); Wed, 31 Aug 2016 01:51:31 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OCR00XHOEXTSP00@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Wed, 31 Aug 2016 14:51:29 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.112]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 3D.A8.31386.16076C75; Wed, 31 Aug 2016 14:51:29 +0900 (KST) X-AuditID: cbfee68d-f79286d000007a9a-b3-57c67061b650 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 9C.5B.05218.06076C75; Wed, 31 Aug 2016 14:51:29 +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 <0OCR008BKEXS3G30@mmp1.samsung.com>; Wed, 31 Aug 2016 14:51:28 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, guodong.xu@linaro.org, kid.jin@hisilicon.com, Jaehoon Chung Subject: [RFC] mmc: dw_mmc: skip the execute_tuning after checking timiing Date: Wed, 31 Aug 2016 14:51:27 +0900 Message-id: <1472622687-16389-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsWyRsSkQDex4Fi4weObPBb/7/SwWtz41cZq 8efyAkaLI//7GS3uPFnPanF8bbgDm8fjuRvZPe5c28Pm8XfWfhaPvi2rGD0+b5ILYI3isklJ zcksSy3St0vgyjjWv4i54A5nxb22WSwNjD/Yuxg5OSQETCRePZrJCGGLSVy4t56ti5GLQ0hg BaPE8ckrmGCKZt78ygyRWMoo0fvmJJTzg1Fi4aHNYKPYBHQktn87DtYhIiAr8fPPBbBRzAI9 jBL3F11nBkkIC3hJXH3XDFbEIqAqcaurByzOK+Am0Xy1mQVinZzEyWOTWUGaJQS+s0kcebqf DaJBQOLb5ENARRxACVmJTQeYIeolJQ6uuMEygVFwASPDKkbR1ILkguKk9CJDveLE3OLSvHS9 5PzcTYzAcD3971nvDsbbB6wPMQpwMCrx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OmNh6q6JLH8C7oqvThZ5pfRmotz8TzWfJutoXhC2 WnfeTfHzoZIZSizFGYmGWsxFxYkAH582XJ8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@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-Virus-Scanned: ClamAV using ClamSMTP HS400 mode doesn't need to do execute_tuning, because it's already tuned in HS200 mode. And Tuning command is optional for UHS50 mode. In future, the general execute_tuning sequence can be included in this function. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 22dacae..6571924 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1568,10 +1568,25 @@ static int dw_mci_execute_tuning(struct mmc_host *mmc, u32 opcode) struct dw_mci_slot *slot = mmc_priv(mmc); struct dw_mci *host = slot->host; const struct dw_mci_drv_data *drv_data = host->drv_data; - int err = -EINVAL; + int err = 0; + + switch (host->timing) { + case MMC_TIMING_MMC_HS400: + err = -EINVAL; + goto out; + case MMC_TIMING_MMC_HS200: + case MMC_TIMING_UHS_SDR104: + case MMC_TIMING_UHS_DDR50: + break; + case MMC_TIMING_UHS_SDR50: + /* Fall through */ + default: + goto out; + } if (drv_data && drv_data->execute_tuning) err = drv_data->execute_tuning(slot, opcode); +out: return err; }