Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2233668rwb; Fri, 11 Nov 2022 06:51:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6FK2WlK53C0GktGRssSWh8k4NzIRxAm+3KXRyTk3I4J1sj7qMuOcysFPsWHcpWqBnVblt8 X-Received: by 2002:a05:6402:b63:b0:460:6194:d293 with SMTP id cb3-20020a0564020b6300b004606194d293mr1767926edb.331.1668178276139; Fri, 11 Nov 2022 06:51:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668178276; cv=none; d=google.com; s=arc-20160816; b=dCTi5jsBGlccXSU4T2B9c/km0F1FEqiVen3r9LDvsAEM2Nz/1IChYghIMhfvqrLT4y dDfNHsUl6YmNKX7CrANuwI3rLbmxGEZwWIbnvDuzgKL4cHgk/ppO3w8To6y6Ui+B60vR dUVr266o/Ydp3yj+KeMFnBrZtl1K6Bsmu6TIs2fQBgm7Gofhs6m0Q67bUXNAMgd20j/k lQAZeuiK6WHPSIlQHgnc1omg2yJWtpF1IZRH/vUx6Jij+VWhvts4+p1rEv5e5NW9fXd6 rupovUKFn6ikn3/NABkA4TN8jAQmcVEmGbXx11va6qFgft9cusaUmSUD1dfs8wpIaqhD 9NMw== 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=uhm4nXtI0VT+hpSLEpl232ddG2vJZejKbpuKv9/4Hps=; b=Z2RKomQ+rpuu3ZHGus1GV6Nv8pQRZEm9BsvbDAdjEQGTRmxp1fjfHYX0PEorLVqZCE S62xxHuPjYBejddZbjcdqsqzS9Duewtk/3yQUAxXCn+7rqHQGQhs1kTNyn3i4uV7TiNn tTlhFT3vxkajF35GnqUPi0hhZaPzs/nFUJZJSCkxVzE+0GKgEDK7FDkxz2FdcOiOeNOA klJnXI5sZ7Y8fPkqMFSe6xBax6O5iIJC8n5HSExXAwWPpjQFbjfjV6BiPojjdBVyfz+7 A4MaI/BKRTTfY0rd1+rI749hMDcPCr36io+1hwVgtIULEI1xQuo60SmOJJc9lRX6quMA qw+w== 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 kf23-20020a17090776d700b0079dccbbf0c0si1685363ejc.146.2022.11.11.06.50.50; Fri, 11 Nov 2022 06:51:16 -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 S234630AbiKKOiM (ORCPT + 91 others); Fri, 11 Nov 2022 09:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234646AbiKKOiG (ORCPT ); Fri, 11 Nov 2022 09:38:06 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E28E65C755 for ; Fri, 11 Nov 2022 06:38:03 -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 DEE111FB; Fri, 11 Nov 2022 06:38:09 -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 950643F73D; Fri, 11 Nov 2022 06:38:02 -0800 (PST) Date: Fri, 11 Nov 2022 14:38:00 +0000 From: Sudeep Holla To: Sumit Garg Cc: linux-arm-kernel@lists.infradead.org, cristian.marussi@arm.com, Ludvig.Parsson@axis.com, jens.wiklander@linaro.org, etienne.carriere@linaro.org, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firmware: arm_scmi: Resolve dependency with TEE subsystem Message-ID: <20221111143800.k7xje6g23ujefnye@bogus> References: <20221111095313.2010815-1-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221111095313.2010815-1-sumit.garg@linaro.org> 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: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)