* [PATCH 0/2] clk: qcom: clk-rpmh: Make all VRMs optional by default
@ 2026-04-12 15:30 Alexander Koskovich
2026-04-12 15:30 ` [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" Alexander Koskovich
2026-04-12 15:30 ` [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich
0 siblings, 2 replies; 8+ messages in thread
From: Alexander Koskovich @ 2026-04-12 15:30 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd
Cc: linux-arm-msm, linux-clk, linux-kernel, Alexander Koskovich
This series is meant to resolve an issue seen on the Nothing Phone (4a) Pro
(Eliza) where probe fails due to RPMH_RF_CLK5 not being present on this board.
The existing clka_optional mechanism does not cover rfclka also being missing,
so just mirror the downstream approach of marking all VRMs as optional instead
of expanding the check to include rfclka.
Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
---
Alexander Koskovich (2):
Revert "clk: qcom: rpmh: make clkaN optional"
clk: qcom: clk-rpmh: Make all VRMs optional by default
drivers/clk/qcom/clk-rpmh.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
---
base-commit: 591cd656a1bf5ea94a222af5ef2ee76df029c1d2
change-id: 20260412-clk-rpmh-vrm-opt-78b97cf451ba
Best regards,
--
Alexander Koskovich <akoskovich@pm.me>
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" 2026-04-12 15:30 [PATCH 0/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich @ 2026-04-12 15:30 ` Alexander Koskovich 2026-04-12 17:10 ` Dmitry Baryshkov 2026-04-12 15:30 ` [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich 1 sibling, 1 reply; 8+ messages in thread From: Alexander Koskovich @ 2026-04-12 15:30 UTC (permalink / raw) To: Bjorn Andersson, Michael Turquette, Stephen Boyd Cc: linux-arm-msm, linux-clk, linux-kernel, Alexander Koskovich This reverts commit 166e65bc6ce317be41368d9340b870edbdbaa2aa. Reason for revert: Better handled by just marking all VRMs as optional, instead of needing to mark for each platform, done in follow up change. Signed-off-by: Alexander Koskovich <akoskovich@pm.me> --- drivers/clk/qcom/clk-rpmh.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index 547729b1a8ee..fc99c2c305da 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -66,8 +66,6 @@ struct clk_rpmh { struct clk_rpmh_desc { struct clk_hw **clks; size_t num_clks; - /* RPMh clock clkaN are optional for this platform */ - bool clka_optional; }; static DEFINE_MUTEX(rpmh_clk_lock); @@ -691,7 +689,6 @@ static struct clk_hw *sm8550_rpmh_clocks[] = { static const struct clk_rpmh_desc clk_rpmh_sm8550 = { .clks = sm8550_rpmh_clocks, .num_clks = ARRAY_SIZE(sm8550_rpmh_clocks), - .clka_optional = true, }; static struct clk_hw *sm8650_rpmh_clocks[] = { @@ -723,7 +720,6 @@ static struct clk_hw *sm8650_rpmh_clocks[] = { static const struct clk_rpmh_desc clk_rpmh_sm8650 = { .clks = sm8650_rpmh_clocks, .num_clks = ARRAY_SIZE(sm8650_rpmh_clocks), - .clka_optional = true, }; static struct clk_hw *sc7280_rpmh_clocks[] = { @@ -893,7 +889,6 @@ static struct clk_hw *sm8750_rpmh_clocks[] = { static const struct clk_rpmh_desc clk_rpmh_sm8750 = { .clks = sm8750_rpmh_clocks, .num_clks = ARRAY_SIZE(sm8750_rpmh_clocks), - .clka_optional = true, }; static struct clk_hw *glymur_rpmh_clocks[] = { @@ -981,12 +976,6 @@ static int clk_rpmh_probe(struct platform_device *pdev) rpmh_clk = to_clk_rpmh(hw_clks[i]); res_addr = cmd_db_read_addr(rpmh_clk->res_name); if (!res_addr) { - hw_clks[i] = NULL; - - if (desc->clka_optional && - !strncmp(rpmh_clk->res_name, "clka", sizeof("clka") - 1)) - continue; - dev_err(&pdev->dev, "missing RPMh resource address for %s\n", rpmh_clk->res_name); return -ENODEV; -- 2.53.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" 2026-04-12 15:30 ` [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" Alexander Koskovich @ 2026-04-12 17:10 ` Dmitry Baryshkov 2026-04-12 17:22 ` Alexander Koskovich 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Baryshkov @ 2026-04-12 17:10 UTC (permalink / raw) To: Alexander Koskovich Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel On Sun, Apr 12, 2026 at 03:30:52PM +0000, Alexander Koskovich wrote: > This reverts commit 166e65bc6ce317be41368d9340b870edbdbaa2aa. > > Reason for revert: Better handled by just marking all VRMs as optional, > instead of needing to mark for each platform, done in follow up change. > > Signed-off-by: Alexander Koskovich <akoskovich@pm.me> > --- > drivers/clk/qcom/clk-rpmh.c | 11 ----------- > 1 file changed, 11 deletions(-) > If this gets landed, then between this and the next commit the tree becomes broken, which is not nice if you ever try running git bisect. Either squash both commits together or change the order, so that the affected VRMs are first marked as optional and then you drop the clkaN_optional handling. -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" 2026-04-12 17:10 ` Dmitry Baryshkov @ 2026-04-12 17:22 ` Alexander Koskovich 0 siblings, 0 replies; 8+ messages in thread From: Alexander Koskovich @ 2026-04-12 17:22 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel On Sunday, April 12th, 2026 at 1:10 PM, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote: > On Sun, Apr 12, 2026 at 03:30:52PM +0000, Alexander Koskovich wrote: > > This reverts commit 166e65bc6ce317be41368d9340b870edbdbaa2aa. > > > > Reason for revert: Better handled by just marking all VRMs as optional, > > instead of needing to mark for each platform, done in follow up change. > > > > Signed-off-by: Alexander Koskovich <akoskovich@pm.me> > > --- > > drivers/clk/qcom/clk-rpmh.c | 11 ----------- > > 1 file changed, 11 deletions(-) > > > > If this gets landed, then between this and the next commit the tree > becomes broken, which is not nice if you ever try running git bisect. > Either squash both commits together or change the order, so that the > affected VRMs are first marked as optional and then you drop the > clkaN_optional handling. Got it, will fix in v2. > > -- > With best wishes > Dmitry > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default 2026-04-12 15:30 [PATCH 0/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich 2026-04-12 15:30 ` [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" Alexander Koskovich @ 2026-04-12 15:30 ` Alexander Koskovich 2026-04-13 8:48 ` Konrad Dybcio 1 sibling, 1 reply; 8+ messages in thread From: Alexander Koskovich @ 2026-04-12 15:30 UTC (permalink / raw) To: Bjorn Andersson, Michael Turquette, Stephen Boyd Cc: linux-arm-msm, linux-clk, linux-kernel, Alexander Koskovich Some VRMs aren't present on all boards, so mark them as optional. This prevents probe failures on boards where not all VRMs are present. This mirrors the downstream approach for this issue. Signed-off-by: Alexander Koskovich <akoskovich@pm.me> --- drivers/clk/qcom/clk-rpmh.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c index fc99c2c305da..3e029d82e733 100644 --- a/drivers/clk/qcom/clk-rpmh.c +++ b/drivers/clk/qcom/clk-rpmh.c @@ -52,6 +52,7 @@ struct clk_rpmh { struct clk_hw hw; const char *res_name; u8 div; + bool optional; u32 res_addr; u32 res_on_val; u32 state; @@ -71,13 +72,14 @@ struct clk_rpmh_desc { static DEFINE_MUTEX(rpmh_clk_lock); #define __DEFINE_CLK_RPMH(_name, _clk_name, _res_name, \ - _res_en_offset, _res_on, _div) \ + _res_en_offset, _res_on, _div, _optional) \ static struct clk_rpmh clk_rpmh_##_clk_name##_ao; \ static struct clk_rpmh clk_rpmh_##_clk_name = { \ .res_name = _res_name, \ .res_addr = _res_en_offset, \ .res_on_val = _res_on, \ .div = _div, \ + .optional = _optional, \ .peer = &clk_rpmh_##_clk_name##_ao, \ .valid_state_mask = (BIT(RPMH_WAKE_ONLY_STATE) | \ BIT(RPMH_ACTIVE_ONLY_STATE) | \ @@ -97,6 +99,7 @@ static DEFINE_MUTEX(rpmh_clk_lock); .res_addr = _res_en_offset, \ .res_on_val = _res_on, \ .div = _div, \ + .optional = _optional, \ .peer = &clk_rpmh_##_clk_name, \ .valid_state_mask = (BIT(RPMH_WAKE_ONLY_STATE) | \ BIT(RPMH_ACTIVE_ONLY_STATE)), \ @@ -113,11 +116,11 @@ static DEFINE_MUTEX(rpmh_clk_lock); #define DEFINE_CLK_RPMH_ARC(_name, _res_name, _res_on, _div) \ __DEFINE_CLK_RPMH(_name, _name##_##div##_div, _res_name, \ - CLK_RPMH_ARC_EN_OFFSET, _res_on, _div) + CLK_RPMH_ARC_EN_OFFSET, _res_on, _div, false) #define DEFINE_CLK_RPMH_VRM(_name, _suffix, _res_name, _div) \ __DEFINE_CLK_RPMH(_name, _name##_suffix, _res_name, \ - CLK_RPMH_VRM_EN_OFFSET, 1, _div) + CLK_RPMH_VRM_EN_OFFSET, 1, _div, true) #define DEFINE_CLK_RPMH_BCM(_name, _res_name) \ static struct clk_rpmh clk_rpmh_##_name = { \ @@ -946,6 +949,9 @@ static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec, return ERR_PTR(-EINVAL); } + if (!rpmh->clks[idx]) + return ERR_PTR(-ENOENT); + return rpmh->clks[idx]; } @@ -976,6 +982,11 @@ static int clk_rpmh_probe(struct platform_device *pdev) rpmh_clk = to_clk_rpmh(hw_clks[i]); res_addr = cmd_db_read_addr(rpmh_clk->res_name); if (!res_addr) { + hw_clks[i] = NULL; + + if (rpmh_clk->optional) + continue; + dev_err(&pdev->dev, "missing RPMh resource address for %s\n", rpmh_clk->res_name); return -ENODEV; -- 2.53.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default 2026-04-12 15:30 ` [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich @ 2026-04-13 8:48 ` Konrad Dybcio 2026-04-13 9:02 ` Alexander Koskovich 0 siblings, 1 reply; 8+ messages in thread From: Konrad Dybcio @ 2026-04-13 8:48 UTC (permalink / raw) To: Alexander Koskovich, Bjorn Andersson, Michael Turquette, Stephen Boyd Cc: linux-arm-msm, linux-clk, linux-kernel On 4/12/26 5:30 PM, Alexander Koskovich wrote: > Some VRMs aren't present on all boards, so mark them as optional. This > prevents probe failures on boards where not all VRMs are present. > > This mirrors the downstream approach for this issue. > > Signed-off-by: Alexander Koskovich <akoskovich@pm.me> > --- [...] > @@ -976,6 +982,11 @@ static int clk_rpmh_probe(struct platform_device *pdev) > rpmh_clk = to_clk_rpmh(hw_clks[i]); > res_addr = cmd_db_read_addr(rpmh_clk->res_name); > if (!res_addr) { > + hw_clks[i] = NULL; > + > + if (rpmh_clk->optional) > + continue; if (rpmh_clk->offset == CLK_RPMH_VRM_EN_OFFSET)? That would let you drop the rest of the patch. This also needs some additional background.. I would assume this comes from a slightly different HW (PMIC) configuration Could you please do `grep ^ /sys/kernel/debug/qcom_socinfo/*`, (perhaps censoring your serial number)? Konrad ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default 2026-04-13 8:48 ` Konrad Dybcio @ 2026-04-13 9:02 ` Alexander Koskovich 2026-04-14 8:27 ` Konrad Dybcio 0 siblings, 1 reply; 8+ messages in thread From: Alexander Koskovich @ 2026-04-13 9:02 UTC (permalink / raw) To: Konrad Dybcio Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel On Monday, April 13th, 2026 at 4:48 AM, Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> wrote: > On 4/12/26 5:30 PM, Alexander Koskovich wrote: > > Some VRMs aren't present on all boards, so mark them as optional. This > > prevents probe failures on boards where not all VRMs are present. > > > > This mirrors the downstream approach for this issue. > > > > Signed-off-by: Alexander Koskovich <akoskovich@pm.me> > > --- > > [...] > > > @@ -976,6 +982,11 @@ static int clk_rpmh_probe(struct platform_device *pdev) > > rpmh_clk = to_clk_rpmh(hw_clks[i]); > > res_addr = cmd_db_read_addr(rpmh_clk->res_name); > > if (!res_addr) { > > + hw_clks[i] = NULL; > > + > > + if (rpmh_clk->optional) > > + continue; > > if (rpmh_clk->offset == CLK_RPMH_VRM_EN_OFFSET)? > > That would let you drop the rest of the patch. > > This also needs some additional background.. I would assume this comes from > a slightly different HW (PMIC) configuration > > Could you please do `grep ^ /sys/kernel/debug/qcom_socinfo/*`, (perhaps > censoring your serial number)? /sys/kernel/debug/qcom_socinfo/accessory_chip:0 /sys/kernel/debug/qcom_socinfo/boot_cluster:0 /sys/kernel/debug/qcom_socinfo/boot_core:0 /sys/kernel/debug/qcom_socinfo/build_id: /sys/kernel/debug/qcom_socinfo/chip_family:0x0000009f /sys/kernel/debug/qcom_socinfo/chip_id:SM7750 /sys/kernel/debug/qcom_socinfo/feature_code:2 /sys/kernel/debug/qcom_socinfo/foundry_id:1 /sys/kernel/debug/qcom_socinfo/hardware_platform:11 /sys/kernel/debug/qcom_socinfo/hardware_platform_subtype:0 /sys/kernel/debug/qcom_socinfo/info_fmt:0x00000016 /sys/kernel/debug/qcom_socinfo/ncluster_array_offset:228 /sys/kernel/debug/qcom_socinfo/nmodem_supported:4294967295 /sys/kernel/debug/qcom_socinfo/nproduct_id:1135 /sys/kernel/debug/qcom_socinfo/nsubset_parts_array_offset:232 /sys/kernel/debug/qcom_socinfo/num_clusters:1 /sys/kernel/debug/qcom_socinfo/num_func_clusters:1 /sys/kernel/debug/qcom_socinfo/num_subset_parts:20 /sys/kernel/debug/qcom_socinfo/oem_variant:0 /sys/kernel/debug/qcom_socinfo/pcode:1 /sys/kernel/debug/qcom_socinfo/platform_version:65536 /sys/kernel/debug/qcom_socinfo/pmic_die_rev:2.1 /sys/kernel/debug/qcom_socinfo/pmic_model:PMK8550 /sys/kernel/debug/qcom_socinfo/pmic_model_array:PMK8550 2.1 /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM7550 1.1 /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM8550VS 2.0 /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM8550VS 2.0 /sys/kernel/debug/qcom_socinfo/pmic_model_array:unknown (90) /sys/kernel/debug/qcom_socinfo/pmic_model_array:PMR735D 2.0 /sys/kernel/debug/qcom_socinfo/raw_device_family:0x0000000a /sys/kernel/debug/qcom_socinfo/raw_device_number:0x0000001d /sys/kernel/debug/qcom_socinfo/raw_package_type:0 /sys/kernel/debug/qcom_socinfo/raw_version:0 > > Konrad > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default 2026-04-13 9:02 ` Alexander Koskovich @ 2026-04-14 8:27 ` Konrad Dybcio 0 siblings, 0 replies; 8+ messages in thread From: Konrad Dybcio @ 2026-04-14 8:27 UTC (permalink / raw) To: Alexander Koskovich, Abel Vesa Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, linux-arm-msm, linux-clk, linux-kernel On 4/13/26 11:02 AM, Alexander Koskovich wrote: > On Monday, April 13th, 2026 at 4:48 AM, Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> wrote: > >> On 4/12/26 5:30 PM, Alexander Koskovich wrote: >>> Some VRMs aren't present on all boards, so mark them as optional. This >>> prevents probe failures on boards where not all VRMs are present. >>> >>> This mirrors the downstream approach for this issue. >>> >>> Signed-off-by: Alexander Koskovich <akoskovich@pm.me> >>> --- >> >> [...] >> >>> @@ -976,6 +982,11 @@ static int clk_rpmh_probe(struct platform_device *pdev) >>> rpmh_clk = to_clk_rpmh(hw_clks[i]); >>> res_addr = cmd_db_read_addr(rpmh_clk->res_name); >>> if (!res_addr) { >>> + hw_clks[i] = NULL; >>> + >>> + if (rpmh_clk->optional) >>> + continue; >> >> if (rpmh_clk->offset == CLK_RPMH_VRM_EN_OFFSET)? >> >> That would let you drop the rest of the patch. >> >> This also needs some additional background.. I would assume this comes from >> a slightly different HW (PMIC) configuration >> >> Could you please do `grep ^ /sys/kernel/debug/qcom_socinfo/*`, (perhaps >> censoring your serial number)? > > /sys/kernel/debug/qcom_socinfo/accessory_chip:0 > /sys/kernel/debug/qcom_socinfo/boot_cluster:0 > /sys/kernel/debug/qcom_socinfo/boot_core:0 > /sys/kernel/debug/qcom_socinfo/build_id: > /sys/kernel/debug/qcom_socinfo/chip_family:0x0000009f > /sys/kernel/debug/qcom_socinfo/chip_id:SM7750 > /sys/kernel/debug/qcom_socinfo/feature_code:2 > /sys/kernel/debug/qcom_socinfo/foundry_id:1 > /sys/kernel/debug/qcom_socinfo/hardware_platform:11 > /sys/kernel/debug/qcom_socinfo/hardware_platform_subtype:0 > /sys/kernel/debug/qcom_socinfo/info_fmt:0x00000016 > /sys/kernel/debug/qcom_socinfo/ncluster_array_offset:228 > /sys/kernel/debug/qcom_socinfo/nmodem_supported:4294967295 > /sys/kernel/debug/qcom_socinfo/nproduct_id:1135 > /sys/kernel/debug/qcom_socinfo/nsubset_parts_array_offset:232 > /sys/kernel/debug/qcom_socinfo/num_clusters:1 > /sys/kernel/debug/qcom_socinfo/num_func_clusters:1 > /sys/kernel/debug/qcom_socinfo/num_subset_parts:20 > /sys/kernel/debug/qcom_socinfo/oem_variant:0 > /sys/kernel/debug/qcom_socinfo/pcode:1 > /sys/kernel/debug/qcom_socinfo/platform_version:65536 > /sys/kernel/debug/qcom_socinfo/pmic_die_rev:2.1 > /sys/kernel/debug/qcom_socinfo/pmic_model:PMK8550 > /sys/kernel/debug/qcom_socinfo/pmic_model_array:PMK8550 2.1 > /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM7550 1.1 > /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM8550VS 2.0 > /sys/kernel/debug/qcom_socinfo/pmic_model_array:PM8550VS 2.0 > /sys/kernel/debug/qcom_socinfo/pmic_model_array:unknown (90) > /sys/kernel/debug/qcom_socinfo/pmic_model_array:PMR735D 2.0 So you have: your phone vs Abel's Eliza-MTP PMK8550 PMK8550 PM7550 PM7550 PM8550VS PM8550VS PM8550VS PM8550VS PMIV0102 (90) PM7550BA [!] PMR735D PMR735D PM8010 [!] PM8010 [!] And hence the difference, makes sense Konrad ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-04-14 8:27 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-04-12 15:30 [PATCH 0/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich 2026-04-12 15:30 ` [PATCH 1/2] Revert "clk: qcom: rpmh: make clkaN optional" Alexander Koskovich 2026-04-12 17:10 ` Dmitry Baryshkov 2026-04-12 17:22 ` Alexander Koskovich 2026-04-12 15:30 ` [PATCH 2/2] clk: qcom: clk-rpmh: Make all VRMs optional by default Alexander Koskovich 2026-04-13 8:48 ` Konrad Dybcio 2026-04-13 9:02 ` Alexander Koskovich 2026-04-14 8:27 ` Konrad Dybcio
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®