linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
Signed-off-by: Bartosz Golaszewski <redacted>
---
Changes in v2:
- rename of_machine_get_compatible() to of_machine_read_compatible() and
add the index argument
- add a stub for of_machine_read_compatible() for !CONFIG_OF
- provide of_machine_read_model() to avoid having to look-up the root
node via of_find_node_by_path("/")
- rename soc_device_get_machine() to soc_attr_read_machine() before
making it an exported symbol
- Link to v1: https://lore.kernel.org/r/20260119-soc-of-root-v1-0-32a0fa9a78b4@oss.qualcomm.com
---
Bartosz Golaszewski (9):
of: provide of_machine_read_compatible()
of: provide of_machine_read_model()
base: soc: order includes alphabetically
base: soc: rename and export soc_device_get_machine()
soc: fsl: guts: don't access of_root directly
soc: imx8m: don't access of_root directly
soc: imx9: don't access of_root directly
soc: renesas: don't access of_root directly
soc: sunxi: mbus: don't access of_root directly
drivers/base/soc.c | 23 ++++++++++-------------
drivers/of/base.c | 28 ++++++++++++++++++++++++++++
drivers/soc/fsl/guts.c | 12 +++---------
drivers/soc/imx/soc-imx8m.c | 11 +++--------
drivers/soc/imx/soc-imx9.c | 4 ++--
drivers/soc/renesas/renesas-soc.c | 7 ++++++-
drivers/soc/sunxi/sunxi_mbus.c | 2 +-
include/linux/of.h | 14 ++++++++++++++
include/linux/sys_soc.h | 10 ++++++++++
9 files changed, 77 insertions(+), 34 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20260119-soc-of-root-77c86c54010f
Best regards,
--
Bartosz Golaszewski [off-list ref]
Provide a helper function allowing users to read the compatible string
of the machine, hiding the access to the root node.
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/of/base.c | 15 +++++++++++++++
include/linux/of.h | 8 ++++++++
2 files changed, 23 insertions(+)
Provide a helper function allowing users to read the model string of the
machine, hiding the access to the root node.
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/of/base.c | 13 +++++++++++++
include/linux/of.h | 6 ++++++
2 files changed, 19 insertions(+)
Some SoC drivers reimplement the functionality of
soc_device_get_machine(). Make this function accessible through the
sys_soc.h header and rename it to a more descriptive name.
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/base/soc.c | 13 +++++--------
include/linux/sys_soc.h | 10 ++++++++++
2 files changed, 15 insertions(+), 8 deletions(-)
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Acked-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/fsl/guts.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/imx/soc-imx8m.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
@@ -226,7 +226,6 @@ static int imx8m_soc_probe(struct platform_device *pdev)conststructimx8_soc_data*data;structimx8_soc_drvdata*drvdata;structdevice*dev=&pdev->dev;-conststructof_device_id*id;structsoc_device*soc_dev;u32soc_rev=0;u64soc_uid[2]={0,0};
@@ -244,15 +243,11 @@ static int imx8m_soc_probe(struct platform_device *pdev)soc_dev_attr->family="Freescale i.MX";-ret=of_property_read_string(of_root,"model",&soc_dev_attr->machine);+ret=soc_attr_read_machine(soc_dev_attr);if(ret)returnret;-id=of_match_node(imx8_soc_match,of_root);-if(!id)-return-ENODEV;--data=id->data;+data=device_get_match_data(dev);if(data){soc_dev_attr->soc_id=data->name;ret=imx8m_soc_prepare(pdev,data->ocotp_compatible);
@@ -326,7 +321,7 @@ static int __init imx8_soc_init(void)intret;/* No match means this is non-i.MX8M hardware, do nothing. */-if(!of_match_node(imx8_soc_match,of_root))+if(!of_machine_device_match(imx8_soc_match))return0;ret=platform_driver_register(&imx8m_soc_driver);
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/imx/soc-imx9.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -30,7 +30,7 @@ static int imx9_soc_probe(struct platform_device *pdev)if(!attr)return-ENOMEM;-err=of_property_read_string(of_root,"model",&attr->machine);+err=soc_attr_read_machine(attr);if(err)returndev_err_probe(dev,err,"%s: missing model property\n",__func__);
@@ -89,7 +89,7 @@ static int __init imx9_soc_init(void)structplatform_device*pdev;/* No match means it is not an i.MX 9 series SoC, do nothing. */-if(!of_match_node(imx9_soc_match,of_root))+if(!of_machine_device_match(imx9_soc_match))return0;ret=platform_driver_register(&imx9_soc_driver);
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/renesas/renesas-soc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/sunxi/sunxi_mbus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Rob Herring <robh@kernel.org> Date: 2026-02-24 18:32:14
On Mon, Feb 23, 2026 at 02:37:23PM +0100, Bartosz Golaszewski wrote:
quoted hunk
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/renesas/renesas-soc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From: Rob Herring <robh@kernel.org> Date: 2026-02-24 18:38:33
On Mon, Feb 23, 2026 at 02:37:15PM +0100, Bartosz Golaszewski wrote:
linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
SoC tree is good.
Signed-off-by: Bartosz Golaszewski <redacted>
---
Changes in v2:
- rename of_machine_get_compatible() to of_machine_read_compatible() and
add the index argument
- add a stub for of_machine_read_compatible() for !CONFIG_OF
- provide of_machine_read_model() to avoid having to look-up the root
node via of_find_node_by_path("/")
- rename soc_device_get_machine() to soc_attr_read_machine() before
making it an exported symbol
- Link to v1: https://lore.kernel.org/r/20260119-soc-of-root-v1-0-32a0fa9a78b4@oss.qualcomm.com
---
Bartosz Golaszewski (9):
of: provide of_machine_read_compatible()
of: provide of_machine_read_model()
base: soc: order includes alphabetically
base: soc: rename and export soc_device_get_machine()
soc: fsl: guts: don't access of_root directly
soc: imx8m: don't access of_root directly
soc: imx9: don't access of_root directly
soc: renesas: don't access of_root directly
soc: sunxi: mbus: don't access of_root directly
For all but patch 8,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
On Mon, Feb 23, 2026 at 02:37:21PM +0100, Bartosz Golaszewski wrote:
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
On Tue, Feb 24, 2026 at 7:32 PM Rob Herring [off-list ref] wrote:
On Mon, Feb 23, 2026 at 02:37:23PM +0100, Bartosz Golaszewski wrote:
quoted
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/renesas/renesas-soc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -468,7 +469,11 @@ static int __init renesas_soc_init(void)constchar*soc_id;intret;-match=of_match_node(renesas_socs,of_root);+structdevice_node*root__free(device_node)=of_find_node_by_path("/");+if(!root)+return-ENOENT;++match=of_match_node(renesas_socs,root);
Doesn't of_machine_device_match() work here?
No, because we're using the returned address of the matching struct
of_device_id later in the function. If you think it's a better idea to
introduce of_machine_match_node(), let me know but I think that should
be done separately.
Bart
From: Rob Herring <robh@kernel.org> Date: 2026-02-25 21:47:48
On Wed, Feb 25, 2026 at 3:42 AM Bartosz Golaszewski [off-list ref] wrote:
On Tue, Feb 24, 2026 at 7:32 PM Rob Herring [off-list ref] wrote:
quoted
On Mon, Feb 23, 2026 at 02:37:23PM +0100, Bartosz Golaszewski wrote:
quoted
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
---
drivers/soc/renesas/renesas-soc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
@@ -468,7 +469,11 @@ static int __init renesas_soc_init(void)constchar*soc_id;intret;-match=of_match_node(renesas_socs,of_root);+structdevice_node*root__free(device_node)=of_find_node_by_path("/");+if(!root)+return-ENOENT;++match=of_match_node(renesas_socs,root);
Doesn't of_machine_device_match() work here?
No, because we're using the returned address of the matching struct
of_device_id later in the function. If you think it's a better idea to
introduce of_machine_match_node(), let me know but I think that should
be done separately.
No, it's fine.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
On Tue, Feb 24, 2026 at 7:38 PM Rob Herring [off-list ref] wrote:
On Mon, Feb 23, 2026 at 02:37:15PM +0100, Bartosz Golaszewski wrote:
quoted
linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
SoC tree is good.
For all but patch 8,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
FYI Rob also reviewed patch 8 now. Who would pick the patches up? Greg
KH? There does not seem to be a centralized SoC maintainer in
MAINTAINERS?
Bart
Hi Bartosz,
On Mon, 23 Feb 2026 at 14:38, Bartosz Golaszewski
[off-list ref] wrote:
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
@@ -468,7 +469,11 @@ static int __init renesas_soc_init(void) const char *soc_id; int ret;- match = of_match_node(renesas_socs, of_root);+ struct device_node *root __free(device_node) = of_find_node_by_path("/");+ if (!root)+ return -ENOENT;++ match = of_match_node(renesas_socs, root); if (!match) return -ENODEV;
I still find it silly to add a call to of_find_node_by_path().
In your reply to my comment on v1, you said you don't want to add
another helper.
Currently we have two helpers in this area:
1. of_machine_device_match(), which returns bool, and tells if a
match is available,
2. of_machine_get_match_data(), which returns the match data, if a
match is available.
But there is no helper to return the actual match?
of_machine_device_match() would be fine, if it wouldn't cast the result
to bool...
As there is no cost (binary size-wise) in having the helper that returns
the match, too, I have sent a series[1] to do that. The last patch[2]
is an alternative to this patch, avoiding the need to add a call to
of_find_node_by_path().
[1] "[PATCH 0/7] of: Add and use of_machine_get_match() helper"
https://lore.kernel.org/cover.1772468323.git.geert+renesas@glider.be
[2] "[PATCH 7/7] soc: renesas: Convert to of_machine_get_match()"
https://lore.kernel.org/10876b30a8bdb7d1cfcc2f23fb859f2ffea335fe.1772468323.git.geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On Mon, Mar 2, 2026 at 5:47 PM Geert Uytterhoeven [off-list ref] wrote:
Hi Bartosz,
On Mon, 23 Feb 2026 at 14:38, Bartosz Golaszewski
[off-list ref] wrote:
quoted
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
@@ -468,7 +469,11 @@ static int __init renesas_soc_init(void) const char *soc_id; int ret;- match = of_match_node(renesas_socs, of_root);+ struct device_node *root __free(device_node) = of_find_node_by_path("/");+ if (!root)+ return -ENOENT;++ match = of_match_node(renesas_socs, root); if (!match) return -ENODEV;
I still find it silly to add a call to of_find_node_by_path().
In your reply to my comment on v1, you said you don't want to add
another helper.
Currently we have two helpers in this area:
1. of_machine_device_match(), which returns bool, and tells if a
match is available,
2. of_machine_get_match_data(), which returns the match data, if a
match is available.
But there is no helper to return the actual match?
of_machine_device_match() would be fine, if it wouldn't cast the result
to bool...
As there is no cost (binary size-wise) in having the helper that returns
the match, too, I have sent a series[1] to do that. The last patch[2]
is an alternative to this patch, avoiding the need to add a call to
of_find_node_by_path().
[1] "[PATCH 0/7] of: Add and use of_machine_get_match() helper"
https://lore.kernel.org/cover.1772468323.git.geert+renesas@glider.be
[2] "[PATCH 7/7] soc: renesas: Convert to of_machine_get_match()"
https://lore.kernel.org/10876b30a8bdb7d1cfcc2f23fb859f2ffea335fe.1772468323.git.geert+renesas@glider.be
Sure, I'm fine with this patch being dropped and your series queued instead.
Bart
On Thu, Feb 26, 2026 at 10:28:26AM +0100, Bartosz Golaszewski wrote:
On Tue, Feb 24, 2026 at 7:38 PM Rob Herring [off-list ref] wrote:
quoted
On Mon, Feb 23, 2026 at 02:37:15PM +0100, Bartosz Golaszewski wrote:
quoted
linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
SoC tree is good.
For all but patch 8,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
FYI Rob also reviewed patch 8 now. Who would pick the patches up? Greg
KH? There does not seem to be a centralized SoC maintainer in
MAINTAINERS?
On Thu, 12 Mar 2026 16:18:38 +0100, Greg Kroah-Hartman
[off-list ref] said:
On Thu, Feb 26, 2026 at 10:28:26AM +0100, Bartosz Golaszewski wrote:
quoted
On Tue, Feb 24, 2026 at 7:38 PM Rob Herring [off-list ref] wrote:
quoted
On Mon, Feb 23, 2026 at 02:37:15PM +0100, Bartosz Golaszewski wrote:
quoted
linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
SoC tree is good.
For all but patch 8,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
FYI Rob also reviewed patch 8 now. Who would pick the patches up? Greg
KH? There does not seem to be a centralized SoC maintainer in
MAINTAINERS?
Sure, let me take them now, thanks.
greg k-h
In the meantime Geert sent an alternative to patch 8/9 so this single one can
be dropped from the series.
Thanks,
Bartosz
On Fri, Mar 13, 2026 at 01:36:49AM -0700, Bartosz Golaszewski wrote:
On Thu, 12 Mar 2026 16:18:38 +0100, Greg Kroah-Hartman
[off-list ref] said:
quoted
On Thu, Feb 26, 2026 at 10:28:26AM +0100, Bartosz Golaszewski wrote:
quoted
On Tue, Feb 24, 2026 at 7:38 PM Rob Herring [off-list ref] wrote:
quoted
On Mon, Feb 23, 2026 at 02:37:15PM +0100, Bartosz Golaszewski wrote:
quoted
linux/of.h declares a set of variables providing addresses of certain
key OF nodes. The pointers being variables can't profit from stubs
provided for when CONFIG_OF is disabled which means that drivers
accessing these variables can't profit from CONFIG_COMPILE_TEST=y
coverage.
There are drivers under drivers/soc/ that access the of_root node. This
series introduces new OF helpers for reading the machine compatible and
model strings, exports an existing SoC helper that reads the machine
string from the root node and finally replaces all direct accesses to
of_root with new or already existing helper functions.
Merging strategy: first two patches should be either acked by Rob or
picked up into an immutable branch based on v7.0-rc1, the rest can go
through the SoC tree.
SoC tree is good.
For all but patch 8,
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
FYI Rob also reviewed patch 8 now. Who would pick the patches up? Greg
KH? There does not seem to be a centralized SoC maintainer in
MAINTAINERS?
Sure, let me take them now, thanks.
greg k-h
In the meantime Geert sent an alternative to patch 8/9 so this single one can
be dropped from the series.
Ick, ok, I've now dropped that one commit from the tree.
thanks,
greg k-h
From: Alexander Stein <hidden> Date: 2026-03-24 10:24:17
Hi,
Am Montag, 23. Februar 2026, 14:37:21 CET schrieb Bartosz Golaszewski:
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
today I noticed the following warning running next-20260323:
caam 30900000.crypto: No clock data provided for i.MX SoC
This happens when there is no matching against the soc_id.
Checking the source it turns out this patch is the cause that the SoC info
does not provide soc_id anymore.
next-20260323:
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:unknown
/sys/devices/soc0/serial_number:0000000000000000
grep: /sys/devices/soc0/subsystem: Is a directory
reverting this patch (2524b293a59e586afd06358d0b191ab57208a920):
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:1.1
/sys/devices/soc0/serial_number:469677A693A4B8CE131D180033E44903
/sys/devices/soc0/soc_id:i.MX8MP
grep: /sys/devices/soc0/subsystem: Is a directory
soc_id is restored. Now that I write these lines I noticed that
serial_number also contained empty value which is restored with the revert.
Best regards,
Alexander
@@ -226,7 +226,6 @@ static int imx8m_soc_probe(struct platform_device *pdev)conststructimx8_soc_data*data;structimx8_soc_drvdata*drvdata;structdevice*dev=&pdev->dev;-conststructof_device_id*id;structsoc_device*soc_dev;u32soc_rev=0;u64soc_uid[2]={0,0};
@@ -244,15 +243,11 @@ static int imx8m_soc_probe(struct platform_device *pdev)soc_dev_attr->family="Freescale i.MX";-ret=of_property_read_string(of_root,"model",&soc_dev_attr->machine);+ret=soc_attr_read_machine(soc_dev_attr);if(ret)returnret;-id=of_match_node(imx8_soc_match,of_root);-if(!id)-return-ENODEV;--data=id->data;+data=device_get_match_data(dev);if(data){soc_dev_attr->soc_id=data->name;ret=imx8m_soc_prepare(pdev,data->ocotp_compatible);
@@ -326,7 +321,7 @@ static int __init imx8_soc_init(void)intret;/* No match means this is non-i.MX8M hardware, do nothing. */-if(!of_match_node(imx8_soc_match,of_root))+if(!of_machine_device_match(imx8_soc_match))return0;ret=platform_driver_register(&imx8m_soc_driver);
From: Francesco Dolcini <francesco@dolcini.it> Date: 2026-04-27 06:47:16
Hello Alexander, Bartosz
On Tue, Mar 24, 2026 at 11:24:09AM +0100, Alexander Stein wrote:
Hi,
Am Montag, 23. Februar 2026, 14:37:21 CET schrieb Bartosz Golaszewski:
quoted
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
today I noticed the following warning running next-20260323:
quoted
caam 30900000.crypto: No clock data provided for i.MX SoC
This happens when there is no matching against the soc_id.
Checking the source it turns out this patch is the cause that the SoC info
does not provide soc_id anymore.
next-20260323:
quoted
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:unknown
/sys/devices/soc0/serial_number:0000000000000000
grep: /sys/devices/soc0/subsystem: Is a directory
reverting this patch (2524b293a59e586afd06358d0b191ab57208a920):
quoted
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:1.1
/sys/devices/soc0/serial_number:469677A693A4B8CE131D180033E44903
/sys/devices/soc0/soc_id:i.MX8MP
grep: /sys/devices/soc0/subsystem: Is a directory
soc_id is restored. Now that I write these lines I noticed that
serial_number also contained empty value which is restored with the revert.
Any update on this? I would say this is a regression in 7.1-rc1.
I noticed the same issue, and CAAM is not working.
[ 0.000000] Linux version 7.1.0-rc1-0.0.0-devel (oe-user@oe-host) (aarch64-tdx-linux-gcc (GCC) 15.2.0, GNU ld (GNU Binutils) 2.46) #1 SMP PREEMPT Sun Apr 26 21:19:00 UTC 2026
...
[ 10.611139] caam 30900000.crypto: No clock data provided for i.MX SoC
[ 10.611211] caam 30900000.crypto: probe with driver caam failed with error -22
Francesco
From: Francesco Dolcini <francesco@dolcini.it> Date: 2026-04-27 09:31:33
+Peng
Hello all,
On Mon, Apr 27, 2026 at 08:47:04AM +0200, Francesco Dolcini wrote:
On Tue, Mar 24, 2026 at 11:24:09AM +0100, Alexander Stein wrote:
quoted
Hi,
Am Montag, 23. Februar 2026, 14:37:21 CET schrieb Bartosz Golaszewski:
quoted
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <redacted>
today I noticed the following warning running next-20260323:
quoted
caam 30900000.crypto: No clock data provided for i.MX SoC
This happens when there is no matching against the soc_id.
Checking the source it turns out this patch is the cause that the SoC info
does not provide soc_id anymore.
next-20260323:
quoted
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:unknown
/sys/devices/soc0/serial_number:0000000000000000
grep: /sys/devices/soc0/subsystem: Is a directory
reverting this patch (2524b293a59e586afd06358d0b191ab57208a920):
quoted
$ grep . /sys/devices/soc0/*
/sys/devices/soc0/family:Freescale i.MX
/sys/devices/soc0/machine:TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MP-RAS314
grep: /sys/devices/soc0/power: Is a directory
/sys/devices/soc0/revision:1.1
/sys/devices/soc0/serial_number:469677A693A4B8CE131D180033E44903
/sys/devices/soc0/soc_id:i.MX8MP
grep: /sys/devices/soc0/subsystem: Is a directory
soc_id is restored. Now that I write these lines I noticed that
serial_number also contained empty value which is restored with the revert.
Any update on this? I would say this is a regression in 7.1-rc1.
I noticed the same issue, and CAAM is not working.
[ 0.000000] Linux version 7.1.0-rc1-0.0.0-devel (oe-user@oe-host) (aarch64-tdx-linux-gcc (GCC) 15.2.0, GNU ld (GNU Binutils) 2.46) #1 SMP PREEMPT Sun Apr 26 21:19:00 UTC 2026
...
[ 10.611139] caam 30900000.crypto: No clock data provided for i.MX SoC
[ 10.611211] caam 30900000.crypto: probe with driver caam failed with error -22