clk: qcom: dispcc-sc8280xp: remove CLK_SET_RATE_PARENT from byte_div_clk_src dividers
Subsystems (3)
PATCH 1/1 clk: qcom: dispcc-sc8280xp: remove CLK_SET_RATE_PARENT from byte_div_clk_src dividers
From: White Lewis <[email protected]>
The four byte_div_clk_src dividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) had CLK_SET_RATE_PARENT set. When the DSI driver calls clk_set_rate() on byte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.
A simiar issue had been also encountered on SM8750.b8501febdc51 ("clk: qcom: dispcc-sm8750: Drop incorrect CLK_SET_RATE_PARENT on byte intf parent").
Likewise, remove CLK_SET_RATE_PARENT from all four byte divider clocks so that clk_set_rate() on the divider adjusts only the divider ratio, leaving the parent PLL untouched.
--- drivers/clk/qcom/dispcc-sc8280xp.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/clk/qcom/dispcc-sc8280xp.c +0 -4
@@ -1160,7 +1160,6 @@ static struct clk_regmap_div disp0_cc_mdss_byte0_div_clk_src = { &disp0_cc_mdss_byte0_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, };
@@ -1175,7 +1174,6 @@ static struct clk_regmap_div disp1_cc_mdss_byte0_div_clk_src = { &disp1_cc_mdss_byte0_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, };
@@ -1190,7 +1188,6 @@ static struct clk_regmap_div disp0_cc_mdss_byte1_div_clk_src = { &disp0_cc_mdss_byte1_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, };
@@ -1205,7 +1202,6 @@ static struct clk_regmap_div disp1_cc_mdss_byte1_div_clk_src = { &disp1_cc_mdss_byte1_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, };
Signature · 1 line
2.53.0
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.
Quoted 5 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>---
Looks like more platforms have this issue.. thanks for fixing this
Konrad
Hi Pengyu and Konrad,
Quoted 15 lines · Konrad Dybcio
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.
Quoted 7 lines
Quoted 5 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>---
Looks like more platforms have this issue.. thanks for fixing this
I hope within the next week to post a new draft of my patch series to keep certain clk rates intact when sibling and parent rate changes occur [1]. This will be for certain critical clks, such as the ones used for DRM and sound. I have it working with kunit, and just need to clean up some of my new clk helpers and commit messages before I post a v5.
I'd like to test this on some real hardware and I have the Thinkpad x13s with the sc8280xp SoC. Can this issue be reproduced on this hardware? If so, can you provide me detailed instructions about how to trigger this scenario?
[1] Latest public posting v4 from September
https://lore.kernel.org/linux-clk/[email protected]/
Thanks,
Brian
Quoted 33 lines · Brian Masney
Hi Pengyu and Konrad,
Quoted 15 lines · Konrad Dybcio
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.Quoted 7 lines
Quoted 5 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>---
Looks like more platforms have this issue.. thanks for fixing this
I hope within the next week to post a new draft of my patch series to keep certain clk rates intact when sibling and parent rate changes occur [1]. This will be for certain critical clks, such as the ones used for DRM and sound. I have it working with kunit, and just need to clean up some of my new clk helpers and commit messages before I post a v5.
Quoted 5 lines
I'd like to test this on some real hardware and I have the Thinkpad x13s with the sc8280xp SoC. Can this issue be reproduced on this hardware? If so, can you provide me detailed instructions about how to trigger this scenario?
Quick answer, no, x13s uses a edp panel, not dsi. This issue is related to dsi clks.
Best wishes,
Pengyu
Quoted 7 lines
[1] Latest public posting v4 from September
https://lore.kernel.org/linux-clk/[email protected]/Thanks,
Brian
Quoted 31 lines · Pengyu Luo
Quoted 30 lines · Brian Masney
Quoted 15 lines · Konrad Dybcio
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.Quoted 7 lines
Quoted 5 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>---
Looks like more platforms have this issue.. thanks for fixing this
I hope within the next week to post a new draft of my patch series to keep certain clk rates intact when sibling and parent rate changes occur [1]. This will be for certain critical clks, such as the ones used for DRM and sound. I have it working with kunit, and just need to clean up some of my new clk helpers and commit messages before I post a v5.
Quoted 8 lines
Quoted 5 lines
I'd like to test this on some real hardware and I have the Thinkpad x13s with the sc8280xp SoC. Can this issue be reproduced on this hardware? If so, can you provide me detailed instructions about how to trigger this scenario?
Quick answer, no, x13s uses a edp panel, not dsi. This issue is related to dsi clks.
I posted my latest clk scaling work in an attempt to address the underlying issue here.
https://lore.kernel.org/linux-clk/[email protected]/T/#t
Feedback welcome!
Brian
Hi Qualcomm Folks,
Quoted 38 lines · Brian Masney
Quoted 37 lines · Pengyu Luo
Quoted 35 lines · Brian Masney
Quoted 15 lines · Konrad Dybcio
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.Quoted 7 lines
Quoted 5 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>---
Looks like more platforms have this issue.. thanks for fixing this
I hope within the next week to post a new draft of my patch series to keep certain clk rates intact when sibling and parent rate changes occur [1]. This will be for certain critical clks, such as the ones used for DRM and sound. I have it working with kunit, and just need to clean up some of my new clk helpers and commit messages before I post a v5.
I'd like to test this on some real hardware and I have the Thinkpad x13s with the sc8280xp SoC. Can this issue be reproduced on this hardware? If so, can you provide me detailed instructions about how to trigger this scenario?
Quoted 5 lines
Quoted 2 lines
Quick answer, no, x13s uses a edp panel, not dsi. This issue is related to dsi clks.
I posted my latest clk scaling work in an attempt to address the underlying issue here.
Ignore my previous patch set. In my v6 that I just posted, I updated clk-divider.c to support the new v2 clk negotiation logic. The clk_regmap_div_ops uses this driver, so you shouldn't have to make any code changes.
Anyways, would someone from Qualcomm be willing to test this? The procedure is fairly simple:
1) Back out the patch:
clk: qcom: dispcc-sc8280xp: remove CLK_SET_RATE_PARENT from byte_div_clk_src dividers (or one of the similar patches posted for other SoCs)
2) Apply my v6 series:
clk: add support for v1 / v2 clock rate negotiation and kunit tests
https://lore.kernel.org/linux-clk/[email protected]/T/#
3) Boot... everything should behave the same as prior to my patch set. The clk crash will still occur.
4) Reboot, and boot the kernel this time with the clk_v2_rate_negotiation kernel parameter to globally opt into the v2 negotiation logic. The clk crash hopefully shouldn't occur.
Thanks,
Brian
Quoted 7 lines · Brian Masney
Hi Qualcomm Folks,
Quoted 4 lines · Brian Masney
Quoted 3 lines · Pengyu Luo
Quoted 2 lines · Brian Masney
Quoted 1 line · Konrad Dybcio
On 3/3/26 12:55 PM, Pengyu Luo wrote:
[...]
Quoted 7 lines
Ignore my previous patch set. In my v6 that I just posted, I updated
clk-divider.cto support the new v2 clk negotiation logic. Theclk_regmap_div_opsuses this driver, so you shouldn't have to make any code changes.Anyways, would someone from Qualcomm be willing to test this? The procedure is fairly simple:
Unfortunately, I don't think it's easy to get your hands on a 8280 device with DSI.. maybe Pengyu could test that on his tablet/laptop.
Konrad
Hi Konrad,
Quoted 14 lines · Konrad Dybcio
Quoted 5 lines · Brian Masney
Quoted 4 lines · Brian Masney
Quoted 3 lines · Pengyu Luo
Quoted 2 lines · Brian Masney
Quoted 1 line · Konrad Dybcio
On 3/3/26 12:55 PM, Pengyu Luo wrote:
[...]
Quoted 5 lines
Ignore my previous patch set. In my v6 that I just posted, I updated
clk-divider.cto support the new v2 clk negotiation logic. Theclk_regmap_div_opsuses this driver, so you shouldn't have to make any code changes.
Quoted 5 lines
Quoted 2 lines
Anyways, would someone from Qualcomm be willing to test this? The procedure is fairly simple:
Unfortunately, I don't think it's easy to get your hands on a 8280 device with DSI.. maybe Pengyu could test that on his tablet/laptop.
It doesn't have to be an 8280 SoC. It could be any device that has the issue where the parent rate change screws up that portion of the clock tree, and crashes the device. This has been a long-standing issue in the clk framework. I know you recently posted a series for 5 other SoCs with a similar change [1], so any of those other devices should work as well.
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
The kunit tests in my clk scaling patch set demonstrate the issues that I have worked on. For example, in my test scenario, I start with a parent, and two children. The parent can do any rate. The two children are simple dividers. This is the current behavior today:
KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->parent_clk), 24 * HZ_PER_MHZ);
KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child1_clk), 24 * HZ_PER_MHZ);
KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child2_clk), 24 * HZ_PER_MHZ);
ret = clk_set_rate(ctx->child1_clk, 32 * HZ_PER_MHZ);
/*
* The last sibling rate change is the one that was successful, and
* wins. The parent, and two children are all changed to 32 MHz.
*/
KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->parent_clk), 32 * HZ_PER_MHZ);
KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child1_clk), 32 * HZ_PER_MHZ);
KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child2_clk), 32 * HZ_PER_MHZ);With my changes, the clk framework will land on 96 MHz for the parent, and 24 MHz and 32 MHz for the two children.
Anyways, it would be great if someone from Qualcomm would be willing to help me test my changes on real hardware. If it requires code changes to a specific clk provider, then I'm willing to also do that work if someone can test for me. Getting confirmation that this is fixed on real hardware will help to land my series that will provide a solution to this problem that has existing in the clk framework since it was introduced over 12 years ago.
Thanks,
Brian
Quoted 55 lines · Brian Masney
Hi Konrad,
Quoted 14 lines · Konrad Dybcio
Quoted 5 lines · Brian Masney
Quoted 4 lines · Brian Masney
Quoted 3 lines · Pengyu Luo
Quoted 2 lines · Brian Masney
Quoted 1 line · Konrad Dybcio
On 3/3/26 12:55 PM, Pengyu Luo wrote:
[...]
Quoted 5 lines
Ignore my previous patch set. In my v6 that I just posted, I updated
clk-divider.cto support the new v2 clk negotiation logic. Theclk_regmap_div_opsuses this driver, so you shouldn't have to make any code changes.Quoted 5 lines
Quoted 2 lines
Anyways, would someone from Qualcomm be willing to test this? The procedure is fairly simple:
Unfortunately, I don't think it's easy to get your hands on a 8280 device with DSI.. maybe Pengyu could test that on his tablet/laptop.
It doesn't have to be an 8280 SoC. It could be any device that has the issue where the parent rate change screws up that portion of the clock tree, and crashes the device. This has been a long-standing issue in the clk framework. I know you recently posted a series for 5 other SoCs with a similar change [1], so any of those other devices should work as well.
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
The kunit tests in my clk scaling patch set demonstrate the issues that I have worked on. For example, in my test scenario, I start with a parent, and two children. The parent can do any rate. The two children are simple dividers. This is the current behavior today:
KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->parent_clk), 24 * HZ_PER_MHZ); KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child1_clk), 24 * HZ_PER_MHZ); KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child2_clk), 24 * HZ_PER_MHZ); ret = clk_set_rate(ctx->child1_clk, 32 * HZ_PER_MHZ); /* * The last sibling rate change is the one that was successful, and * wins. The parent, and two children are all changed to 32 MHz. */ KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->parent_clk), 32 * HZ_PER_MHZ); KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child1_clk), 32 * HZ_PER_MHZ); KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child2_clk), 32 * HZ_PER_MHZ);With my changes, the clk framework will land on 96 MHz for the parent, and 24 MHz and 32 MHz for the two children.
Quoted 7 lines
Anyways, it would be great if someone from Qualcomm would be willing to help me test my changes on real hardware. If it requires code changes to a specific clk provider, then I'm willing to also do that work if someone can test for me. Getting confirmation that this is fixed on real hardware will help to land my series that will provide a solution to this problem that has existing in the clk framework since it was introduced over 12 years ago.
Was going through my inbox - do you still need the testing? I see that the last revision of the series (v6) is from march
Do I need anything other than just the series itself?
Konrad
Hi Konrad,
Quoted 62 lines · Konrad Dybcio
Quoted 53 lines · Brian Masney
Quoted 14 lines · Konrad Dybcio
Quoted 5 lines · Brian Masney
Quoted 4 lines · Brian Masney
Quoted 3 lines · Pengyu Luo
Quoted 2 lines · Brian Masney
Quoted 1 line · Konrad Dybcio
On 3/3/26 12:55 PM, Pengyu Luo wrote:
[...]
Quoted 5 lines
Ignore my previous patch set. In my v6 that I just posted, I updated
clk-divider.cto support the new v2 clk negotiation logic. Theclk_regmap_div_opsuses this driver, so you shouldn't have to make any code changes.Quoted 5 lines
Quoted 2 lines
Anyways, would someone from Qualcomm be willing to test this? The procedure is fairly simple:
Unfortunately, I don't think it's easy to get your hands on a 8280 device with DSI.. maybe Pengyu could test that on his tablet/laptop.
It doesn't have to be an 8280 SoC. It could be any device that has the issue where the parent rate change screws up that portion of the clock tree, and crashes the device. This has been a long-standing issue in the clk framework. I know you recently posted a series for 5 other SoCs with a similar change [1], so any of those other devices should work as well.
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
The kunit tests in my clk scaling patch set demonstrate the issues that I have worked on. For example, in my test scenario, I start with a parent, and two children. The parent can do any rate. The two children are simple dividers. This is the current behavior today:
KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->parent_clk), 24 * HZ_PER_MHZ); KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child1_clk), 24 * HZ_PER_MHZ); KUNIT_ASSERT_EQ(test, clk_get_rate(ctx->child2_clk), 24 * HZ_PER_MHZ); ret = clk_set_rate(ctx->child1_clk, 32 * HZ_PER_MHZ); /* * The last sibling rate change is the one that was successful, and * wins. The parent, and two children are all changed to 32 MHz. */ KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->parent_clk), 32 * HZ_PER_MHZ); KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child1_clk), 32 * HZ_PER_MHZ); KUNIT_EXPECT_EQ(test, clk_get_rate(ctx->child2_clk), 32 * HZ_PER_MHZ);With my changes, the clk framework will land on 96 MHz for the parent, and 24 MHz and 32 MHz for the two children.
Quoted 7 lines
Anyways, it would be great if someone from Qualcomm would be willing to help me test my changes on real hardware. If it requires code changes to a specific clk provider, then I'm willing to also do that work if someone can test for me. Getting confirmation that this is fixed on real hardware will help to land my series that will provide a solution to this problem that has existing in the clk framework since it was introduced over 12 years ago.
Quoted 2 lines
Was going through my inbox - do you still need the testing? I see that the last revision of the series (v6) is from march
The latest version of my clk scaling is v8 from March.
https://lore.kernel.org/linux-clk/[email protected]/
It's honestly stuck in limbo right now. It fixes a real issue that you can see from the kunit tests, and I'm happy with how simple it is now. The series is kind of stuck though. It would be very helpful if you could talk to some folks within QC that work on the clk drivers to see if they would be willing to help test since it's making systems run suboptimal. Crashes can occur on some devices when you switch between different types of displays based on older reports.
I submitted a talk to Linux Plumbers for the Power Management / Thermal MC to talk about this, and current state of sync_state support in clk.
Brian
Quoted 14 lines · Pengyu Luo
From: White Lewis <[email protected]>
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").Likewise, remove
CLK_SET_RATE_PARENTfrom all four byte divider clocks so thatclk_set_rate()on the divider adjusts only the divider ratio, leaving the parent PLL untouched.
Quoted 8 lines
Fixes 4a66e76fdb6d ("clk: qcom: Add SC8280XP display clock controller")Signed-off-by White Lewis <[email protected]>[pengyu: reword]Signed-off-by Pengyu Luo <[email protected]>--- drivers/clk/qcom/dispcc-sc8280xp.c | 4 ---- 1 file changed, 4 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Quoted 9 lines · Pengyu Luo
The four
byte_div_clk_srcdividers (disp{0,1}_cc_mdss_byte{0,1}_div_clk_src) hadCLK_SET_RATE_PARENTset. When the DSI driver callsclk_set_rate()onbyte_intf_clk, the rate-change propagates through the divider up to the parent PLL (byte_clk_src), halving the byte clock rate.A simiar issue had been also encountered on SM8750.
b8501febdc51("clk: qcom: dispcc-sm8750: Drop incorrectCLK_SET_RATE_PARENTon byte intf parent").[...]
Applied, thanks!
[1/1] clk: qcom: dispcc-sc8280xp: remove CLK_SET_RATE_PARENT from byte_div_clk_src dividers
commit: 0b151a6307205eb867250985a910a88787cbf12e
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>