Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp342280ybk; Wed, 13 May 2020 01:26:50 -0700 (PDT) X-Google-Smtp-Source: APiQypIQFC9z9sbOrTdJKeTkt3AopnAhqV7ayvgI+eiuf7334KONcnBkSHxXhlKO4jRFbUckxajE X-Received: by 2002:a05:6402:22cd:: with SMTP id dm13mr21788875edb.56.1589358410263; Wed, 13 May 2020 01:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589358410; cv=none; d=google.com; s=arc-20160816; b=ugbclCcTEzJ4vTUK4oA+VeHc7xRpc23wChkK3A37bUgcHnR/1H6M83Nrgym0eE3r0l lFelmu4S/uiPJJw41mq0gnjbsRcD0BJFJl3tQGRPG62ep3BfNzp8yjxTfJToalj7DDQz FvUdz8arnA4DaxWdzp5ZeDaA8N1Bgs95VG4WBBoOMwIber2AD4tWJbmxadrXYpp3uSTT kPfSsqWuxkoTx/Kjy+e4rc/IGU4dJgReemryVygoYDZoHQEuJ0ktVi+5c71eVGfB7AvZ lzhQ0/QPs2ga+o1Gs0Adk/p/oYw2QRUoyWOEZfQOnqOHdV6KrgvPN3XYNKfIYZ0EbjmB tTgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BCnyp8DCf8CZS+zvYVx3/wo57tr3YdAZ4e/hQh/qGcs=; b=1G/qQ7jd1nCu8k1DCrfoFjuX5J8HgUQa7CQaokmSBD1yHRLGy0q50o4GkSWUAKvCEX FFFln+98n036gJqx240zRIELSMiGuE05umqkwmvL0RflOXbm6Sn+kBuOGsBthls3QDZp Ja/dUyVENO2fNUtqI7MmV41X1zshrvbgbsS9ED0ZbTKmtKHQGXSFnYHYXOUSChOtsMKx aKRUUDUDh7W4+EoUyzssafJtnJNSjDs4kK1o+BVPLJqJ8XVL9lrodynT8qpxXwSlze22 xmNctnIoeLAsRJtP6Zrix2oHpV/GfNwhQuQe3EGg4Elg5C8qy6VVD+EF/Yr2dKiisMoK EUAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NSaX/vRO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si9621774ejb.187.2020.05.13.01.26.27; Wed, 13 May 2020 01:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NSaX/vRO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730851AbgEMIYO (ORCPT + 99 others); Wed, 13 May 2020 04:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729189AbgEMIYM (ORCPT ); Wed, 13 May 2020 04:24:12 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38BDFC061A0C for ; Wed, 13 May 2020 01:24:12 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id a9so12857251lfb.8 for ; Wed, 13 May 2020 01:24:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BCnyp8DCf8CZS+zvYVx3/wo57tr3YdAZ4e/hQh/qGcs=; b=NSaX/vRORpmKcgHTGXqFERaoMDjDF+QKGnIBBeEfxXLunp5oOjByaFxkxCqB1bOLUz ziDPzYeWjw2LzzZX6LTgXFF5VT7C8rxeEN4zYz+2Ngv+DLz76YD9hLjgHhinTWdYKfEc 8huLU09Xc0QYvyfmeAGvAuSz938gw+pGIfOMX9wM7fZlKkDjylhLiYNxnaQud5fkpA0i tK+dqg+vB/UGtEfAAJg8NBBqwI72H8aet+FTUlR+TpOTg8fMvMxL0W8VC1HVy+19pcii uUKV+RFm40CJ8/QBotiXF5XThr/zaUoE0njy5JKsDnJry+4kF8vfoOVa4wHBNf3xRBU8 Lppw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BCnyp8DCf8CZS+zvYVx3/wo57tr3YdAZ4e/hQh/qGcs=; b=FoKYh3T1LQTh82zNGvPdctGVBgfjW1if6/o6QGt/J0FN1Nb0SY/gnTlvO46POOhoAB pDoaGUVb1wSPkLx6RcVSlw6zf2HGQFl/p8jKHxvBhPjpXBdWpjUxp0i5yZLDoaslPo5h IEUPJRP7+kcVMxY/6iBWsPhbb6Tr+N0tS4kd/yPfw9HJjELBiOa5RH4SjrKBnyQ+/f56 0c08RxKErFLO3yS0UtQOZFR7hj/oKRtMmYC4MVQWmfvapTXKu2KTy2oWfSkcnJ3qSIcF YczywU3hNrkNVn6MXtpL63o8RNWX3ORBtBxOg3I6DsZot3nYlbb2H8aPE4Ztd4U9ovrQ k6fw== X-Gm-Message-State: AOAM5310UDrK5XgVSDDgUONLWxOo/7qEo2ofEUvQzePO8vJkNmU8wU+4 b4rUT8OwYOBZD0hdputolcThhGE7qDZT0dxb3LU1n8bJ8UU= X-Received: by 2002:ac2:4945:: with SMTP id o5mr17202258lfi.21.1589358250625; Wed, 13 May 2020 01:24:10 -0700 (PDT) MIME-Version: 1.0 References: <20200513003430.651232-1-vlad.babchuk@gmail.com> <20200513003625.651340-1-vlad.babchuk@gmail.com> In-Reply-To: From: Sumit Garg Date: Wed, 13 May 2020 13:53:59 +0530 Message-ID: Subject: Re: [PATCH] optee: don't fail on unsuccessful device enumeration To: Volodymyr Babchuk Cc: Jens Wiklander , open list , "tee-dev @ lists . linaro . org" , Jerome Forissier Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Volodymyr, On Wed, 13 May 2020 at 13:30, Jens Wiklander wrote: > > Hi Volodymyr, > > On Wed, May 13, 2020 at 2:36 AM Volodymyr Babchuk > wrote: > > > > optee_enumerate_devices() can fail for multiple of reasons. For > > example, I encountered issue when Xen OP-TEE mediator NACKed > > PTA_CMD_GET_DEVICES call. Could you share a detailed description of the issue which you are facing? optee_enumerate_devices() is a simple invocation of pseudo TA and cases where OP-TEE doesn't provide corresponding pseudo TA are handled very well. > > This should not result in driver > > initialization error because this is an optional feature. I wouldn't call it an optional feature as there might be real kernel drivers dependent on this enumeration. Also, it is a simple example to self test OP-TEE functionality too. So I am not sure how much functional OP-TEE would be if this basic TA invocation fails. -Sumit > > > > Thus, it is better to print warning, instead of termination driver > > initialization. > > > > Signed-off-by: Volodymyr Babchuk > > --- > > Looks good. Didn't apply directly at latest, but the conflict was easy > enough to resolve. > > I'll pick up this in a day unless someone objects. > > I'll add a > Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support") > Line. > > Thanks, > Jens > > > > > resend: fixed email in s-o-b tag. Sorry for the noise > > > > drivers/tee/optee/core.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c > > index 34409c916882..a053930032f2 100644 > > --- a/drivers/tee/optee/core.c > > +++ b/drivers/tee/optee/core.c > > @@ -728,10 +728,8 @@ static int __init optee_driver_init(void) > > return PTR_ERR(optee); > > > > rc = optee_enumerate_devices(); > > - if (rc) { > > - optee_remove(optee); > > - return rc; > > - } > > + if (rc) > > + pr_warn("can't enumerate optee devices: %d\n", rc); > > > > pr_info("initialized driver\n"); > > > > -- > > 2.26.2 > >