Skip to content

Commit e02bfea

Browse files
barni2000andersson
authored andcommitted
clk: qcom: clk-alpha-pll: Fix pll post div mask when width is not set
Many qcom clock drivers do not have .width set. In that case value of (p)->width - 1 will be negative which breaks clock tree. Fix this by checking if width is zero, and pass 3 to GENMASK if that's the case. Fixes: 1c35411 ("clk: qcom: support for 2 bit PLL post divider") Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Christopher Obbard <christopher.obbard@linaro.org> Tested-by: Christopher Obbard <christopher.obbard@linaro.org> Link: https://lore.kernel.org/r/20241006-fix-postdiv-mask-v3-1-160354980433@mainlining.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent f903663 commit e02bfea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/qcom/clk-alpha-pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#define PLL_USER_CTL(p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])
4242
# define PLL_POST_DIV_SHIFT 8
43-
# define PLL_POST_DIV_MASK(p) GENMASK((p)->width - 1, 0)
43+
# define PLL_POST_DIV_MASK(p) GENMASK((p)->width ? (p)->width - 1 : 3, 0)
4444
# define PLL_ALPHA_MSB BIT(15)
4545
# define PLL_ALPHA_EN BIT(24)
4646
# define PLL_ALPHA_MODE BIT(25)

0 commit comments

Comments
 (0)