Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19180309rwd; Wed, 28 Jun 2023 06:12:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73EkvzxKSGmFKnY5OzcUL0h31JRPGQyXQSB60sdIFhsao+BTYvok2QQWb8PkRXUEwl+q5r X-Received: by 2002:a05:6a20:3d1a:b0:123:a604:df73 with SMTP id y26-20020a056a203d1a00b00123a604df73mr1438629pzi.30.1687957963543; Wed, 28 Jun 2023 06:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687957963; cv=none; d=google.com; s=arc-20160816; b=SLHyIpeS52O1+rDpjjxVejgAfm3MZMPjSvApwy6O3JKUKE+wJwk9IJEEHn2wAQHFsI OORv23wErfTtIhk0fjnFxnGlCsThrBCJc+BQCE74rQXMUKHT5nRtKOKt0jLNOy2zkjbN Y2gMC74n8U+2px8ztYBWVKjSqjlprRshN53PtM48M1EXViX8o0Jk+sjWAXAqzWPxXzNa trmiGOJUwbKLDxkStA0d/OkUedkxy+ccy9KGY8HfF0NrgE5ZkPuuPJgByzj/+yxktd7Q iFrF/Zm+EQ8EofMEP76ZWip1uG9mW3DzjmCWSiK0SV2zKi6X17tLAw8t5Qw+GydzQEhg CV/g== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=F+ZWfx04X8Iys1zxKla/uxR7dwvaQEbtD3I5mTW94sw=; fh=X58oEFCt02epwJ84712p7D/yuIFhbdn1FR6ZzOZ33dA=; b=NgcvDN6dQsxwnEegDu4lv95CSfKE5Se9YVqUVzOko3BsSbO2MjVJmITwuMhoQ+JJ5X 3xrvA1emr12xtWbtXr1oEzKB8PinPkwtT7yOM1oHRU3gHqwdzhy0sbZijvgPqZMk0OM1 Yi+BiXnFNBo44mq/lqLRbf6xdHL4uFdgzMI6Pc+pDJXvHr/R1VseKZoEqmBv1HrWnmC/ JxTVfqg84GReGcADx8Xz9+54Sz6cyoTmIbGXmL5Uxjb3UK/lV7anSGUqjw7rStgzudUQ smlk4VDodnC+X5/5kAV94v1sVzhg9PRxHIxbvI5OFJd8udvKmRmaeZ4/3A9Gws/c9HYz BWcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+QBerWH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh7-20020a056a00808700b00674311392f7si6727686pfb.31.2023.06.28.06.12.29; Wed, 28 Jun 2023 06:12:43 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+QBerWH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjF1MvQ (ORCPT + 99 others); Wed, 28 Jun 2023 08:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbjF1Mus (ORCPT ); Wed, 28 Jun 2023 08:50:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEF61FE8; Wed, 28 Jun 2023 05:50:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 63725612B1; Wed, 28 Jun 2023 12:50:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE1D1C433C8; Wed, 28 Jun 2023 12:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687956645; bh=84V8hGsuqZZKvhSwaACyOQ1VuM7UjHW/bRcJPu6bVmg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m+QBerWHiTCty0ZxlfZSYK+ZRGYFPgUjfh3RWw2dnFwDEf1MwBPFHlSiGqzG5+9tD sAJHFfAnSuO1J2dD22CzS4H77ny9LVD7JTxQ8c7KfUR/ALoivAQgj4UXDN6p4/rV4y iCSlbtQYETCmk9c2p4eBljj9e9F0mVsX1zfgwVcHn3avpOeM1MwnRoNhnlTygOFI1P PdBckP40cmh4Cs0mQAQdc7B/wLqy40Zn7NgjQBIEWA9JgKt2MsgqTNl5JE0siiCXzO VEDIe+pBY0uPhABho6R3yZ6M++YbKSH6zr1qjy/pWfS4Yh6qn7E/ArVMtJG4WgUxPK bF/0KVgO8u+xA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1qEUdC-0007VB-4L; Wed, 28 Jun 2023 14:50:46 +0200 Date: Wed, 28 Jun 2023 14:50:46 +0200 From: Johan Hovold To: Maximilian Luz Cc: Bjorn Andersson , Andy Gross , Konrad Dybcio , Ard Biesheuvel , Ilias Apalodimas , Srinivas Kandagatla , Sudeep Holla , Steev Klimaszewski , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/4] firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface Message-ID: References: <20230528230351.168210-1-luzmaximilian@gmail.com> <20230528230351.168210-4-luzmaximilian@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Wed, Jun 28, 2023 at 02:11:07PM +0200, Johan Hovold wrote: > On Mon, May 29, 2023 at 01:03:50AM +0200, Maximilian Luz wrote: > > @@ -1496,6 +1903,12 @@ static int qcom_scm_probe(struct platform_device *pdev) > > > > __get_convention(); > > > > + ret = qcom_scm_qseecom_init(); > > + if (ret < 0) { > > + __scm = NULL; > > So as I mentioned in my reply to 2/4, you can still have clients > registered here when you clear the __scm pointer which they rely on > after an error. > > Not sure how best to handle this, but perhaps registering a qseecom > platform device here and have it's driver probe defer until scm is > available would work? > > That way you could also separate out the qseecom implementation in a > separate file (driver) rather than having the ifdef above. An alternative may be to just warn and continue if qcom_scm_qseecom_init() fails. It should never return -EPROBE_DEFER anyway, right? Johan