clk: qcom: clk-alpha-pll: Fix pll post div mask when width is not set
Subsystems (3)
PATCH v2 1/1 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.
---
Changes in v2:
- Pass 3 to GENMASK instead of 0.
- Add more Fixes tag for reference root cause.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- drivers/clk/qcom/clk-alpha-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/qcom/clk-alpha-pll.c +1 -1
@@ -40,7 +40,7 @@#define PLL_USER_CTL (p) ((p)->offset + (p)->regs[PLL_OFF_USER_CTL])# define PLL_POST_DIV_SHIFT 8 -# define PLL_POST_DIV_MASK (p) GENMASK((p)->width - 1, 0) +# define PLL_POST_DIV_MASK (p) GENMASK((p)->width ? (p)->width - 1 : 3, 0)# define PLL_ALPHA_MSB BIT(15)# define PLL_ALPHA_EN BIT(24)# define PLL_ALPHA_MODE BIT(25)
---
base-commit: 62f92d634458a1e308bb699986b9147a6d670457
change-id: 20240925-fix-postdiv-mask-ba47ecd23ea3
Best regards,
Signature · 1 line
Barnabás Czémán <[email protected]>
Quoted 6 lines · Barnabás Czémán
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 1c3541145cbf ("clk: qcom: support for 2 bit PLL post divider")Fixes 2c4553e6c485 ("clk: qcom: clk-alpha-pll: Fix the pll post div mask")
I think one Fixes tag should be enough.
Nevertheless,
Quoted 9 lines
Signed-off-by Barnabás Czémán <[email protected]>---
Changes in v2:
- Pass 3 to GENMASK instead of 0.
- Add more Fixes tag for reference root cause.
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/clk/qcom/clk-alpha-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes Dmitry
Quoted 9 lines · Dmitry Baryshkov
Quoted 6 lines · Barnabás Czémán
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 1c3541145cbf ("clk: qcom: support for 2 bit PLL post divider")Fixes 2c4553e6c485 ("clk: qcom: clk-alpha-pll: Fix the pll post div mask")I think one Fixes tag should be enough.
Should I send a v3 remove one of them or not needed?
Quoted 15 lines
Nevertheless,
Reviewed-by Dmitry Baryshkov <[email protected]>Quoted 10 lines
Signed-off-by Barnabás Czémán <[email protected]>---
Changes in v2:
- Pass 3 to GENMASK instead of 0.
- Add more Fixes tag for reference root cause.
- Link to v1:
https://lore.kernel.org/r/[email protected]--- drivers/clk/qcom/clk-alpha-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines · On Sat, Sep 28, 2024 at 07:05:39PM GMT, [email protected] wrote:
Quoted 6 lines · Dmitry Baryshkov
Quoted 5 lines · Barnabás Czémán
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.
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Fixes 1c3541145cbf ("clk: qcom: support for 2 bit PLL post divider")Fixes 2c4553e6c485 ("clk: qcom: clk-alpha-pll: Fix the pll post divmask")
I think one Fixes tag should be enough.
Should I send a v3 remove one of them or not needed?
Judging by the lack of the response, please resend, dropping the extra tag.
Quoted 14 lines
Quoted 14 lines
Nevertheless,
Reviewed-by Dmitry Baryshkov <[email protected]>Quoted 9 lines
Signed-off-by Barnabás Czémán <[email protected]>---
Changes in v2:
- Pass 3 to GENMASK instead of 0.
- Add more Fixes tag for reference root cause.
- Link to v1: https://lore.kernel.org/r/[email protected]--- drivers/clk/qcom/clk-alpha-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes Dmitry