public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan+linaro@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	regressions@lists.linux.dev,
	Johan Hovold <johan+linaro@kernel.org>,
	Aishwarya TCV <aishwarya.tcv@arm.com>,
	Chuan Liu <chuan.liu@amlogic.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: [PATCH] Revert "clk: Fix invalid execution of clk_set_rate"
Date: Mon,  2 Dec 2024 11:06:21 +0100	[thread overview]
Message-ID: <20241202100621.29209-1-johan+linaro@kernel.org> (raw)

This reverts commit 25f1c96a0e841013647d788d4598e364e5c2ebb7.

The offending commit results in errors like

	cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22

spamming the logs on the Lenovo ThinkPad X13s and other Qualcomm
machines when cpufreq tries to update the CPUFreq HW Engine clocks.

As mentioned in commit 4370232c727b ("cpufreq: qcom-hw: Add CPU clock
provider support"):

	[T]he frequency supplied by the driver is the actual frequency
	that comes out of the EPSS/OSM block after the DCVS operation.
	This frequency is not same as what the CPUFreq framework has set
	but it is the one that gets supplied to the CPUs after
	throttling by LMh.

which seems to suggest that the driver relies on the previous behaviour
of clk_set_rate().

Since this affects many Qualcomm machines, let's revert for now.

Fixes: 25f1c96a0e84 ("clk: Fix invalid execution of clk_set_rate")
Reported-by: Aishwarya TCV <aishwarya.tcv@arm.com>
Link: https://lore.kernel.org/all/e2d83e57-ad07-411b-99f6-a4fc3c4534fa@arm.com/
Cc: Chuan Liu <chuan.liu@amlogic.com>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---

#regzbot introduced: 25f1c96a0e84


 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 0d5a2293a8b3..936c0b79c169 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2539,7 +2539,7 @@ static int clk_core_set_rate_nolock(struct clk_core *core,
 	rate = clk_core_req_round_rate_nolock(core, req_rate);
 
 	/* bail early if nothing to do */
-	if (rate == clk_core_get_rate_recalc(core))
+	if (rate == clk_core_get_rate_nolock(core))
 		return 0;
 
 	/* fail on a direct rate set of a protected provider */
-- 
2.45.2


             reply	other threads:[~2024-12-02 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 10:06 Johan Hovold [this message]
2024-12-03  1:20 ` [PATCH] Revert "clk: Fix invalid execution of clk_set_rate" Stephen Boyd
2024-12-03  8:25   ` Johan Hovold
2024-12-03  9:21     ` Manivannan Sadhasivam
2024-12-03 19:30       ` Stephen Boyd
2024-12-05 16:52         ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241202100621.29209-1-johan+linaro@kernel.org \
    --to=johan+linaro@kernel.org \
    --cc=aishwarya.tcv@arm.com \
    --cc=chuan.liu@amlogic.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mturquette@baylibre.com \
    --cc=regressions@lists.linux.dev \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox