diff options
| author | Akashdeep Kaur <a-kaur@ti.com> | 2026-06-03 12:54:38 +0530 |
|---|---|---|
| committer | Viresh Kumar <viresh.kumar@linaro.org> | 2026-06-08 11:16:42 +0530 |
| commit | b7a76f38ef3500d53ec87489c445fec8100c7a6b (patch) | |
| tree | 80d28c0b28e07c18858569f9c9ace20ef1f3e02c | |
| parent | 4b5d3b847218b466527fb98990e193874081e0c7 (diff) | |
cpufreq: ti: Add EPROBE_DEFER for K3 SoCs
On K3 SoCs, ti-cpufreq relies on k3-socinfo to register the SoC
device before soc_device_match() can return valid revision
information. If ti-cpufreq probes before k3-socinfo,
soc_device_match() returns NULL, leading to incorrect CPU frequency
scaling behavior.
Add a needs_k3_socinfo flag to ti_cpufreq_soc_data (similar to
the existing multi_regulator pattern) to defer probe when k3-socinfo
hasn't registered the SoC device yet.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
| -rw-r--r-- | drivers/cpufreq/ti-cpufreq.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c index a01abc1622eb..0f96492341f2 100644 --- a/drivers/cpufreq/ti-cpufreq.c +++ b/drivers/cpufreq/ti-cpufreq.c @@ -99,6 +99,7 @@ struct ti_cpufreq_soc_data { unsigned long efuse_shift; unsigned long rev_offset; bool multi_regulator; + bool needs_k3_socinfo; /* Backward compatibility hack: Might have missing syscon */ #define TI_QUIRK_SYSCON_MAY_BE_MISSING 0x1 /* Backward compatibility hack: new syscon size is 1 register wide */ @@ -347,6 +348,7 @@ static struct ti_cpufreq_soc_data am625_soc_data = { .efuse_mask = 0x07c0, .efuse_shift = 0x6, .multi_regulator = false, + .needs_k3_socinfo = true, .quirks = TI_QUIRK_SYSCON_IS_SINGLE_REG, }; @@ -356,6 +358,7 @@ static struct ti_cpufreq_soc_data am62a7_soc_data = { .efuse_mask = 0x07c0, .efuse_shift = 0x6, .multi_regulator = false, + .needs_k3_socinfo = true, }; static struct ti_cpufreq_soc_data am62l3_soc_data = { @@ -364,6 +367,7 @@ static struct ti_cpufreq_soc_data am62l3_soc_data = { .efuse_mask = 0x07c0, .efuse_shift = 0x6, .multi_regulator = false, + .needs_k3_socinfo = true, }; static struct ti_cpufreq_soc_data am62p5_soc_data = { @@ -372,6 +376,7 @@ static struct ti_cpufreq_soc_data am62p5_soc_data = { .efuse_mask = 0x07c0, .efuse_shift = 0x6, .multi_regulator = false, + .needs_k3_socinfo = true, }; /** @@ -443,6 +448,11 @@ static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data, goto done; } + /* Defer if k3-socinfo hasn't registered the SoC device yet */ + if (opp_data->soc_data->needs_k3_socinfo) + return dev_err_probe(opp_data->cpu_dev, -EPROBE_DEFER, + "SoC device not registered by k3-socinfo\n"); + ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, &revision); if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) { |
