Patch "cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cpufreq-qcom-implement-clk_ops-determine_rate-for-qc.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 95cc7a93aac6917cb6acd939dc5e70b45b9dd863
Author: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
Date:   Thu Dec 5 22:20:29 2024 +0530

    cpufreq: qcom: Implement clk_ops::determine_rate() for qcom_cpufreq* clocks
    
    [ Upstream commit a9ba290d0b829012574b6821ba08815046e60c94 ]
    
    determine_rate() callback is used by the clk_set_rate() API to get the
    closest rate of the target rate supported by the clock. If this callback
    is not implemented (nor round_rate() callback), then the API will assume
    that the clock cannot set the requested rate. And since there is no parent,
    it will return -EINVAL.
    
    This is not an issue right now as clk_set_rate() mistakenly compares the
    target rate with cached rate and bails out early. But once that is fixed
    to compare the target rate with the actual rate of the clock (returned by
    recalc_rate()), then clk_set_rate() for this clock will start to fail as
    below:
    
    cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22
    
    So implement the determine_rate() callback that just returns the actual
    rate at which the clock is passed to the CPUs in a domain.
    
    Fixes: 4370232c727b ("cpufreq: qcom-hw: Add CPU clock provider support")
    Reported-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
    Suggested-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
    Reviewed-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index 3a4305df5c119..92c0fc4a3cf60 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -627,8 +627,21 @@ static unsigned long qcom_cpufreq_hw_recalc_rate(struct clk_hw *hw, unsigned lon
 	return __qcom_cpufreq_hw_get(data->policy) * HZ_PER_KHZ;
 }
 
+/*
+ * Since we cannot determine the closest rate of the target rate, let's just
+ * return the actual rate at which the clock is running at. This is needed to
+ * make clk_set_rate() API work properly.
+ */
+static int qcom_cpufreq_hw_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
+{
+	req->rate = qcom_cpufreq_hw_recalc_rate(hw, 0);
+
+	return 0;
+}
+
 static const struct clk_ops qcom_cpufreq_hw_clk_ops = {
 	.recalc_rate = qcom_cpufreq_hw_recalc_rate,
+	.determine_rate = qcom_cpufreq_hw_determine_rate,
 };
 
 static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux