Re: [PATCH v5] driver core: enforce device_lock for driver_match_device()
From: Danilo Krummrich
Date: Thu Feb 26 2026 - 06:15:57 EST
On Thu Feb 26, 2026 at 9:54 AM CET, Gatien CHEVALLIER wrote:
> It may not be that trivial because unconditionally moving it to
> module_init() would not guarantee that the TEE bus driver probes
> before the platform device driver. I think there's a bit more to it.
>
> The platform device driver, as is, is not functional whilst the
> TEE services are not available. Therefore, it could falsely fail to
> probe if probed before. We may consider some sort of API to know if
> the services are available?
Ok, so there are three drivers somehow involved:
(1) module_tee_client_driver(scmi_optee_service_driver)
(2) scmi_optee_driver with compatible = "linaro,scmi-optee"
(3) scmi_driver with name = "arm-scmi"
(1) registeres (2) in probe(), and the only thing (2) does is allocating a
platform_device with name = "arm-scmi", such that (3) is probed.
So, to me it seems that the indirection through a fake platform device is
unnecessary and instead (3) should just have compatible = "linaro,scmi-optee"
and return -EPROBE_DEFER if (1) is not ready. Besides that, this seems like a
use-case for device links.
Thanks,
Danilo