232-clk-mediatek-mt7981-topckgen-flag-SGM_REG_SEL-as-cri.patch 1.4 KB

123456789101112131415161718192021222324252627282930
  1. From fc157139e6b7f8dfb6430ac7191ba754027705e8 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Sun, 18 Feb 2024 01:59:59 +0000
  4. Subject: [PATCH] clk: mediatek: mt7981-topckgen: flag SGM_REG_SEL as critical
  5. Without the SGM_REG_SEL clock enabled the system freezes if trying to
  6. access registers used by MT7981 clock drivers itself.
  7. Mark SGM_REG_SEL as critical to make sure it is always enabled to
  8. prevent freezes on boot depending on probe order.
  9. Fixes: 813c3b53b55ba ("clk: mediatek: add MT7981 clock support")
  10. Signed-off-by: Daniel Golle <[email protected]>
  11. ---
  12. drivers/clk/mediatek/clk-mt7981-topckgen.c | 5 +++--
  13. 1 file changed, 3 insertions(+), 2 deletions(-)
  14. --- a/drivers/clk/mediatek/clk-mt7981-topckgen.c
  15. +++ b/drivers/clk/mediatek/clk-mt7981-topckgen.c
  16. @@ -359,8 +359,9 @@ static const struct mtk_mux top_muxes[]
  17. MUX_GATE_CLR_SET_UPD(CLK_TOP_SGM_325M_SEL, "sgm_325m_sel",
  18. sgm_325m_parents, 0x050, 0x054, 0x058, 8, 1, 15,
  19. 0x1C0, 21),
  20. - MUX_GATE_CLR_SET_UPD(CLK_TOP_SGM_REG_SEL, "sgm_reg_sel", sgm_reg_parents,
  21. - 0x050, 0x054, 0x058, 16, 1, 23, 0x1C0, 22),
  22. + MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_SGM_REG_SEL, "sgm_reg_sel", sgm_reg_parents,
  23. + 0x050, 0x054, 0x058, 16, 1, 23, 0x1C0, 22,
  24. + CLK_IS_CRITICAL | CLK_SET_RATE_PARENT),
  25. MUX_GATE_CLR_SET_UPD(CLK_TOP_EIP97B_SEL, "eip97b_sel", eip97b_parents,
  26. 0x050, 0x054, 0x058, 24, 3, 31, 0x1C0, 23),
  27. /* CLK_CFG_6 */