From patchwork Wed Apr 25 12:09:26 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: 134253 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp778763lji; Wed, 25 Apr 2018 05:10:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/LFzaFdkFz9w0N5VjSUTuLYO20hQ0+H0Hw5qSGek8UhtUoiN7UY/evuq4vn+vFKVBgHf4p X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr29253195plt.142.1524658209824; Wed, 25 Apr 2018 05:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658209; cv=none; d=google.com; s=arc-20160816; b=kCFgNesOhO5/tYEVu00dytLqd320As6msRFlbcEdrcruJXYHuL4NRJbV4Ah6ZH8/pS lDe/K2A6ECJMWe5ugfAstrb3UJmvMgbsK4j/CO8XbA+24vgCGMcyKRWkrVdeDjqWmfaO HNdIznGQpXsyoDkY1EGMLd7YU14H4y3b0PL5DFsefBVFRmfWdYPCWb7GSuwPSRzI5pJG XD2vYGFzZxyHB1g82RHDZEr1i2rLNfrjm+dI4QLLCsNJfp5aLZYN1vRYCD+qgFyAWLYl ZgvoKYVaMNOWMAGwSuOtT5YAGUtYetzhBbnh1LPBeg2Ods2xypZN+NnY5k9iZYR4H2sj W19w== 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=0QmutJIZ/H43dWYy32XQae/aftujNmxK1nseTperK4s=; b=LdPcUEk078AGBE3892yCfhycXAn0gc2UOqOAFHnkeUmvx+QilsoGFo2ncw8c8OOz5f qQMTBnfeJgzSlJ52PUZgDzPCWaNWOyOySANq8xbHLTNlaaBFVpQI8TO3HgBWj2YMVuB7 hUOy/LCZIhyi5TeXLZqQyGuV7NAbMW7XQWx0sctcHIh1KP1f3juX1O/FpQw12DSHpXxq CPCMujt/Qyz5tcCI2EGBvLpHz0QikKvt9Eu3D0scTCyvywJNRSi696XMEC2sHvkylbEz KXP0KtVHVCYE55+MlLl/BTzvbpEObHhOOSG3caoK0WwEG3sxbL1dC99nqOQlZCBs+jKx nREw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=ckHgR/kP; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) 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 u21si15640088pfl.143.2018.04.25.05.10.09; Wed, 25 Apr 2018 05:10:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=ckHgR/kP; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbeDYMKH (ORCPT + 6 others); Wed, 25 Apr 2018 08:10:07 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:60360 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbeDYMJ6 (ORCPT ); Wed, 25 Apr 2018 08:09:58 -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 w3PC9oGi012250; Wed, 25 Apr 2018 07:09:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524658190; bh=bq6E3VAqe/kxvHB4omcvaJlkbdf1tBk2WYg73VVMOrQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ckHgR/kPoUWIV8BG5uexFtJSHIf7hrBAu3+tTj4kfylNp+S6Q1UrYve2wavIQxPM9 cb9I2bEyFMg289g0G9Uc4U4KInWOL94d46WV6c/D9s0GeC3gbvotX6O35PsgVvFL68 IKeyJn/H8ui3YHlqp6wR7eZ7cV0uGb1CNBXOXvs0= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9o4g015722; Wed, 25 Apr 2018 07:09:50 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 25 Apr 2018 07:09:50 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 25 Apr 2018 07:09:50 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9hhO009970; Wed, 25 Apr 2018 07:09:47 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: , Rob Herring , Mark Rutland , , , , , Tony Lindgren Subject: [PATCH v4 01/12] mmc: sdhci-omap: Fix when capabilities are obtained from SDHCI_CAPABILITIES reg Date: Wed, 25 Apr 2018 17:39:26 +0530 Message-ID: <20180425120937.29867-2-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425120937.29867-1-kishon@ti.com> References: <20180425120937.29867-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 --- drivers/mmc/host/sdhci-omap.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 1456abd5eeb9..9bb53702e0e5 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);