Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: qcom: clk-krait: unlock spin after mux completion

Unlock spinlock after the mux switch is completed to prevent any corner
case of mux request while the switch still needs to be done.

Fixes: 4d7dc77babfe ("clk: qcom: Add support for Krait clocks")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220430054458.31321-3-ansuelsmth@gmail.com

authored by

Ansuel Smith and committed by
Bjorn Andersson
df83d2c9 fcfbfe37

+6 -1
+6 -1
drivers/clk/qcom/clk-krait.c
··· 32 32 regval |= (sel & mux->mask) << (mux->shift + LPL_SHIFT); 33 33 } 34 34 krait_set_l2_indirect_reg(mux->offset, regval); 35 - spin_unlock_irqrestore(&krait_clock_reg_lock, flags); 36 35 37 36 /* Wait for switch to complete. */ 38 37 mb(); 39 38 udelay(1); 39 + 40 + /* 41 + * Unlock now to make sure the mux register is not 42 + * modified while switching to the new parent. 43 + */ 44 + spin_unlock_irqrestore(&krait_clock_reg_lock, flags); 40 45 } 41 46 42 47 static int krait_mux_set_parent(struct clk_hw *hw, u8 index)