Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10043483rwp; Thu, 20 Jul 2023 13:46:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlHoe66fkf3XyDQtwUknH3v+XmDVUQksepRsnifLNBlpEkF/IWTS3QxIiZCHLW5hAJ6drNRO X-Received: by 2002:a17:906:105e:b0:993:e9b8:90ee with SMTP id j30-20020a170906105e00b00993e9b890eemr3565569ejj.18.1689885968096; Thu, 20 Jul 2023 13:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689885968; cv=none; d=google.com; s=arc-20160816; b=PolVp9W4kw9GZHtrkP5Y1mzLtlUOHqkckS7gR8XMdsC45lGEussT3hAwigo0fGmT/1 x+JdJhRW8rntuDtky/QE5Ovxp4jFcBHGTrZdO7dT2paQK1xtQ6eyQKfrNWl9jeZMWQXp ZO925eIG+ZXTvWS46grD/88Wmx5KAn79rWy9OG4BIMKMoAM8BmqMYN5p5n45RbjY+W0z bIPAQQkDgiJ5Bx+Lct0CBO2tiDH8Cq5t5BYpBpwLzeG0V1j7EJ2W1nlhs6UAYFSKwaFl IYLLCAZ5oH5qPxXG5I9lCJ2H+X5KOA9OcLVtBNf2e1IkeUEN0sf8wyH2jz71z1DPMHzo 29CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=LsXKzGCpPd/p0NpJWJyfXcpB0p1qO6kuAeJPo9pRHz8=; fh=V1FsHifU6t4/ugilTKfBzG+FTf7iuN9bONGW7MI0EIE=; b=I31S3wI6wLbEC6nJgTU/KZaHzg1HjeBUEOrVGkSVt6JAcZJQJPvN10/uoZLRGoTeZk BRHYSiTtU+Lu1lJyYUSPNgxWhQvqbF3y09k4djQ+4o8Ilt7RpbY3aaWIE59WBM3yNDWt ASiUfnhGvGfWVxLo97hKbuTZe0D+/GAzXClobClKn3M0F1yNNbJw54W8hynFq1a4wxRU I0mD4Ss5sBJR66B92sSAI3VgZC5jDRLc9R1+1RofZYFJ+SezjR1N9N0YJu7xGDYMvPk1 0OUJHgEoT+jdktBoJV49Rts+r0CngdiTzl7QpLJcAO4F6Xd7zzn/U0kBI3ArEP9+qFe+ ChPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=FC2UDsB2; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020a170906b10a00b00992fef51a60si1021354ejy.525.2023.07.20.13.45.42; Thu, 20 Jul 2023 13:46:08 -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=@gmail.com header.s=20221208 header.b=FC2UDsB2; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjGTT1q (ORCPT + 99 others); Thu, 20 Jul 2023 15:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbjGTT1o (ORCPT ); Thu, 20 Jul 2023 15:27:44 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 139A71737; Thu, 20 Jul 2023 12:27:43 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fbc12181b6so10269625e9.2; Thu, 20 Jul 2023 12:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689881261; x=1690486061; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LsXKzGCpPd/p0NpJWJyfXcpB0p1qO6kuAeJPo9pRHz8=; b=FC2UDsB2l0hVoQPYI9EaVjbA1dBtyRq1speteEPE57yHsGt3UxpctS4msEZKbXfwYa NI4IvIhKA8GDMEKf0FIquaU4W0aL0R0MsDs4uCZybjBDvvXDipxC90/in33+VqYj6yhw 5sMxUL7v7d7pIamQ8w/vkfZO8iynqMM4I/9gnglF7O2GnmftWESC6ad/MP9l0nD0xZZf sZ5tLYeBGDPSP5/1d19bCRpOC3kvNgO2sqkTrR6uewg1Ee2tzLQaq5cEHhgBHaSS5syA qvXLFEJShbWXu8YeFGzehFTVRRAHjMXKI/w/K6Fnx8WWvAdIcRN90rV4jZZY8ECyvClv px+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689881261; x=1690486061; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LsXKzGCpPd/p0NpJWJyfXcpB0p1qO6kuAeJPo9pRHz8=; b=b1RIkzSeYXpdGVf2MUCP4GzHfjrN3KEj5NPMrtUhdbTWMOvKRSa7o8fyyWI7fBKqv9 HBQ+wY0Uzxqy9nhUgIVSdsUL8ZV7FkrNfXmfDI51mDkWZ/ZoGHjZi8+J4i3N46JtWEvt pubedyfHsmG/qaEFoyPFQpaS8wq1mu5qiGnD5/NJiXgLz8WghWBfrvGD2pQkKxdal3Im nrxkEi8IYJEY1kv/39nHOMiFVmazwrhJcr87zwG7wwwloWsyQgHgujrKq8R2fSonxxYW V4r+emUfVBxUbMPZpfdeoDVgjXQSwMv8hvp6CW/1OhxMIRl1tiWR7lUKKrirQ/NkaI97 Yy9g== X-Gm-Message-State: ABy/qLaRoksxFaj9lNBU8638xdlOIgL6WcfeWG0Kbf3sGtzWtOy7qYaW zl8i77IB1rJiZcfMNb74kxj9etld8kE= X-Received: by 2002:a1c:7318:0:b0:3fc:a5:2c3a with SMTP id d24-20020a1c7318000000b003fc00a52c3amr2542995wmb.41.1689881261377; Thu, 20 Jul 2023 12:27:41 -0700 (PDT) Received: from ?IPV6:2a02:8071:b783:140:927c:82ba:d32d:99c1? ([2a02:8071:b783:140:927c:82ba:d32d:99c1]) by smtp.gmail.com with ESMTPSA id w9-20020adfd4c9000000b0031423a8f4f7sm2104079wrk.56.2023.07.20.12.27.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 12:27:41 -0700 (PDT) Message-ID: <9f50e6c7-5c85-f70f-a5fe-19923d28f770@gmail.com> Date: Thu, 20 Jul 2023 21:27:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/4] firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface Content-Language: en-US To: Johan Hovold 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 References: <20230528230351.168210-1-luzmaximilian@gmail.com> <20230528230351.168210-4-luzmaximilian@gmail.com> From: Maximilian Luz In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,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 6/28/23 14:50, Johan Hovold wrote: > 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? You're correct. That would be the simplest option. Any error returned by qcom_scm_qseecom_init() comes from the client registration part (qseecom_client_register()) and is either -ENOMEM or whatever auxiliary_device_[init|add]() returns. As far as I can tell, the latter errors out either on invalid inputs or on OOM, so it should be completely fine to just warn about it failing. Regards Max