From nobody Fri Oct 17 10:32:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00349C433FE for ; Wed, 19 Oct 2022 08:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230480AbiJSIky (ORCPT ); Wed, 19 Oct 2022 04:40:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbiJSIju (ORCPT ); Wed, 19 Oct 2022 04:39:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 163587FF90; Wed, 19 Oct 2022 01:38:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 262CEB822CC; Wed, 19 Oct 2022 08:38:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 768BAC433D7; Wed, 19 Oct 2022 08:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168738; bh=YOAwwPrV6/YirX98LJtbHU/XaaLQu0LAr2I1+3I1W6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KWCszQABZqJs8Crgn6fgfo6vDCK8ZAWhmmzewtBkH+NfzmVfqO2n57Up6TNdZsVB3 VHYHpaatJXIAKLcnzjGEBfIEIj+kUIzd09kfET4GpfEfNl8COA7U4ODYnzge7M/OFY x//7i24FFVJuwC9k5qozyddv7/lK32z9FDD8dbWs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aniruddha TVS Rao , Prathamesh Shete , Adrian Hunter , Thierry Reding , Ulf Hansson Subject: [PATCH 6.0 038/862] mmc: sdhci-tegra: Use actual clock rate for SW tuning correction Date: Wed, 19 Oct 2022 10:22:05 +0200 Message-Id: <20221019083251.682421300@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Prathamesh Shete commit b78870e7f41534cc719c295d1f8809aca93aeeab upstream. Ensure tegra_host member "curr_clk_rate" holds the actual clock rate instead of requested clock rate for proper use during tuning correction algorithm. Actual clk rate may not be the same as the requested clk frequency depending on the parent clock source set. Tuning correction algorithm depends on certain parameters which are sensitive to current clk rate. If the host clk is selected instead of the actual clock rate, tuning correction algorithm may end up applying invalid correction, which could result in errors Fixes: ea8fc5953e8b ("mmc: tegra: update hw tuning process") Signed-off-by: Aniruddha TVS Rao Signed-off-by: Prathamesh Shete Acked-by: Adrian Hunter Acked-by: Thierry Reding Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221006130622.22900-4-pshete@nvidia.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -773,7 +773,7 @@ static void tegra_sdhci_set_clock(struct dev_err(dev, "failed to set clk rate to %luHz: %d\n", host_clk, err); =20 - tegra_host->curr_clk_rate =3D host_clk; + tegra_host->curr_clk_rate =3D clk_get_rate(pltfm_host->clk); if (tegra_host->ddr_signaling) host->max_clk =3D host_clk; else