All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@linaro.org>
To: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
	open list <linux-kernel@vger.kernel.org>,
	"tee-dev @ lists . linaro . org" <tee-dev@lists.linaro.org>,
	Jerome Forissier <jerome@forissier.org>
Subject: Re: [PATCH] optee: don't fail on unsuccessful device enumeration
Date: Wed, 13 May 2020 13:53:59 +0530	[thread overview]
Message-ID: <CAFA6WYNOAwSaaaCCf0qoQ=gGBEsCkbdrWUzabkn3XnM7hndsow@mail.gmail.com> (raw)
In-Reply-To: <CAHUa44E968nR1toCGn0_k6ABw_By7Z8EqB2rGSgiTmseo8oL-Q@mail.gmail.com>

Hi Volodymyr,

On Wed, 13 May 2020 at 13:30, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>
> Hi Volodymyr,
>
> On Wed, May 13, 2020 at 2:36 AM Volodymyr Babchuk
> <vlad.babchuk@gmail.com> 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 <vlad.babchuk@gmail.com>
> > ---
>
> 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
> >

  reply	other threads:[~2020-05-13  8:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13  0:34 [PATCH] optee: don't fail on unsuccessful device enumeration Volodymyr Babchuk
2020-05-13  0:36 ` Volodymyr Babchuk
2020-05-13  8:00   ` Jens Wiklander
2020-05-13  8:23     ` Sumit Garg [this message]
2020-05-14  1:18       ` Volodymyr Babchuk
2020-05-14  5:38         ` Sumit Garg
2020-05-15  1:01           ` Volodymyr Babchuk
2020-05-15  4:54             ` Sumit Garg
2020-05-18 10:27               ` Volodymyr Babchuk
2020-05-18 12:34                 ` Sumit Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFA6WYNOAwSaaaCCf0qoQ=gGBEsCkbdrWUzabkn3XnM7hndsow@mail.gmail.com' \
    --to=sumit.garg@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jerome@forissier.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tee-dev@lists.linaro.org \
    --cc=vlad.babchuk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.