From patchwork Tue Jun 16 15:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A042C433DF for ; Tue, 16 Jun 2020 15:57:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA26E20882 for ; Tue, 16 Jun 2020 15:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592323054; bh=WUbC/zbO0oTsMy1wNUm4FQ3VgtMh6IjDCj0UoOPUUAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EacnfMfr2BGqBpcBL8LjnReJBDzKiEdcsmEjunGO1gff3i5aWYm909Q4g2eAZkCdz V7oznN82bpErGJaP54UoflL8WONQ08mz88ELR8UAdIgHbMEu+Mbhgz55jVp1SVwp5V TuGjCNxQ3v5KD0B0E9zQpo1ooUGywwa+h8kih5uM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgFPPzE (ORCPT ); Tue, 16 Jun 2020 11:55:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:54830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732640AbgFPPzD (ORCPT ); Tue, 16 Jun 2020 11:55:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D24821532; Tue, 16 Jun 2020 15:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322903; bh=WUbC/zbO0oTsMy1wNUm4FQ3VgtMh6IjDCj0UoOPUUAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRmi7Z+rSg6+NAVQr0GKMzreW6MxfJreZ1dQLrif3ypqERH7FJ3L4StRIdTyKaggQ xVgEtcdsQoBVgrSAKo+hj2Le76U0LxecqTflixXp7aQ5WK4pp/W/k+rLLTWtD+ayMS Pqq7g+9rD7ytvuattf7sqzgaoXKvtBbaOjyrZMNI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Veerabhadrarao Badiganti , Ulf Hansson Subject: [PATCH 5.6 148/161] mmc: sdhci-msm: Clear tuning done flag while hs400 tuning Date: Tue, 16 Jun 2020 17:35:38 +0200 Message-Id: <20200616153113.392853950@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.402291280@linuxfoundation.org> References: <20200616153106.402291280@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Veerabhadrarao Badiganti commit 9253d71011c349d5f5cc0cebdf68b4a80811b92d upstream. Clear tuning_done flag while executing tuning to ensure vendor specific HS400 settings are applied properly when the controller is re-initialized in HS400 mode. Without this, re-initialization of the qcom SDHC in HS400 mode fails while resuming the driver from runtime-suspend or system-suspend. Fixes: ff06ce417828 ("mmc: sdhci-msm: Add HS400 platform support") Cc: stable@vger.kernel.org Signed-off-by: Veerabhadrarao Badiganti Link: https://lore.kernel.org/r/1590678838-18099-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-msm.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -1118,6 +1118,12 @@ static int sdhci_msm_execute_tuning(stru msm_host->use_cdr = true; /* + * Clear tuning_done flag before tuning to ensure proper + * HS400 settings. + */ + msm_host->tuning_done = 0; + + /* * For HS400 tuning in HS200 timing requires: * - select MCLK/2 in VENDOR_SPEC * - program MCLK to 400MHz (or nearest supported) in GCC