From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbdASLLJ (ORCPT ); Thu, 19 Jan 2017 06:11:09 -0500 Received: from mga11.intel.com ([192.55.52.93]:35298 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841AbdASLLI (ORCPT ); Thu, 19 Jan 2017 06:11:08 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,253,1477983600"; d="scan'208";a="32620743" Subject: Re: [RESEND PATCHv1 4/8] mmc: sdhci-msm: Reset vendor specific func register on probe To: Ritesh Harjani , ulf.hansson@linaro.org References: <1484031652-12059-1-git-send-email-riteshh@codeaurora.org> <1484031652-12059-5-git-send-email-riteshh@codeaurora.org> Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, pramod.gurav@linaro.org, jeremymc@redhat.com, git@kchr.de From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Thu, 19 Jan 2017 12:05:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1484031652-12059-5-git-send-email-riteshh@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/01/17 09:00, Ritesh Harjani wrote: > From: Venkat Gopalakrishnan > > The vendor specific func register doesn't get reset when using the > software reset register. The various bootloader's could leave this > in an unknown state, hence reset this register to it's power on reset > value during probe. > > Signed-off-by: Venkat Gopalakrishnan > Signed-off-by: Ritesh Harjani Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-msm.c | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c > index 5a37c29..a028568 100644 > --- a/drivers/mmc/host/sdhci-msm.c > +++ b/drivers/mmc/host/sdhci-msm.c > @@ -69,6 +69,7 @@ > #define CORE_DLL_CLOCK_DISABLE BIT(21) > > #define CORE_VENDOR_SPEC 0x10c > +#define CORE_VENDOR_SPEC_POR_VAL 0xa1c > #define CORE_CLK_PWRSAVE BIT(1) > #define CORE_HC_MCLK_SEL_DFLT (2 << 8) > #define CORE_HC_MCLK_SEL_HS400 (3 << 8) > @@ -1197,17 +1198,9 @@ static int sdhci_msm_probe(struct platform_device *pdev) > goto clk_disable; > } > > - config = readl_relaxed(msm_host->core_mem + CORE_POWER); > - config |= CORE_SW_RST; > - writel_relaxed(config, msm_host->core_mem + CORE_POWER); > - > - /* SW reset can take upto 10HCLK + 15MCLK cycles. (min 40us) */ > - usleep_range(1000, 5000); > - if (readl(msm_host->core_mem + CORE_POWER) & CORE_SW_RST) { > - dev_err(&pdev->dev, "Stuck in reset\n"); > - ret = -ETIMEDOUT; > - goto clk_disable; > - } > + /* Reset the vendor spec register to power on reset state */ > + writel_relaxed(CORE_VENDOR_SPEC_POR_VAL, > + host->ioaddr + CORE_VENDOR_SPEC); > > /* Set HC_MODE_EN bit in HC_MODE register */ > writel_relaxed(HC_MODE_EN, (msm_host->core_mem + CORE_HC_MODE)); >