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);