Skip to content

Commit 166e65b

Browse files
right-0903andersson
authored andcommitted
clk: qcom: rpmh: make clkaN optional
On SM8650, clkaN are missing in cmd-db for some specific devices. This caused a boot failure. Printing log during initramfs phase, I found [ 0.053281] clk-rpmh 17a00000.rsc:clock-controller: missing RPMh resource address for clka1 Adding the optional property to avoid probing failure which causes countless deferred probe. In the downstream tree,similar workarounds are introduced for SM7635, SM8550, SM8635, SM8650, SM8750. Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com> Link: https://lore.kernel.org/r/20250413172205.175789-1-mitltlatltl@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 1003cea commit 166e65b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/clk/qcom/clk-rpmh.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ struct clk_rpmh {
6666
struct clk_rpmh_desc {
6767
struct clk_hw **clks;
6868
size_t num_clks;
69+
/* RPMh clock clkaN are optional for this platform */
70+
bool clka_optional;
6971
};
7072

7173
static DEFINE_MUTEX(rpmh_clk_lock);
@@ -648,6 +650,7 @@ static struct clk_hw *sm8550_rpmh_clocks[] = {
648650
static const struct clk_rpmh_desc clk_rpmh_sm8550 = {
649651
.clks = sm8550_rpmh_clocks,
650652
.num_clks = ARRAY_SIZE(sm8550_rpmh_clocks),
653+
.clka_optional = true,
651654
};
652655

653656
static struct clk_hw *sm8650_rpmh_clocks[] = {
@@ -679,6 +682,7 @@ static struct clk_hw *sm8650_rpmh_clocks[] = {
679682
static const struct clk_rpmh_desc clk_rpmh_sm8650 = {
680683
.clks = sm8650_rpmh_clocks,
681684
.num_clks = ARRAY_SIZE(sm8650_rpmh_clocks),
685+
.clka_optional = true,
682686
};
683687

684688
static struct clk_hw *sc7280_rpmh_clocks[] = {
@@ -847,6 +851,7 @@ static struct clk_hw *sm8750_rpmh_clocks[] = {
847851
static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
848852
.clks = sm8750_rpmh_clocks,
849853
.num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
854+
.clka_optional = true,
850855
};
851856

852857
static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
@@ -890,6 +895,12 @@ static int clk_rpmh_probe(struct platform_device *pdev)
890895
rpmh_clk = to_clk_rpmh(hw_clks[i]);
891896
res_addr = cmd_db_read_addr(rpmh_clk->res_name);
892897
if (!res_addr) {
898+
hw_clks[i] = NULL;
899+
900+
if (desc->clka_optional &&
901+
!strncmp(rpmh_clk->res_name, "clka", sizeof("clka") - 1))
902+
continue;
903+
893904
dev_err(&pdev->dev, "missing RPMh resource address for %s\n",
894905
rpmh_clk->res_name);
895906
return -ENODEV;

0 commit comments

Comments
 (0)