[PATCH v2] tee: optee: Change printing during optee_probe
Simon Glass
sjg at chromium.org
Fri Mar 12 16:47:12 CET 2021
Hi Ilias,
On Thu, 11 Mar 2021 at 22:07, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> On Thu, Mar 11, 2021 at 09:45:46PM -0700, Simon Glass wrote:
> > Hi Ilias,
> >
> > On Wed, 10 Mar 2021 at 06:35, Ilias Apalodimas
> > <ilias.apalodimas at linaro.org> wrote:
> > >
> > > Right now the error messages when optee has a version mismatch or shared
> > > memory is not configured are done with a debug().
> > > That's not very convenient since you have to enable debugging to figure
> > > out what's going on, although this is an actual error.
> >
> > The code that probes the device should report the error.
>
> I am notr sure I am following here. This gets called from the core dm code. Is
> there a callback in that, so we can register a specific print per device?
> If not now how do you expect the core to habdle each specific driver error
> code and print a message that makes sense?
Well, who probes the device? Somewhere there is a call to
uclass_first_device(...) or similar, and that should receive the
error-return value.
>
> > If you put
> > errors in a device driver it bloats the code and also it makes it
> > impossible for the caller to suppress the error, e.g. if it is OK for
> > the device to not probe.
>
> Well in the op-tee case it's an explicit node you need to add in the DTB. So i
> am not really sure this applies here.
I'm not sure, but you might be thinking of the 'bind' step. For probe
it is OK for devices to fail to probe.
Regards,
Simon
> >
> >
> > >
> > > So let's switch the debug() -> dev_err() and report those explicitly.
> > >
> > > Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> > > Reviewed-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
> > > ---
> > > drivers/tee/optee/core.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
More information about the U-Boot
mailing list