Validate device tree node in SCMI/Power/IOMMU
Get series with b4
b4 am [email protected] change-id 20260210-scmi-fix-8f8ae5f6abceVersions newest first
- v1 Latest3 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | firmware: scmi: Validate device tree node before setup channeldrivers/ drivers/ | +3 | 0 replies | |
| 2/3 | power: domain: Validate device tree node in dev_power_domain_ctrldrivers/ | +3 | 0 replies | |
| 3/3 | iommu: Validate device tree node in dev_iommu_enabledrivers/ | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] Validate device tree node in SCMI/Power/IOMMU
commit 0535e46d55d ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c"), causes i.MX9 SCMI based platforms boot failure.
SPL panic in fdt_check_node_offset_()->fdt_next_tag(), because offset is -1 and SPL_OF_LIBFDT_ASSUME_MASK is 0xFF.
fdt_check_node_offset_()
|->fdt_next_tag()
|->tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); #tagp is NULL
|->tag = fdt32_to_cpu(*tagp); #panic hereIn [1], Ye report the issue, but per Tom:
"In SPL we must assume a perfect device tree has been passed to us, both for design reasons (it's not a user interactively, we built it, or it came from some other firmware stack) as well as practical (performing the sanity tests would grow all platforms by several kilobytes and overflow size constraints). I think the SCMI code needs to be reworked, in short"
So we need to add a check in scmi transport driver, also need to add a check in dev_power_domain_ctrl and iommu. Similar to the check in pinctrl_select_state and the check before call into clk_set_defaults, if ofnode is not valid, directly bypass. With this change, we could still keep SPL_OF_LIBFDT_ASSUME_MASK as 0xFF.
https://lore.kernel.org/u-boot/20260207141750.GB2603314@bill-the-cat/
---
Peng Fan (3):
firmware: scmi: Validate device tree node before setup channel
power: domain: Validate device tree node in dev_power_domain_ctrl
iommu: Validate device tree node in dev_iommu_enable
drivers/firmware/scmi/mailbox_agent.c | 2 +- drivers/firmware/scmi/optee_agent.c | 3 ++- drivers/iommu/iommu-uclass.c | 3 +++ drivers/power/domain/power-domain-uclass.c | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-)
---
base-commit: b99da05e1538b8fa153322da82917af2aa27e1d6
change-id: 20260210-scmi-fix-8f8ae5f6abce
Best regards,
Signature · 1 line
Peng Fan <[email protected]>