From patchwork Wed Oct 19 08:22:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp203061wrs; Wed, 19 Oct 2022 01:42:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5RrXiuPicvKn9KLKaZQ7NrgBvqUjtMpazPISenRAqTOQ4Wxen8ZsXg90bvH7xtW6EbFH0O X-Received: by 2002:a05:6402:1d86:b0:457:e84:f0e with SMTP id dk6-20020a0564021d8600b004570e840f0emr6293417edb.241.1666168927551; Wed, 19 Oct 2022 01:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666168927; cv=none; d=google.com; s=arc-20160816; b=L7z6KMP2txyzHvzk8p5LjKfsD6G0ACo/ZBsfWWv+rXg0zkodHfTTEQUqrNjXkW/02y f6BXCizyRNTW1JZp9xnphinQAAsJn/ubC+0Q4KZF6craCS5+YNezf7l3zfcAjKOlymiO 63HQsvShw6XL3CEeBfcsQZhiNamSITVBUvMYYMFw8W66P3xHfDyjbsdFLnLxzjW/TJKU KnPNRl4CtJErRWf7v0jgLPVcxd+P3QhThWkVtrzY6A/+92y9RGNtDaCtHPqL8CJy38RT BG5nmncLEDOEqtbclhWfkd2nXLDctgRzClxIj61lIMyjTEiVUGpopwsNYdDDAlTQc+TD XK/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IjXcW/SeV8N4p9bNZuOiZS26fNFOrPxc1vzkfOVaOY4=; b=E4I8TkuIN9bu3Qnj9W+rTgUU+ceD8Zx5G9T7T0vAxNI9eyhlepdwg5hSJX7W6ZT2VS SwDXk7PavCRohM7DZH1uBLWWDUXqrPDiDoaNcej+Deaiw72RsOmNgs6cHboi8xVEeQUv wQEGAbmHNcwc2quq6ohb5adW/F1YFzmMDTfZySt8fRVLCvWwYPLaBNQSAFQMAkUOeim3 m0NqpzrsNgExp9vWO9wvP3HZGsyQRnUwU40za3oDHWImwCSwZcatZlmCo7SduO6dIKej pJdRnY1OkZ0rL5UNPTfHc6nk2dhaXujWooQVt6we5gMfzqRc10Ou1+KYf+rUSPu4UbAg +GlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KWCszQAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a17090636d400b00781cde43588si12325255ejc.58.2022.10.19.01.41.42; Wed, 19 Oct 2022 01:42:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KWCszQAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230477AbiJSIkw (ORCPT + 99 others); Wed, 19 Oct 2022 04:40:52 -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 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747104749405895159?= X-GMAIL-MSGID: =?utf-8?q?1747104749405895159?= 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); - tegra_host->curr_clk_rate = host_clk; + tegra_host->curr_clk_rate = clk_get_rate(pltfm_host->clk); if (tegra_host->ddr_signaling) host->max_clk = host_clk; else