On 9/15/26 06:19, Pranav Sanwal wrote:
soc_get_family/revision/machine() return 0 on success, negative on
error. print_cpuinfo() checked "if (ret)", so a failed call (e.g.
-ENOSYS) was treated as success and printed name[] unpopulated or
stale. Fix the checks to "if (!ret)".

This alone would drop CPU:/Silicon:/Chip: output on Xilinx/AMD
boards: soc_xilinx_versal.c, soc_xilinx_versal_net.c,
soc_xilinx_zynqmp.c and soc_amd_versal2.c return snprintf()'s byte
count instead of 0, which the old inverted check happened to mask.
Fix all four to return 0 on success / -ENOSPC on truncation, per the
documented soc_ops contract.

The wrong return values also affected soc_device_match(), which expects
0 from these ops. With a nonzero byte count returned its strcmp()
comparisons were skipped, so any Versal revision matched the
{ .family = "Versal", .revision = "v2" } entry in cadence_ospi_versal.c
and took the CQSPI_DLL_MODE_MASTER path. After this fix family and
revision are actually compared; production "v2" silicon is unaffected,
while ES1/v1 parts now correctly fall through to -ENOTSUPP.

Fixes: 86ceedd84e2 ("xilinx: common: Separate display cpu info function")
Signed-off-by: Pranav Sanwal <[email protected]>
Message-ID: <[email protected]>
Applied but next time remove this Message-ID.

Thanks,
Michal

Reply via email to