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

Ludvig Pärsson Ludvig.Parsson at axis.com
Fri Nov 11 07:00:29 PST 2022


On Fri, 2022-11-11 at 14:38 +0000, Sudeep Holla wrote:
> 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)
> 
I have answered something similar in my submit [1]. Maybe I should have
CCed you, or atleast sent you this link when I told you I made the
submission.

[1] https://lkml.org/lkml/2022/11/9/803

BR,
Ludvig


More information about the linux-arm-kernel mailing list