From patchwork Fri Apr 27 11:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134585 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp617396lji; Fri, 27 Apr 2018 04:47:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhAzjuSghLZsFgG3iz2kgys8CrRHmA13SkKKhG0COkoSqsYGH9qgWaI+7EKYh3rR3LDJ1h X-Received: by 2002:a63:aa48:: with SMTP id x8-v6mr1823713pgo.398.1524829667867; Fri, 27 Apr 2018 04:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829667; cv=none; d=google.com; s=arc-20160816; b=H5KN2tnqmbivmA8A/0JNDLUGt/+7Vnal7K9tADrc6nzmz8VChJ0qJsrF2ADFd3F8LU JFgSm+mUI5ZJ4y9cZlCQzxefv6RJqlSSmXOUT6wrwiv27v5sf/7LGAFYxhIHRVuGZ9xL xiILC5bTIY5s3mJAUiyPEJtYRJH4okQUtzReOt2Ax5K+FURyYvabQPw9uWAbka+oBLl2 0k7vTtwl66RxApon5KLnxqYm8bGAvJLNWT2HTNONUhHiCQDzmvoKKI5DxN4QD4ay/H9c cHI2MoP+H4AzTnADFR+zxDZxJ+J7GrtqqIo1yWz9eV2vndJoQMjy16Y7YBvSqnXzEJPP 47gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2A7ou+1UB+myXxHwZttd6wAPnmynOeErbfDx5LHPDtc=; b=DmHmCONIwur2VQmaVi2k+FpvMtTsAbnu67/aiJ8oRZOdRu6pyfxG4khVO6cRUqHQ1K WTdXMOKZ8X4Nb6FAdBHQzlMNGfVe7cuQU2a2GFGHD3ATFNWhyMsJmWhmxLQqXUNEFCnl Y/1E8dwd5yeam0oSgRCUed2MDRGjJy81vTJTG8t6pK5HJUStSQAVUafs0Y3u2jwsYr7m gUngi/cwZshpLTje0iphuhpfDdDBpcMqijzrhp2ykjfVP/JYtxaLda+eIw9iyExdSD7/ hWzB7CNa7oQZqGuwtr/I866Sq/lC+a5NvOyVR7N4BwY3sEpftYDpLkErLd6PHI90F0vo FeEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ekK/93UG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si1172813pfm.220.2018.04.27.04.47.47; Fri, 27 Apr 2018 04:47:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ekK/93UG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758032AbeD0Lrm (ORCPT + 29 others); Fri, 27 Apr 2018 07:47:42 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:48799 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758002AbeD0Lrk (ORCPT ); Fri, 27 Apr 2018 07:47:40 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBlYJR026190; Fri, 27 Apr 2018 06:47:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829654; bh=aqtSbKOuhGWM0s8kprWd7kiEWQnzWW2Yh72k68Q9m8w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ekK/93UGBkZTqcvK7Vq4YeI5wvJSUDZ4utSAKyEXRc2/K68FKDnjpY1XEitnsvWs/ PEsYuO7qi2eQLAaHfali/UCuBbiIkOR6CrUlhD99nazlKUXeWr4MjqYd2Yp8Ze+z/P tOuE7kSEcTNqzVRdR6PYcHXE3gryb3XmHyQFaGpg= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlYqg014633; Fri, 27 Apr 2018 06:47:34 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:47:34 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:47:33 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSF014207; Fri, 27 Apr 2018 06:47:30 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 01/14] mmc: sdhci-omap: Fix when capabilities are obtained from SDHCI_CAPABILITIES reg Date: Fri, 27 Apr 2018 17:17:10 +0530 Message-ID: <20180427114723.2687-2-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sdhci_omap_config_iodelay_pinctrl_state() requires caps and caps2 to be initialized (speed mode capabilities like UHS/HS200) before it is invoked. While mmc_of_parse() initializes caps/caps2 if capabilities is populated in device tree, it will remain uninitialized for capabilities obtained from SDHCI_CAPABILITIES register. Fix sdhci_omap_config_iodelay_pinctrl_state() to be used even while getting the capabilities from SDHCI_CAPABILITIES register by invoking sdhci_setup_host() before sdhci_omap_config_iodelay_pinctrl_state(). Signed-off-by: Kishon Vijay Abraham I Acked-by: Tony Lindgren Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-omap.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 1456abd5eeb9..e7e43f2ae224 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -916,10 +916,6 @@ static int sdhci_omap_probe(struct platform_device *pdev) goto err_put_sync; } - ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host); - if (ret) - goto err_put_sync; - host->mmc_host_ops.get_ro = mmc_gpio_get_ro; host->mmc_host_ops.start_signal_voltage_switch = sdhci_omap_start_signal_voltage_switch; @@ -930,12 +926,23 @@ static int sdhci_omap_probe(struct platform_device *pdev) sdhci_read_caps(host); host->caps |= SDHCI_CAN_DO_ADMA2; - ret = sdhci_add_host(host); + ret = sdhci_setup_host(host); if (ret) goto err_put_sync; + ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host); + if (ret) + goto err_cleanup_host; + + ret = __sdhci_add_host(host); + if (ret) + goto err_cleanup_host; + return 0; +err_cleanup_host: + sdhci_cleanup_host(host); + err_put_sync: pm_runtime_put_sync(dev); From patchwork Fri Apr 27 11:47:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134587 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp617516lji; Fri, 27 Apr 2018 04:47:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoNwEZDT2+hHO5qV2B/PIdPmTX6tUVTXm08nQbI7CtjghHgSZS8jtB6mgGwfkTzuuQ0R4it X-Received: by 2002:a17:902:bb8c:: with SMTP id m12-v6mr2057890pls.53.1524829676455; Fri, 27 Apr 2018 04:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829676; cv=none; d=google.com; s=arc-20160816; b=bTWdvLhkyJ7lR+wma45WOyWds0UXZIeSb9s1fnqSpEsiBYDzLMC/amprcS4KivqKLW 0TjxhhhMcx0nB/tYj6mF6ujQNHW6M9Qi9hS5Y6EzJFGRwtA/m7G7E3xv6H5v2T7Qcjv8 RDk7is43igHIhiqvw45LQDmRb/Qf/gR1qheYNQumfD5H2cHXdLQM7AA+Tr7YqLGTyp7Z ROCVTips/qYRflM297S6VnkCLJO41NjWpEINLfJELLAe1pLMjt1sg6vp/+g1OPggnoHy mNED3qcd+UBn+RVptQ314+D+TneS3j1jh/wgAy/ARBI6BT2UJPIuEbuOJ247piwuOF6c IWbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=bqxwJWWuWz/giNCsr1sSB9PzjW8jQHQUgSowwOzPBAI=; b=KngRIaRrvcE6Nlj0D8I5uHufCPHBHV+fGzR5IhyP+xqmqQ3AljPq+HhIsKqD3ckoW6 cDVKOqGK5j36CnocFAdXBCPd5/oOfm6Ed2I/JSgyaLajlrE4Xxt90PA/n4acgtJXIvJA VoAfINZpS560f6dc43ljec3A/dD2gWYT3b34C6mBtQTWmo/qLTTFzLXnaoExTFH5gqZd lw+ea8LNmxWMpC7psjowuChMlL3Dh0jGLg3YH8R2Dpf0hUEZ6I3GliyzewKIaz89s71M EYmAELKBk8/DADi8vPCHYSolxm8SplgQv709qYve9vldr69TBBPHHeiLgJHsaeo3h0oX QjkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fEyz6DSG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j125-v6si1095017pgc.553.2018.04.27.04.47.56; Fri, 27 Apr 2018 04:47:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fEyz6DSG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758061AbeD0Lrv (ORCPT + 29 others); Fri, 27 Apr 2018 07:47:51 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:61722 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757940AbeD0Lrp (ORCPT ); Fri, 27 Apr 2018 07:47:45 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBlbB8002324; Fri, 27 Apr 2018 06:47:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829657; bh=CI5aJrCan3ZckMScUoQbiyf7tjqKfbfr0JQQiayx2A0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fEyz6DSGq2CqM48UMzjhQkh6mbPPKnJ15Sz83YL0ZB02e5KOJdndND5oQP943vEfj j4F+6XEnoyc7U1Lr1EqzqFo9SaaublAcAJ2Btpuoolblbnm65idLviG0ABkkwtO6Q6 Hkmm/HNmcdx2ZF+mtIO6T32nCfFmgmWrUrEYukAM= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlbwm020638; Fri, 27 Apr 2018 06:47:37 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:47:36 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:47:36 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSG014207; Fri, 27 Apr 2018 06:47:34 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 02/14] mmc: sdhci-omap: Remove setting ADMA capability in driver Date: Fri, 27 Apr 2018 17:17:11 +0530 Message-ID: <20180427114723.2687-3-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sdhci can directly get ADMA capability from MMCHS_CAPA register. Remove explicitly setting ADMA here as some instances might not have ADMA enabled. (sdhci_read_caps() is also removed from here since sdhci_setup_host() invokes it). Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index e7e43f2ae224..78f3ceea570e 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -923,9 +923,6 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.card_busy = sdhci_omap_card_busy; host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; - sdhci_read_caps(host); - host->caps |= SDHCI_CAN_DO_ADMA2; - ret = sdhci_setup_host(host); if (ret) goto err_put_sync; From patchwork Fri Apr 27 11:47:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134598 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp620563lji; Fri, 27 Apr 2018 04:51:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpxA80zKWGlrV+Ec+fYS1IpPuV3HqPln12f3wR5dGVkH0dAJNJHyHA+hFT3cxAks7PMRYXo X-Received: by 2002:a65:608d:: with SMTP id t13-v6mr1917212pgu.222.1524829870604; Fri, 27 Apr 2018 04:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829870; cv=none; d=google.com; s=arc-20160816; b=Q1l8mDM1VTkL7sI9vACyLhyQaCwMYZtIfR2Uti4tWJf7G27X4lFbxo10VSoEM4Usr4 hRzMtQI2gE3S/9yXYS4RqwUo+18vAw3kFaQPIfIxF07u/87ETty0Ds2UvSiZx9N/D/rW yU4RYPMVIiGPyL9OfHGtT4OVfFnpMMtjTx4QPzj7XyJKsvCJFslfNCBOvJF++hM+aw8p iRoR2NFbm/69Btcvpx9AUsR2M9uGfs0eLH0o5EUmWkiCWS4a0kCD8LHO8lQsOE3OIDBI Mlk2QAh6E32CGWJFg2HWoaZkTvzC+5PvyBUu+2Kbz6V9VrL7RZcPAN0frk9EgcO5xRVT iMrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=kYLjro0nVK2UVs1wx22EKw5k6rAYvYkvcpwXPLdXVvs=; b=I/2uOTU+O8WasQzZN24B+wo+lcZ+YrhFJCtX2hEslhGabZSmOdX+BV3WnUrKmV9ZMS SmMz/aXPg+rW2WK1KHuet5RoOq7Vt0CjT8B6u6DcHKvNGuub8EZvVmpDFGcNgZIJhQNq rDBAaFB9cyx3tqHR7mv7Ehr/Eb4PMDjkynwNBlTRitf3iDxL1G0UTNhtjWF8XymfjzBh ZTXMWLrhAE3dl9ruTvSYPyAPGQFAPtc7pFX1lkPTdh99c5+L2VSJe4+fFXddfnsedFX3 oL1+ho1hFgl0FMrndiTeme/OVjyhZ0jH/6zZEmejGIrBYQbH62ZXDCwZm95Api2VPTUf HGqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OaByLaIt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si1129688plt.55.2018.04.27.04.51.10; Fri, 27 Apr 2018 04:51:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=OaByLaIt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757984AbeD0LvI (ORCPT + 29 others); Fri, 27 Apr 2018 07:51:08 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:61726 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757437AbeD0Lrs (ORCPT ); Fri, 27 Apr 2018 07:47:48 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBlgXD002329; Fri, 27 Apr 2018 06:47:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829662; bh=DOUzZlAHvcMGoFC5rZW0cxnf9uH81UjBQkC1gmq+iVs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OaByLaIt/wXQUyAcvBTbbVnXp8WE8OJYUlROKnnEjzEnYzretGkDWw7S3drvnsUlD iOQ+rgAuQcdYc9feV+tfWTE6mK0qE+W+6ajF60HCjtKhs0CnjGJQtLpdHanJJif9Zw nMVJ8ORNWUX+DfLtuUf7et69kzfpGDw2xamI1ujU= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlg2d014901; Fri, 27 Apr 2018 06:47:42 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:47:42 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:47:42 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSI014207; Fri, 27 Apr 2018 06:47:40 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 04/14] mmc: sdhci-omap: Invoke sdhci_get_of_property to read sdhci dt properties Date: Fri, 27 Apr 2018 17:17:13 +0530 Message-ID: <20180427114723.2687-5-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Invoke sdhci_get_of_property defined in sdhci-pltfm.c to read sdhci specific properties from dt node. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index b3dc7f1466e5..d5c1a9c71f95 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -893,6 +893,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->ioaddr += offset; mmc = host->mmc; + sdhci_get_of_property(pdev); ret = mmc_of_parse(mmc); if (ret) goto err_pltfm_free; From patchwork Fri Apr 27 11:47:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134597 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp619970lji; Fri, 27 Apr 2018 04:50:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrihj514+0MSfSQ9hsUyccHXf1xkpyu1Mx7dXZ5WBECU0pUnOZzFSpvUXlEK53dUKDGBzzd X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr2027810plf.288.1524829832686; Fri, 27 Apr 2018 04:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829832; cv=none; d=google.com; s=arc-20160816; b=x6lngwEAKzcyREIKshdqYXEoepHvpG3LaG3qlR3O4LxPZ+CbfLhoMHdcFEwbFGoYft gUS9VPu5mr6yS2Do2Rrfkq7eqetHB+2HoAvkjTgHMc3hG3UxM/Fcd6ALXOzXGzXDBqXB E4BueTAjMQMusMlomZR6ujd/nGmMIhPSIP3gsVHFzsSLBUhqvGJpg6su5VRT632irTIb w3gysCXEcIb0WgfaOx+N9X3s7HXhfu/4Ml3XOgKPNSxmdz1EswZG+Lz1d+SJAfS1tIn+ caphk74L/Uapb4J3Gspb1dVfLEOBoSnrvVEGTGb7XbZG4kvIS0PqL+mxn3Vk0HnkZYec op+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=jSUuE8kli5k/0onIFLqIS5fdh57wa225uHYGi3TZDx4=; b=exEmOkwSDdKBnAJZYoDS6ZSZ9HOeiO/EGzEOAXmsnM8XeaXGLnb6xf1kwoj+th790d TURMEFsZkkc7nmzQnmeSnADxlgIqSu4P6kF0mCFQOuVSSoPQCyDxRjS6J3fZ6zaOpozC VgnMoNa2V6x6xmwDOlYDUPcZRTbOwOt/7k/5NyCU6HitguaGsS2J5kWiTdWAkW+UVZOB lxzQPxKh7tffZvlGUrtMj8wBxWbPIqrz0YpttLM2s6t6xwv3Ib/id4lavVBRjEpYzkdw u+GZAascuqBIdllphHpbcNY4WowM2vXSXEApOzQNMOrktWtkT65cZRwQsA8ex58DE/qt bmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cXZZnUlE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si1168777pfd.341.2018.04.27.04.50.32; Fri, 27 Apr 2018 04:50:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cXZZnUlE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758141AbeD0Lu2 (ORCPT + 29 others); Fri, 27 Apr 2018 07:50:28 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:48819 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758062AbeD0Lrx (ORCPT ); Fri, 27 Apr 2018 07:47:53 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBlnFA026223; Fri, 27 Apr 2018 06:47:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829669; bh=UWu4oYEE9F7j1rpVRckcBlnswaQckSNJlqa2Vk2rU20=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cXZZnUlEiP4uS/thDLGIeg80qN0vTRR8ObV8vCs95eOItqcGS94lb9S0gS6gS6TWd EqzCwiMjycuqnSEsVvcW6ggvQmBcBwU0iZ8co8YUlaGSsyEdNKdTqwBYr/F+kR3ilt iWcugVEbNBFEF1J6C0tkhNaLpZxfExVHHSup8Izg= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlnp8015004; Fri, 27 Apr 2018 06:47:49 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:47:48 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:47:48 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSK014207; Fri, 27 Apr 2018 06:47:46 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 06/14] mmc: sdhci: Add quirk to disable HW timeout Date: Fri, 27 Apr 2018 17:17:15 +0530 Message-ID: <20180427114723.2687-7-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter Add quirk to disable HW timeout if the requested timeout is more than the maximum obtainable timeout. Also, if the quirk is set and ->get_max_timeout_count() is not implemented, max_busy_timeout is set to zero. Based-on-patch-by: Kishon Vijay Abraham I Signed-off-by: Adrian Hunter Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci.c | 38 ++++++++++++++++++++++++++++++++++---- drivers/mmc/host/sdhci.h | 5 +++++ 2 files changed, 39 insertions(+), 4 deletions(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0f3cdca3e769..8da118d0d2c4 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -709,12 +709,15 @@ static u32 sdhci_sdma_address(struct sdhci_host *host) return sg_dma_address(host->data->sg); } -static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) +static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd, + bool *too_big) { u8 count; struct mmc_data *data = cmd->data; unsigned target_timeout, current_timeout; + *too_big = true; + /* * If the host controller provides us with an incorrect timeout * value, just skip the check and use 0xE. The hardware may take @@ -768,9 +771,12 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) } if (count >= 0xF) { - DBG("Too large timeout 0x%x requested for CMD%d!\n", - count, cmd->opcode); + if (!(host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT)) + DBG("Too large timeout 0x%x requested for CMD%d!\n", + count, cmd->opcode); count = 0xE; + } else { + *too_big = false; } return count; @@ -790,6 +796,16 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host) sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } +static void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable) +{ + if (enable) + host->ier |= SDHCI_INT_DATA_TIMEOUT; + else + host->ier &= ~SDHCI_INT_DATA_TIMEOUT; + sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); + sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); +} + static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd) { u8 count; @@ -797,7 +813,17 @@ static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd) if (host->ops->set_timeout) { host->ops->set_timeout(host, cmd); } else { - count = sdhci_calc_timeout(host, cmd); + bool too_big = false; + + count = sdhci_calc_timeout(host, cmd, &too_big); + + if (too_big && + host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT) { + sdhci_set_data_timeout_irq(host, false); + } else if (!(host->ier & SDHCI_INT_DATA_TIMEOUT)) { + sdhci_set_data_timeout_irq(host, true); + } + sdhci_writeb(host, count, SDHCI_TIMEOUT_CONTROL); } } @@ -3616,6 +3642,10 @@ int sdhci_setup_host(struct sdhci_host *host) mmc->max_busy_timeout /= host->timeout_clk; } + if (host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT && + !host->ops->get_max_timeout_count) + mmc->max_busy_timeout = 0; + mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index c95b0a4a7594..f6555c0f4ad3 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -437,6 +437,11 @@ struct sdhci_host { #define SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN (1<<15) /* Controller has CRC in 136 bit Command Response */ #define SDHCI_QUIRK2_RSP_136_HAS_CRC (1<<16) +/* + * Disable HW timeout if the requested timeout is more than the maximum + * obtainable timeout. + */ +#define SDHCI_QUIRK2_DISABLE_HW_TIMEOUT (1<<17) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ From patchwork Fri Apr 27 11:47:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134596 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp619446lji; Fri, 27 Apr 2018 04:50:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKsvet0c/d86/q66fEihX+VWDwklCIE38WjdQ3KUTCbz7jKolyN20GmehgFvFsshaBw5u7 X-Received: by 10.98.160.68 with SMTP id r65mr1899860pfe.235.1524829799919; Fri, 27 Apr 2018 04:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829799; cv=none; d=google.com; s=arc-20160816; b=pOR67r+FblwTWpeVD8hD80Lmpw8sr1WPNdMrzuTxnC3zOYkqTw44MN9WdWAGRUMW03 G1X4yyJb8+pyk4zBd1ghnQsQByyOqHCIkPrjVcfqQzDgVt32szA1jZe2tvFKsHz22nc3 B7fgdIW6tpwgCI+jhzYRI2OUnj3QXPs58nTvAxbXtZCSQBGG58c7afjCk2sDGqz6/WPP Tzfhn0Bdon/4NOzt92tnnydlVBtZIEL3wMnFZXT8WvmFmgHv4WSFxzwclO1KF1hkC6tR 6crSbii/btYoLxZoSy2+QI8wAZGtXQuvsOVRNngva8lmumwU8xHlsHmSzThP65++E3xq vODw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=p//n/ddXPkFaoyHirpANVfmY+n+t3oNPyOWIRUroRfc=; b=FH9R59kIT9sj1xCQNcVYAfdzqhfqfa7V5XeRF9ZEsCT/qmRlI52SHRwKfYlcyYHLNy JtEDAtoxoEtO9SmJedEUSNxqnGUXyeu26Tm4eFvYnYDVfhACbe1k6cBu8p35IhP68anl QMzEayWqCD0A1jQtf57yh/VnezdsTKzNXLfnFBpku0dPBP+eRS0fydOgrTclwuFvbokp froRI2gRXm7WE+URSnLKWH1LqwXw2Hn+Yw9zxouYEoGKPr2AmlVQlVGDtkLvxQywbOdp LuUF2vCo3kQKxaefTrJPC+jx24bA7rjCuJdIw43MA6/UAEkczPdCVVlQCui6GyrUyHnL jaJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QYc0Oc2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si1135466pfe.265.2018.04.27.04.49.59; Fri, 27 Apr 2018 04:49:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QYc0Oc2M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758173AbeD0Lt5 (ORCPT + 29 others); Fri, 27 Apr 2018 07:49:57 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:14972 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757680AbeD0LsB (ORCPT ); Fri, 27 Apr 2018 07:48:01 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBltRN010406; Fri, 27 Apr 2018 06:47:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829675; bh=bomq/Dk1ln70ssxPmYIaylTBbXxZ+4AAq1ndP7We0hU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=QYc0Oc2MXzrJlcejH9EznUf6z2Hmsbwj6Yjf7Y9KRHMB8oYb+QkNLOymkB+BkU+1d hIT1ipHd23l1FDClcrQgKrFb+ylXiepRYsG9MRm/SWl2VtX0KCYAfdK64Ky7Odehie thNkwvWI/EGCfaf3OFPcp/GgvTizey+yicoNv7ig= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlt3b020976; Fri, 27 Apr 2018 06:47:55 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:47:55 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:47:54 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSM014207; Fri, 27 Apr 2018 06:47:52 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 08/14] mmc: sdhci: Program a relatively accurate SW timeout value Date: Fri, 27 Apr 2018 17:17:17 +0530 Message-ID: <20180427114723.2687-9-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sdhci has a 10 second timeout to catch devices that stop responding. In the case of quirk SDHCI_QUIRK2_DISABLE_HW_TIMEOUT, instead of programming 10 second arbitrary value, calculate the total time it would take for the entire transfer to happen and program the timeout value accordingly. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 52 ++++++++++++++++++++++++++++++++++------ drivers/mmc/host/sdhci.h | 10 ++++++++ 2 files changed, 55 insertions(+), 7 deletions(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b229354e5b88..1c828e0e9905 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -738,6 +738,39 @@ static unsigned int sdhci_target_timeout(struct sdhci_host *host, return target_timeout; } +static void sdhci_calc_sw_timeout(struct sdhci_host *host, + struct mmc_command *cmd) +{ + struct mmc_data *data = cmd->data; + struct mmc_host *mmc = host->mmc; + struct mmc_ios *ios = &mmc->ios; + unsigned char bus_width = 1 << ios->bus_width; + unsigned int blksz; + unsigned int freq; + u64 target_timeout; + u64 transfer_time; + + target_timeout = sdhci_target_timeout(host, cmd, data); + target_timeout *= NSEC_PER_USEC; + + if (data) { + blksz = data->blksz; + freq = host->mmc->actual_clock ? : host->clock; + transfer_time = (u64)blksz * NSEC_PER_SEC * (8 / bus_width); + do_div(transfer_time, freq); + /* multiply by '2' to account for any unknowns */ + transfer_time = transfer_time * 2; + /* calculate timeout for the entire data */ + host->data_timeout = data->blocks * target_timeout + + transfer_time; + } else { + host->data_timeout = target_timeout; + } + + if (host->data_timeout) + host->data_timeout += MMC_CMD_TRANSFER_TIME; +} + static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd, bool *too_big) { @@ -831,6 +864,7 @@ static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd) if (too_big && host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT) { + sdhci_calc_sw_timeout(host, cmd); sdhci_set_data_timeout_irq(host, false); } else if (!(host->ier & SDHCI_INT_DATA_TIMEOUT)) { sdhci_set_data_timeout_irq(host, true); @@ -845,6 +879,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) u8 ctrl; struct mmc_data *data = cmd->data; + host->data_timeout = 0; + if (sdhci_data_line_cmd(cmd)) sdhci_set_timeout(host, cmd); @@ -1198,13 +1234,6 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) mdelay(1); } - timeout = jiffies; - if (!cmd->data && cmd->busy_timeout > 9000) - timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; - else - timeout += 10 * HZ; - sdhci_mod_timer(host, cmd->mrq, timeout); - host->cmd = cmd; if (sdhci_data_line_cmd(cmd)) { WARN_ON(host->data_cmd); @@ -1244,6 +1273,15 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200) flags |= SDHCI_CMD_DATA; + timeout = jiffies; + if (host->data_timeout) + timeout += nsecs_to_jiffies(host->data_timeout); + else if (!cmd->data && cmd->busy_timeout > 9000) + timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; + else + timeout += 10 * HZ; + sdhci_mod_timer(host, cmd->mrq, timeout); + sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); } EXPORT_SYMBOL_GPL(sdhci_send_command); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index f6555c0f4ad3..23966f887da6 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -332,6 +332,14 @@ struct sdhci_adma2_64_desc { /* Allow for a a command request and a data request at the same time */ #define SDHCI_MAX_MRQS 2 +/* + * 48bit command and 136 bit response in 100KHz clock could take upto 2.48ms. + * However since the start time of the command, the time between + * command and response, and the time between response and start of data is + * not known, set the command transfer time to 10ms. + */ +#define MMC_CMD_TRANSFER_TIME (10 * NSEC_PER_MSEC) /* max 10 ms */ + enum sdhci_cookie { COOKIE_UNMAPPED, COOKIE_PRE_MAPPED, /* mapped by sdhci_pre_req() */ @@ -555,6 +563,8 @@ struct sdhci_host { /* Host SDMA buffer boundary. */ u32 sdma_boundary; + u64 data_timeout; + unsigned long private[0] ____cacheline_aligned; }; From patchwork Fri Apr 27 11:47:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134595 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp619007lji; Fri, 27 Apr 2018 04:49:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq2BbAK6WRUdPvnlcr0bT1czLsLwZ+49RUm11Xu0gE1kxRJF1Qm9gP4Dc79TN4CLAg7s7SF X-Received: by 2002:a17:902:6c03:: with SMTP id q3-v6mr2088036plk.176.1524829772365; Fri, 27 Apr 2018 04:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829772; cv=none; d=google.com; s=arc-20160816; b=1HTQJfQNs7vvUhi3x4hXKIvvkug32aTJVMSVld20krcs+0nei7IOELisN5erop2+SM hTJubABTLaCWPOAxDL/0N1QjgSDLFAkMiV0HIDJ9YrVX4OFSRjNz+IXepyTyLEAR8YP9 eMGNLvJ+yYS2s+JPlKtO20N2kJS0p5CIFDpHrcq9M2sGsFHuYtkge24/a3/tLwZ3H4Q/ rFKK8lFyrzRTIi4icPQBG4azyj6U4yAzdCb51P9mGww322/hTpxH/3kjckwlxW9uqfCc bVpF8w8bOz5Umm/ugvj3IkoWQ11/2FSsTwicKDrrYdhWUfJTvDGjKcK5DYZhKVAqgXXD MtyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=pGIjuCmrrgAX4FxVeH4FSA4DQWgf8XN8xJJr+kpYNRo=; b=YvF0JvM9QV5o98ZmP7Sw4079tY+THV6Yx/dGDQ9coZMj6TL0PFEjuuoCYxX9ad57c5 JRy93m0VRu5YKbQp2LSOkwgO0B6avBqwuCK9JshJ8FcSdy9ME1z+D3fuobzwPhhvVm21 KllEGnVjoATRDPkQRbUtnQwsGTME5VBc9rL4IelOGuz0o7hjoPWz1BqoI2BV9GE5F1ph eWIP86E/Uhukuw/oTPmri89I+HLKJ1+nygv3e0Howr+GS40XiRGVuwUJ24Vg0W2OItyA +bZ1sWDl/Y5uz5K99jawkB89jwUsM6rQ7B+2r6ZEa0DIcG+BoD1nJVmUrkTOfePJyIr4 nuow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kISCRhIt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9-v6si1098151pgr.373.2018.04.27.04.49.32; Fri, 27 Apr 2018 04:49:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kISCRhIt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758080AbeD0Lta (ORCPT + 29 others); Fri, 27 Apr 2018 07:49:30 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:14982 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758099AbeD0LsH (ORCPT ); Fri, 27 Apr 2018 07:48:07 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBm1th010412; Fri, 27 Apr 2018 06:48:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829681; bh=ik4H9MOMDIzB7cMdCmwYAxhpyodZdUsqaqv0Gxvpv8c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kISCRhItwaHmph5QOqHnXEgYFEatYcFNO8K4K1iC9Ly4fy3nQ0BMQimtelnQLGDKy dBolK/kLyebnEpud0E8TUrlasLK4vCUNz143KrEA1hioFRt3HF7+eCroz8cXYU+u7k wZyF9VsaxOTHNMKqQMfoQHO10gBS9lVeoSDAEA2k= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBm1xs021076; Fri, 27 Apr 2018 06:48:01 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:48:00 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:48:00 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSO014207; Fri, 27 Apr 2018 06:47:58 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 10/14] dt-bindings: sdhci-omap: Add K2G specific binding Date: Fri, 27 Apr 2018 17:17:19 +0530 Message-ID: <20180427114723.2687-11-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add binding for the TI's sdhci-omap controller present in K2G. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Rob Herring Acked-by: Tony Lindgren --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.0 diff --git a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt index 51775a372c06..8d09b837e350 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt @@ -4,7 +4,9 @@ Refer to mmc.txt for standard MMC bindings. Required properties: - compatible: Should be "ti,dra7-sdhci" for DRA7 and DRA72 controllers + Should be "ti,k2g-sdhci" for K2G - ti,hwmods: Must be "mmc", is controller instance starting 1 + (Not required for K2G). Example: mmc1: mmc@4809c000 { From patchwork Fri Apr 27 11:47:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134591 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp617844lji; Fri, 27 Apr 2018 04:48:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7bRUbEXPbMrHRNJv9jglgWiyFo3ahRPOIgXSnonTRvLjVBH8u4vjg8KPCvZwBG3rPiP9y X-Received: by 2002:a63:2c12:: with SMTP id s18-v6mr1892693pgs.427.1524829697373; Fri, 27 Apr 2018 04:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829697; cv=none; d=google.com; s=arc-20160816; b=divX63+VBh7gnT8xJqMcHZhMZ2TJT1Gs+vBM7pH27K8iKKDX83nIc+SJRmZmU6fIBy eOFQOFtoh73nEorTGdJWAPnc8eYRfmT6R+nDQ/7U+9ETK9DZu7bv7CSUoyKidlXN/OGn n/WTzhCv5HTJq/quJVROd5UtVjxGTDBSZl58dDyPzjKBQDIOTLBJPqfTCd8MWo6CffG1 jj3LOPTE6kF4DqA9zAJOMfmaN70uc3HlAl+uX7apTkd93Zk2nEbMaigGjjkZK/baASiu o/CsCegn3Ld0U868rD5GvK5YsUX19rmQUvumPmyC2KKOeqEmhRF6k3keroVtYan+EZem pIqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=uLe2ms712Rb2nRfj0JFxo3k8Y9dvhpMAa0xLgoxvJY8=; b=Gfq48gjTyK/q2VpGXyll5rik6anc/QxWqgd7cF0+JwWY8NtDJwJo5MccRTdsBZ4JIR lMVjyUYSgk9K7PucfvgtGPHvT4i9T8/VNl0V3op7xMIXpk2m4mXSstkfFn2jxp3ouLHM MoTZqBcq4zVGBXYXsWlOMgUXUoAaFAiBELzYu/pv/RykGzD/ky7gm4dpGK9OTy+w6LDk 6lrrKBjk9lPPOetBfyOyRQFAR6M9L9QFqF0AsHyGApt9aIhd52GOuPcI/PT2Jd1G6nij Sr3FsJ+uBfcaMr8fyCsiWn5SfyBCjmYW1cGITjL4QrXOkb38rU90n5UPt7D+TzWn7+6s pRvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l9UsVuj5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8-v6si1137746plb.347.2018.04.27.04.48.17; Fri, 27 Apr 2018 04:48:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l9UsVuj5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758126AbeD0LsM (ORCPT + 29 others); Fri, 27 Apr 2018 07:48:12 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:46591 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757530AbeD0LsJ (ORCPT ); Fri, 27 Apr 2018 07:48:09 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBm43K009546; Fri, 27 Apr 2018 06:48:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829684; bh=d9f9srmYNGL+VCLHo70uTQHMQLpMfrKzOgkaInQf/9w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=l9UsVuj5DyQCf9M1d98bJ5LmX0LmVzZ7wSy0x01eb/j0g85Jo7z6c890bemX5XytY yhxiOttQGQeECw3yatNxfLknqwr08jhjxq6aLVFjWJKsLDDZwR77YvxtH5/CA2ijSb Cp3HcS+A0HQgdW+6nX0RiCGIXT5ZuChccM4wvmig= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBm4EB015425; Fri, 27 Apr 2018 06:48:04 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:48:04 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:48:03 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSP014207; Fri, 27 Apr 2018 06:48:01 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 11/14] mmc: sdhci-omap: Add support for MMC/SD controller in k2g SoC Date: Fri, 27 Apr 2018 17:17:20 +0530 Message-ID: <20180427114723.2687-12-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the new compatible added specifically to support k2g's MMC/SD controller. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 2232a9974b21..b11c846dd8a1 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -720,6 +720,10 @@ static const struct sdhci_pltfm_data sdhci_omap_pdata = { .ops = &sdhci_omap_ops, }; +static const struct sdhci_omap_data k2g_data = { + .offset = 0x200, +}; + static const struct sdhci_omap_data dra7_data = { .offset = 0x200, .flags = SDHCI_OMAP_REQUIRE_IODELAY, @@ -727,6 +731,7 @@ static const struct sdhci_omap_data dra7_data = { static const struct of_device_id omap_sdhci_match[] = { { .compatible = "ti,dra7-sdhci", .data = &dra7_data }, + { .compatible = "ti,k2g-sdhci", .data = &k2g_data }, {}, }; MODULE_DEVICE_TABLE(of, omap_sdhci_match); From patchwork Fri Apr 27 11:47:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134594 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp618457lji; Fri, 27 Apr 2018 04:48:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpw8J4hwEx6Xcce/80Jsjhkjg47sfoQL/YSiaRUv/a4Zfow2F+Xj6kp7Fz9gwG9kD8RJ+CD X-Received: by 10.167.128.207 with SMTP id a15mr1953368pfn.116.1524829737169; Fri, 27 Apr 2018 04:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829737; cv=none; d=google.com; s=arc-20160816; b=lkcvSLpUBUemfkSp07rdniuPyqFC9hRicy2bo1OQ7p8ThKWtPnLifBPl9exhogX65R grgqzCtCwfdql9MBNURCdEzr4OfOmv+YU9ETwIX+1yWvSfw5aJpfGUoE/cqeUFIO4jXn Cq+aFhNC9EvOPKDImMaWNNNUyps73gKojFaCwq1UTzstBm161FRJ0RZ/yZxEcgRgAYaE uzZUODsVQn1NSbi0T9B2TbVVgz5NRUIaMvfowXxReQqJ1JLdcPSgRlJr8p8BXUWXss7u wY5hak/byAzucE1kSFUJd9njUcD2cqXBcEQmNJuDYdj7M0kTsmwWALBDzTbuBSGyaRMP xEVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GJJsoYA9UYSGfFUAAHT8tPOZ/EoVr9tEcBqFOeJnLMc=; b=f7fzNl94a8Viv1L86WsdLG6UVFjxGVYGOmSOrxYEi3jh0Mi/1QLWCvewyaZz9ObSpt 31GHvX4MZu6VpGx3XQ2uBm3e3LXUtuRI6hRi9D78y75xFVFOSVNgMQNiAsxlJKr4kkA6 zlcL7SwHTo9kRASe29wwpnfB1bIfO0pkkHfSUL6k8KY7aI8X6qm6wrZT1bopRauxaBsm EGScejMcVS/VPl9fjlxiG30Vi9GUIcA6lxilzZDxcXkOKtvaLNgx4l076gy5SoNlmZHz IPd5Eq+OCq7s4Hx7zJvxxh26stwhKo7MrMQhDbLGgpGd69xgoOSbDr1wMGgHbdyk7Yrz 73sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yJmytQ+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si1086961pgf.652.2018.04.27.04.48.56; Fri, 27 Apr 2018 04:48:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yJmytQ+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757983AbeD0LsS (ORCPT + 29 others); Fri, 27 Apr 2018 07:48:18 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:48836 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757530AbeD0LsN (ORCPT ); Fri, 27 Apr 2018 07:48:13 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBm7hw026424; Fri, 27 Apr 2018 06:48:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829687; bh=05tX5TsEfAwpx7uiutq4ONRR4zHcBK3+fV6RhYJcUno=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=yJmytQ+yW/2g0U7qkrwbdG1haEG+wJoFBrriZXUhkW1wOB6/0+yWgCs/uPIbzPI21 ZFkkEXUke2LaaNZmU7KfGa4Tg1hJDPWhUBCmh9p5XUkE/NxXxozsuK5R/mdmpjCdVG JpcDD3+DeqirkjESTQPBM6WyfBRd+6gfSEN8/oRk= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBm7qa015520; Fri, 27 Apr 2018 06:48:07 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:48:06 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:48:07 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSQ014207; Fri, 27 Apr 2018 06:48:04 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 12/14] mmc: sdhci-omap: Add sdhci_omap specific ops for enable_sdio_irq Date: Fri, 27 Apr 2018 17:17:21 +0530 Message-ID: <20180427114723.2687-13-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add sdhci_omap_enable_sdio_irq to set CTPL and CLKEXTFREE bits in MMCHS_CON register required to detect asynchronous card interrupt on DAT[1]. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index b11c846dd8a1..bd5e03d177e0 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -36,6 +36,7 @@ #define CON_DDR BIT(19) #define CON_CLKEXTFREE BIT(16) #define CON_PADEN BIT(15) +#define CON_CTPL BIT(11) #define CON_INIT BIT(1) #define CON_OD BIT(0) @@ -226,6 +227,23 @@ static void sdhci_omap_conf_bus_power(struct sdhci_omap_host *omap_host, } } +static void sdhci_omap_enable_sdio_irq(struct mmc_host *mmc, int enable) +{ + struct sdhci_host *host = mmc_priv(mmc); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host); + u32 reg; + + reg = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); + if (enable) + reg |= (CON_CTPL | CON_CLKEXTFREE); + else + reg &= ~(CON_CTPL | CON_CLKEXTFREE); + sdhci_omap_writel(omap_host, SDHCI_OMAP_CON, reg); + + sdhci_enable_sdio_irq(mmc, enable); +} + static inline void sdhci_omap_set_dll(struct sdhci_omap_host *omap_host, int count) { @@ -962,6 +980,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.set_ios = sdhci_omap_set_ios; host->mmc_host_ops.card_busy = sdhci_omap_card_busy; host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; + host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq; ret = sdhci_setup_host(host); if (ret) From patchwork Fri Apr 27 11:47:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 134592 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp617976lji; Fri, 27 Apr 2018 04:48:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZotvOXG/W8LQZxyKJgF0/BF0M/GyJJxCr7ToTs5Aoag6Ctqk7Wq5qjBaUynx5qLDniQcDoQ X-Received: by 2002:a63:7344:: with SMTP id d4-v6mr1834490pgn.273.1524829705860; Fri, 27 Apr 2018 04:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829705; cv=none; d=google.com; s=arc-20160816; b=N+9Onb8URNJKWggJ/uruQFPii+CsJxsCoTK+nhGS7HoTe+tq2/nOpQVl14jBtKvggN EMDtWOOYoDrx4q99XQMfiEgo3w9oDIKNjKUj5G9P7k9+0bTbc9qwHdJM5cELpJ/Mles/ jgb/M5RybIU/3ykhmKgccmktTukYXGFdiGjEtQHMadP8p3/NHiZVuQc76WTbP0iMp511 MfhsuweD+eUBjVRkaVqzJGv5uqGwiAxAw0GRoTIW/ZZeWxIj/JMFPt4tz3MmL0obpB3E sXuYpZdCashHQUlaK2rnltCydgzW0mztDsLAqQnOGGyzz86zLpcWdYokSoC3Hgkx1xF7 pY/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Y8Tgo3zKk0CpwYWwm4jUr4tNcK1PLnGsrIu+pxsJB6I=; b=rxuDdApkJQRS8m9Ddzuqa0jrBmqgdJOplOCpZ1Pp0LWy9Y1msowM2LyGRghZFxREZY UxZl1NjN44OOMcD4keW4dYf0aermX/0a2mV4Ae9fTsjtYX3DpnLJ/IBLqoa4Jix85ilV hbN+GGFHBC7+0p7bN2kYHZnesa82kqucw+zPSrsKEnztrYhMrq13qHusTIh6LoHTc7QI AP8Denp8xxQ3TS3pUp2Yd7F9U7sVEkdq3Qy2YJIvj/eMU3MB70YQ0lFwVm8gBNyjltSa lQ5HAVDwoI+rkfv5ld+d/HSMMWYC4NvqUgr3wS9vhjykYDQGcUZpS6t1gb/K0Sk8tZbN tsAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wnjkl7o3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si1138333pld.137.2018.04.27.04.48.25; Fri, 27 Apr 2018 04:48:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=wnjkl7o3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758160AbeD0LsV (ORCPT + 29 others); Fri, 27 Apr 2018 07:48:21 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:46598 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758127AbeD0LsP (ORCPT ); Fri, 27 Apr 2018 07:48:15 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3RBmBKp009564; Fri, 27 Apr 2018 06:48:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524829691; bh=Y0xKDYuhdGDYxuippDVfOy42xHHxz7rjz3ApuZZ30yE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=wnjkl7o3CCAIUWqet+YFRtj7i8XF6ZfCGn7SoOTJu/V+aYBXnEa3H/PVDFSSDsWY1 3XHPcnBmb6lXWC+uz5k2TtVrHuEcPa2m20mZKIc1d0aaTBoHMsSEtVNLGJW/o8wac1 uMFLTkoEnA3skixyxdWIWtZuxvi9KRdIdYpWKpCE= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBmB1u015593; Fri, 27 Apr 2018 06:48:11 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 27 Apr 2018 06:48:10 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 27 Apr 2018 06:48:10 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3RBlRSR014207; Fri, 27 Apr 2018 06:48:07 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: Rob Herring , Mark Rutland , , , , , Subject: [PATCH v5 13/14] dt-bindings: sdhci-omap: Add pinctrl bindings Date: Fri, 27 Apr 2018 17:17:22 +0530 Message-ID: <20180427114723.2687-14-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427114723.2687-1-kishon@ti.com> References: <20180427114723.2687-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add pinctrl binding rquired to get the mux mode and IODelay values from devicetree. Signed-off-by: Kishon Vijay Abraham I --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.0 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt index 8d09b837e350..393848c2138e 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt @@ -7,6 +7,11 @@ Required properties: Should be "ti,k2g-sdhci" for K2G - ti,hwmods: Must be "mmc", is controller instance starting 1 (Not required for K2G). +- pinctrl-names: Should be subset of "default", "hs", "sdr12", "sdr25", "sdr50", + "ddr50-rev11", "sdr104-rev11", "ddr50", "sdr104", + "ddr_1_8v-rev11", "ddr_1_8v" or "ddr_3_3v", "hs200_1_8v-rev11", + "hs200_1_8v", +- pinctrl- : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt Example: mmc1: mmc@4809c000 {