[PATCH] firmware: arm_scmi: Resolve dependency with TEE subsystem

Sudeep Holla sudeep.holla at arm.com
Fri Nov 11 06:38:00 PST 2022


On Fri, Nov 11, 2022 at 03:23:13PM +0530, Sumit Garg wrote:
> The OP-TEE SCMI transport channel is dependent on TEE subsystem to be
> initialized first. But currently the Arm SCMI subsystem and TEE
> subsystem are invoked on the same initcall level as subsystem_init().
> 
> It is observed that the SCMI subsystem initcall is invoked prior to TEE
> subsystem initcall. This leads to unwanted error messages regarding TEE
> bus is not present yet. Although, -EPROBE_DEFER tries to workaround that
> problem.
> 
> Lets try to resolve inter subsystem dependency problem via shifting Arm
> SCMI subsystem to subsystem_init_sync() initcall level.
>

I would avoid doing that. We already have some implicit dependency with
subsys_initcall because this driver creates/registers bus and need to be
done early. Now in order to solve the dependency between SCMI and TEE,
both of which creates/registers bus and are at same subsys_initcall,
we are relying on subsys_initcall_sync.

Me and Ludvig discussed this in private and I suggested him to do something
like below patch snippet. He mentioned he did post a patch on the list but
I couldn't find it. For this the scmi node must be child node of OPTEE as
it is providing the transport.

@Ludvig, ?

Regards,
Sudeep

--
diff --git i/drivers/tee/optee/smc_abi.c w/drivers/tee/optee/smc_abi.c
index a1c1fa1a9c28..839feca0def4 100644
--- i/drivers/tee/optee/smc_abi.c
+++ w/drivers/tee/optee/smc_abi.c
@@ -1534,7 +1534,9 @@ static int optee_probe(struct platform_device *pdev)
                goto err_disable_shm_cache;

        pr_info("initialized driver\n");
-       return 0;
+
+       /* Populate any dependent child node(if any) */
+       return devm_of_platform_populate(&pdev->dev);

 err_disable_shm_cache:
        if (!optee->rpc_param_count)




More information about the linux-arm-kernel mailing list