* [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs
@ 2026-04-01 10:53 Akashdeep Kaur
2026-04-01 10:53 ` [PATCH v2 1/6] cpufreq: ti: Add EPROBE_DEFER " Akashdeep Kaur
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:53 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
For K3 SoCs, ti-cpufreq depends on k3-socinfo to provide SoC revision
information via soc_device_match(). If ti-cpufreq probes before
k3-socinfo, soc_device_match() returns NULL, causing incorrect
revision detection and OPP table initialization failures.
Add EPROBE_DEFER handling in ti-cpufreq when soc_device_match() fails
for K3 SoCs, ensuring k3-socinfo probes first.
Add device link support via a new DT property "ti,soc-info" in CPU
OPP tables. Device links prevent unbinding k3-socinfo while
ti-cpufreq is using it.
EPROBE_DEFER handles first-boot probe ordering, while device links
provide runtime dependency management.
For backward compatibility, the DT property is optional.
Changes in v2
- Added DT bindings documentation for ti,soc-info property
- Reordered patches: bindings first, then driver changes, then DTS
- Link to v1: https://lore.kernel.org/all/20260330120105.2985200-1-a-kaur@ti.com/
Testing
- Verified correct probe ordering on AM625, AM62A7, AM62P5 platforms
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
Akashdeep Kaur (6):
cpufreq: ti: Add EPROBE_DEFER for K3 SoCs
dt-bindings: opp: ti-cpu: Add ti,soc-info property
cpufreq: ti: Add device link to k3-socinfo
arm64: dts: ti: k3-am625: Add ti,soc-info to OPP table
arm64: dts: ti: k3-am62a7: Add ti,soc-info to OPP table
arm64: dts: ti: k3-am62p5: Add ti,soc-info to OPP table
.../opp/operating-points-v2-ti-cpu.yaml | 11 ++++
arch/arm64/boot/dts/ti/k3-am625.dtsi | 1 +
arch/arm64/boot/dts/ti/k3-am62a7.dtsi | 1 +
arch/arm64/boot/dts/ti/k3-am62p5.dtsi | 1 +
drivers/cpufreq/ti-cpufreq.c | 61 +++++++++++++++++++
5 files changed, 75 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/6] cpufreq: ti: Add EPROBE_DEFER for K3 SoCs
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
@ 2026-04-01 10:53 ` Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property Akashdeep Kaur
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:53 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Defer probe when k3-socinfo hasn't registered the SoC device yet.
Fixes incorrect revision detection when ti-cpufreq probes first.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
drivers/cpufreq/ti-cpufreq.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c
index 3d1129aeed02..88f7912ef6a8 100644
--- a/drivers/cpufreq/ti-cpufreq.c
+++ b/drivers/cpufreq/ti-cpufreq.c
@@ -441,6 +441,15 @@ static int ti_cpufreq_get_rev(struct ti_cpufreq_data *opp_data,
*/
*revision_value = 0x1;
goto done;
+ } else if (opp_data->soc_data == &am625_soc_data ||
+ opp_data->soc_data == &am62a7_soc_data ||
+ opp_data->soc_data == &am62l3_soc_data ||
+ opp_data->soc_data == &am62p5_soc_data) {
+ /*
+ * For K3 SoCs, if soc_device_match fails, socinfo hasn't
+ * probed yet. Defer probe to wait for it.
+ */
+ return -EPROBE_DEFER;
}
ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset,
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
2026-04-01 10:53 ` [PATCH v2 1/6] cpufreq: ti: Add EPROBE_DEFER " Akashdeep Kaur
@ 2026-04-01 10:54 ` Akashdeep Kaur
2026-04-02 7:39 ` Krzysztof Kozlowski
2026-04-01 10:54 ` [PATCH v2 3/6] cpufreq: ti: Add device link to k3-socinfo Akashdeep Kaur
` (3 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:54 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Add ti,soc-info property to allow OPP tables to reference the SoC info
device (chipid) for establishing device link dependencies.
This is used on K3 SoCs (AM625, AM62A7, AM62L3, AM62P5) to ensure proper
probe ordering between ti-cpufreq and k3-socinfo drivers. The ti-cpufreq
driver depends on k3-socinfo registering the SoC device for revision
detection via soc_device_match().
The device link also prevents unbinding k3-socinfo while ti-cpufreq is
using it, maintaining system stability.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
.../bindings/opp/operating-points-v2-ti-cpu.yaml | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/operating-points-v2-ti-cpu.yaml b/Documentation/devicetree/bindings/opp/operating-points-v2-ti-cpu.yaml
index 624d1f3f1382..f318494d5295 100644
--- a/Documentation/devicetree/bindings/opp/operating-points-v2-ti-cpu.yaml
+++ b/Documentation/devicetree/bindings/opp/operating-points-v2-ti-cpu.yaml
@@ -34,6 +34,16 @@ properties:
points to syscon node representing the control module
register space of the SoC.
+ ti,soc-info:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: |
+ Optional phandle to the SoC info device (chipid). Used on K3 SoCs
+ to establish device link dependencies ensuring proper probe ordering
+ (ti-cpufreq after k3-socinfo) and preventing unbinding of k3-socinfo
+ while the OPP table is in use. This is needed because ti-cpufreq uses
+ soc_device_match() to detect SoC revision information provided by
+ k3-socinfo.
+
opp-shared: true
patternProperties:
@@ -82,6 +92,7 @@ examples:
opp-table {
compatible = "operating-points-v2-ti-cpu";
syscon = <&scm_conf>;
+ ti,soc-info = <&chipid>;
opp-300000000 {
opp-hz = /bits/ 64 <300000000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/6] cpufreq: ti: Add device link to k3-socinfo
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
2026-04-01 10:53 ` [PATCH v2 1/6] cpufreq: ti: Add EPROBE_DEFER " Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property Akashdeep Kaur
@ 2026-04-01 10:54 ` Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 4/6] arm64: dts: ti: k3-am625: Add ti,soc-info to OPP table Akashdeep Kaur
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:54 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Create explicit device link from CPU device to k3-socinfo when the OPP
table specifies ti,soc-info property. This prevents unbinding k3-socinfo
while ti-cpufreq is using it for SoC revision detection.
This complements the EPROBE_DEFER handling that ensures initial probe
ordering.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
drivers/cpufreq/ti-cpufreq.c | 52 ++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c
index 88f7912ef6a8..7bd45b367b36 100644
--- a/drivers/cpufreq/ti-cpufreq.c
+++ b/drivers/cpufreq/ti-cpufreq.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/of.h>
+#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <linux/regmap.h>
@@ -111,6 +112,7 @@ struct ti_cpufreq_data {
struct device_node *opp_node;
struct regmap *syscon;
const struct ti_cpufreq_soc_data *soc_data;
+ struct device_link *soc_link;
};
static unsigned long amx3_efuse_xlate(struct ti_cpufreq_data *opp_data,
@@ -542,6 +544,7 @@ static int ti_cpufreq_probe(struct platform_device *pdev)
return -ENOMEM;
opp_data->soc_data = match->data;
+ platform_set_drvdata(pdev, opp_data);
opp_data->cpu_dev = get_cpu_device(0);
if (!opp_data->cpu_dev) {
@@ -560,6 +563,42 @@ static int ti_cpufreq_probe(struct platform_device *pdev)
if (ret)
goto fail_put_node;
+ /* Create device link to k3-socinfo if specified in DT */
+ if (opp_data->soc_data == &am625_soc_data ||
+ opp_data->soc_data == &am62a7_soc_data ||
+ opp_data->soc_data == &am62l3_soc_data ||
+ opp_data->soc_data == &am62p5_soc_data) {
+ struct device_node *socinfo_np;
+
+ socinfo_np = of_parse_phandle(opp_data->opp_node, "ti,soc-info", 0);
+ if (socinfo_np) {
+ struct platform_device *socinfo_pdev;
+ struct device_link *link;
+
+ socinfo_pdev = of_find_device_by_node(socinfo_np);
+ of_node_put(socinfo_np);
+
+ if (!socinfo_pdev) {
+ ret = -EPROBE_DEFER;
+ goto fail_put_node;
+ }
+
+ if (!socinfo_pdev->dev.driver) {
+ put_device(&socinfo_pdev->dev);
+ ret = -EPROBE_DEFER;
+ goto fail_put_node;
+ }
+
+ link = device_link_add(opp_data->cpu_dev,
+ &socinfo_pdev->dev,
+ DL_FLAG_STATELESS);
+ if (link)
+ opp_data->soc_link = link;
+
+ put_device(&socinfo_pdev->dev);
+ }
+ }
+
/*
* OPPs determine whether or not they are supported based on
* two metrics:
@@ -600,6 +639,18 @@ static int ti_cpufreq_probe(struct platform_device *pdev)
return ret;
}
+static void ti_cpufreq_remove(struct platform_device *pdev)
+{
+ struct ti_cpufreq_data *opp_data = platform_get_drvdata(pdev);
+
+ /*
+ * Device link is automatically removed with DL_FLAG_AUTOREMOVE_CONSUMER,
+ * but explicitly delete it for safety.
+ */
+ if (opp_data && opp_data->soc_link)
+ device_link_del(opp_data->soc_link);
+}
+
static int __init ti_cpufreq_init(void)
{
const struct of_device_id *match;
@@ -616,6 +667,7 @@ module_init(ti_cpufreq_init);
static struct platform_driver ti_cpufreq_driver = {
.probe = ti_cpufreq_probe,
+ .remove = ti_cpufreq_remove,
.driver = {
.name = "ti-cpufreq",
},
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/6] arm64: dts: ti: k3-am625: Add ti,soc-info to OPP table
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
` (2 preceding siblings ...)
2026-04-01 10:54 ` [PATCH v2 3/6] cpufreq: ti: Add device link to k3-socinfo Akashdeep Kaur
@ 2026-04-01 10:54 ` Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 5/6] arm64: dts: ti: k3-am62a7: " Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 6/6] arm64: dts: ti: k3-am62p5: " Akashdeep Kaur
5 siblings, 0 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:54 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Link CPU OPP table to k3-socinfo driver for dependency tracking.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
arch/arm64/boot/dts/ti/k3-am625.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi
index c249883a8a8d..b0020e667882 100644
--- a/arch/arm64/boot/dts/ti/k3-am625.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi
@@ -109,6 +109,7 @@ a53_opp_table: opp-table {
compatible = "operating-points-v2-ti-cpu";
opp-shared;
syscon = <&opp_efuse_table>;
+ ti,soc-info = <&chipid>;
opp-200000000 {
opp-hz = /bits/ 64 <200000000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 5/6] arm64: dts: ti: k3-am62a7: Add ti,soc-info to OPP table
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
` (3 preceding siblings ...)
2026-04-01 10:54 ` [PATCH v2 4/6] arm64: dts: ti: k3-am625: Add ti,soc-info to OPP table Akashdeep Kaur
@ 2026-04-01 10:54 ` Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 6/6] arm64: dts: ti: k3-am62p5: " Akashdeep Kaur
5 siblings, 0 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:54 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Link CPU OPP table to k3-socinfo driver for dependency tracking.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
arch/arm64/boot/dts/ti/k3-am62a7.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am62a7.dtsi b/arch/arm64/boot/dts/ti/k3-am62a7.dtsi
index b6e5eee99370..6d1459e9ea71 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a7.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a7.dtsi
@@ -109,6 +109,7 @@ a53_opp_table: opp-table {
compatible = "operating-points-v2-ti-cpu";
opp-shared;
syscon = <&opp_efuse_table>;
+ ti,soc-info = <&chipid>;
opp-200000000 {
opp-hz = /bits/ 64 <200000000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 6/6] arm64: dts: ti: k3-am62p5: Add ti,soc-info to OPP table
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
` (4 preceding siblings ...)
2026-04-01 10:54 ` [PATCH v2 5/6] arm64: dts: ti: k3-am62a7: " Akashdeep Kaur
@ 2026-04-01 10:54 ` Akashdeep Kaur
5 siblings, 0 replies; 8+ messages in thread
From: Akashdeep Kaur @ 2026-04-01 10:54 UTC (permalink / raw)
To: krzk, praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt,
rafael, viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole
Cc: vishalm, sebin.francis, k-willis, a-kaur
Link CPU OPP table to k3-socinfo driver for dependency tracking.
Signed-off-by: Akashdeep Kaur <a-kaur@ti.com>
---
arch/arm64/boot/dts/ti/k3-am62p5.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am62p5.dtsi b/arch/arm64/boot/dts/ti/k3-am62p5.dtsi
index 8982a7b9f1a6..1a498c5eb3d1 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p5.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p5.dtsi
@@ -108,6 +108,7 @@ a53_opp_table: opp-table {
compatible = "operating-points-v2-ti-cpu";
opp-shared;
syscon = <&opp_efuse_table>;
+ ti,soc-info = <&chipid>;
opp-200000000 {
opp-hz = /bits/ 64 <200000000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property
2026-04-01 10:54 ` [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property Akashdeep Kaur
@ 2026-04-02 7:39 ` Krzysztof Kozlowski
0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-02 7:39 UTC (permalink / raw)
To: Akashdeep Kaur
Cc: praneeth, nm, vigneshr, kristo, robh, krzk+dt, conor+dt, rafael,
viresh.kumar, linux-arm-kernel, devicetree, linux-kernel,
linux-pm, d-gole, vishalm, sebin.francis, k-willis
On Wed, Apr 01, 2026 at 04:24:00PM +0530, Akashdeep Kaur wrote:
> Add ti,soc-info property to allow OPP tables to reference the SoC info
> device (chipid) for establishing device link dependencies.
>
> This is used on K3 SoCs (AM625, AM62A7, AM62L3, AM62P5) to ensure proper
> probe ordering between ti-cpufreq and k3-socinfo drivers. The ti-cpufreq
Nope, sorry, DT purpose is not to perform probe ordering.
If I change Linux to load k3-socinfo before ti-cpufreq, then the binding
becomes invalid?
Not a DT property, drop.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-04-02 7:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 10:53 [PATCH v2 0/6] cpufreq: ti: Fix probe ordering and add device link support for K3 SoCs Akashdeep Kaur
2026-04-01 10:53 ` [PATCH v2 1/6] cpufreq: ti: Add EPROBE_DEFER " Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 2/6] dt-bindings: opp: ti-cpu: Add ti,soc-info property Akashdeep Kaur
2026-04-02 7:39 ` Krzysztof Kozlowski
2026-04-01 10:54 ` [PATCH v2 3/6] cpufreq: ti: Add device link to k3-socinfo Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 4/6] arm64: dts: ti: k3-am625: Add ti,soc-info to OPP table Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 5/6] arm64: dts: ti: k3-am62a7: " Akashdeep Kaur
2026-04-01 10:54 ` [PATCH v2 6/6] arm64: dts: ti: k3-am62p5: " Akashdeep Kaur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox