Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2388199rwb; Fri, 11 Nov 2022 08:37:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KiWHryR/78qvq5foz0gtZARjuZJH4UCykXdp0rHYpPE4YhHC6UGtLYuUFQ2bRVsT7wi0G X-Received: by 2002:a63:cf53:0:b0:470:15cd:d425 with SMTP id b19-20020a63cf53000000b0047015cdd425mr2400591pgj.27.1668184653030; Fri, 11 Nov 2022 08:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668184653; cv=none; d=google.com; s=arc-20160816; b=wW3CyyGSBAFgNtql2zATmZq7tSatyZadzicREHPzA3xUjkZLvHc/h0vteaoHiO8Lr5 c83MjtEEKs620UH0QzAMKnh685BBSdYMp8Tf/DhlHDKMqklYz4BQ94eEJNry0V8U00wd gFCChV0pXmiF68CxjCNT7ZRljfbiKb3BS1Yahh0CjmTZSYf36FPTu0ZMQqeEzUb26+CP di55MBrvuDT7EwUSQzKPV16YpvtUpB47V+YF5tdmFcb7ffo80/76zUThsVZ1W5F0ZajQ tE0u/qv243O61qKi210lW2eNxNqc/Q2RMCVneMDh8OZD5NQrrejV5NXV7q3ZDQOyAcdT Qy+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=x5DS2x5Wsh/v0IHpx+YA5cFS6afy7lokJa77Ce7o5eg=; b=uyKIkF+6srP+zfVLPkCO3twRBExpgRw0p4AoZKe0Zarj9En0NjNPqclHOjwRlOiLQH Dt5s5APZRZkM9D+11HWdR76ae2QYKp4KQZDkvHG/vsId4mdiCPGEmwLZYNMeTYUOuIHH XaFxcPa72XnqdcR2rXQp0WfqKJVFPnPsIHRV+g5kbhdTRarbpJQXDXRqamN18E1VlOHB P9tdvrH8LWQmNtRlXo9j3XCWEfiWTqQPcyRSNrmnoRCUsI0hzzbz9o/+JLuAvYfVUr9w mDhpZcKGNlMcZT7/CK7mprBbmwOQkfJd+LyhY8CXDp0DlBBbF0E/NKMkov0P9uetV249 F2RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a17090a9f0c00b0021328e7e073si2875331pjp.165.2022.11.11.08.37.19; Fri, 11 Nov 2022 08:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234269AbiKKPPe (ORCPT + 91 others); Fri, 11 Nov 2022 10:15:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234847AbiKKPOY (ORCPT ); Fri, 11 Nov 2022 10:14:24 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 949F043AE2 for ; Fri, 11 Nov 2022 07:13:36 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E6121FB; Fri, 11 Nov 2022 07:13:42 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 29A273F73D; Fri, 11 Nov 2022 07:13:35 -0800 (PST) Date: Fri, 11 Nov 2022 15:13:32 +0000 From: Sudeep Holla To: Ludvig =?utf-8?Q?P=C3=A4rsson?= Cc: "sumit.garg@linaro.org" , "linux-arm-kernel@lists.infradead.org" , Sudeep Holla , "jens.wiklander@linaro.org" , "vincent.guittot@linaro.org" , "etienne.carriere@linaro.org" , "cristian.marussi@arm.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] firmware: arm_scmi: Resolve dependency with TEE subsystem Message-ID: <20221111151332.umzh6hncj43gqzo7@bogus> References: <20221111095313.2010815-1-sumit.garg@linaro.org> <20221111143800.k7xje6g23ujefnye@bogus> <7a32a3694ffd6790e4e2a7c5896931cf8f1a7243.camel@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7a32a3694ffd6790e4e2a7c5896931cf8f1a7243.camel@axis.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2022 at 03:00:29PM +0000, Ludvig P?rsson wrote: > 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 > Thanks for the reference. -- Regards, Sudeep