Re: [PATCH 1/4] firmware: arm_scmi: bus: Bypass setting fwnode for scmi cpufreq

From: Sudeep Holla
Date: Tue Mar 11 2025 - 07:23:26 EST


On Tue, Mar 11, 2025 at 11:12:45AM +0000, Peng Fan wrote:
> Based on linux-next, I added below node:
>
> +
> + test@4f000000 {
> + compatible = "fsl,imx-test";
> + power-domains = <&scmi_devpd IMX95_PD_VPU>, <&scmi_perf IMX95_PERF_VPU>;
> + power-domain-names = "vpumix", "vpuperf";
> + };
>
> I not write a driver for it, so just check devlink information from sysfs interface.
>
> From below sys directory, this test device takes scmi_dev.4 and scmi_dev.3 as supplier.
> root@imx95evk:/sys/bus/platform/devices/soc:test@4f000000# ls
> driver_override of_node subsystem supplier:scmi_protocol:scmi_dev.4 waiting_for_supplier
> modalias power supplier:scmi_protocol:scmi_dev.3 uevent
>
> Checking scmi_dev.4 below, it is scmi cpufreq, not the scmi perf device.
> scmi_dev.3 is correct, it is genpd.
>
> root@imx95evk:/sys/bus/platform/devices/soc:test@4f000000# cat /sys/bus/scmi_protocol/devices/scmi_dev.4/modalias
> scmi_dev.4:13:cpufreq
> root@imx95evk:/sys/bus/platform/devices/soc:test@4f000000# cat /sys/bus/scmi_protocol/devices/scmi_dev.3/modalias
> scmi_dev.3:11:genpd
> root@imx95evk:/sys/bus/platform/devices/soc:test@4f000000#
>
>
> So it is clear that wrong fw_devlink is created, it is because scmi cpufreq device is
> created earlier and when device_add, the below logic makes the fwnode pointer points
> to scmi cpufreq device.
> if (dev->fwnode && !dev->fwnode->dev) {
> dev->fwnode->dev = dev;
> fw_devlink_link_device(dev);
> }
>

Thanks, looks like simple way to reproduce the issue. I will give it a try.

--
Regards,
Sudeep