Patch "clk: qcom: Allow constant ratio freq tables for rcg" has been added to the 4.14-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

    clk: qcom: Allow constant ratio freq tables for rcg

to the 4.14-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:
     clk-qcom-allow-constant-ratio-freq-tables-for-rcg.patch
and it can be found in the queue-4.14 subdirectory.

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



commit 794791e58096cbf13a7ee75f350815d37c7aa770
Author: Jeffrey Hugo <jeffrey.l.hugo@xxxxxxxxx>
Date:   Thu Oct 31 11:57:15 2019 -0700

    clk: qcom: Allow constant ratio freq tables for rcg
    
    [ Upstream commit efd164b5520afd6fb2883b68e0d408a7de29c491 ]
    
    Some RCGs (the gfx_3d_src_clk in msm8998 for example) are basically just
    some constant ratio from the input across the entire frequency range.  It
    would be great if we could specify the frequency table as a single entry
    constant ratio instead of a long list, ie:
    
            { .src = P_GPUPLL0_OUT_EVEN, .pre_div = 3 },
            { }
    
    So, lets support that.
    
    We need to fix a corner case in qcom_find_freq() where if the freq table
    is non-null, but has no frequencies, we end up returning an "entry" before
    the table array, which is bad.  Then, we need ignore the freq from the
    table, and instead base everything on the requested freq.
    
    Suggested-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@xxxxxxxxx>
    Link: https://lkml.kernel.org/r/20191031185715.15504-1-jeffrey.l.hugo@xxxxxxxxx
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c
index 1a0985ae20d2..a93439242565 100644
--- a/drivers/clk/qcom/clk-rcg2.c
+++ b/drivers/clk/qcom/clk-rcg2.c
@@ -212,6 +212,8 @@ static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f,
 	p = clk_hw_get_parent_by_index(hw, index);
 	if (clk_flags & CLK_SET_RATE_PARENT) {
 		if (f->pre_div) {
+			if (!rate)
+				rate = req->rate;
 			rate /= 2;
 			rate *= f->pre_div + 1;
 		}
diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index 28ceaf1e9937..ae9352f7706d 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -37,6 +37,9 @@ struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, unsigned long rate)
 	if (!f)
 		return NULL;
 
+	if (!f->freq)
+		return f;
+
 	for (; f->freq; f++)
 		if (rate <= f->freq)
 			return f;



[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