kernel/ipq806x: Create kernel files for v6.6 (from v6.1)
[openwrt/openwrt.git] / target / linux / ipq806x / patches-6.6 / 002-v6.2-02-clk-qcom-krait-cc-fix-wrong-parent-order-for-seconda.patch
1 From 8e456411abcbf899c04740b9dbb3dcefcd61c946 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Wed, 9 Nov 2022 01:56:27 +0100
4 Subject: [PATCH 2/6] clk: qcom: krait-cc: fix wrong parent order for secondary
5 mux
6
7 The secondary mux parent order is swapped.
8 This currently doesn't cause problems as the secondary mux is used for idle
9 clk and as a safe clk source while reprogramming the hfpll.
10
11 Each mux have 2 or more output but he always have a safe source to
12 switch while reprogramming the connected pll. We use a clk notifier to
13 switch to the correct parent before clk core can apply the correct rate.
14 The parent to switch is hardcoded in the mux struct.
15
16 For the secondary mux the safe source to use is the qsb parent as it's
17 the only fixed clk as the acpus_aux is a pll that can source from pxo or
18 from pll8.
19
20 The hardcoded safe parent for the secondary mux is set to index 0 that
21 in the secondary mux map is set to 2.
22
23 But the index 0 is actually acpu_aux in the parent list.
24
25 Fix the swapped parents to correctly handle idle frequency and output a
26 sane clk_summary report.
27
28 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
29 Signed-off-by: Bjorn Andersson <andersson@kernel.org>
30 Link: https://lore.kernel.org/r/20221109005631.3189-1-ansuelsmth@gmail.com
31 ---
32 drivers/clk/qcom/krait-cc.c | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35 --- a/drivers/clk/qcom/krait-cc.c
36 +++ b/drivers/clk/qcom/krait-cc.c
37 @@ -116,8 +116,8 @@ krait_add_sec_mux(struct device *dev, in
38 int ret;
39 struct krait_mux_clk *mux;
40 static const char *sec_mux_list[] = {
41 - "acpu_aux",
42 "qsb",
43 + "acpu_aux",
44 };
45 struct clk_init_data init = {
46 .parent_names = sec_mux_list,