lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <236d0327-61d3-8e25-fc37-c8aa5563f9c8@collabora.com>
Date:   Fri, 5 Mar 2021 10:24:37 +0100
From:   Benjamin Gaignard <benjamin.gaignard@...labora.com>
To:     Ezequiel Garcia <ezequiel@...labora.com>, p.zabel@...gutronix.de,
        mchehab@...nel.org, robh+dt@...nel.org, shawnguo@...nel.org,
        s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
        linux-imx@....com, gregkh@...uxfoundation.org, mripard@...nel.org,
        paul.kocialkowski@...tlin.com, wens@...e.org,
        jernej.skrabec@...l.net, peng.fan@....com,
        hverkuil-cisco@...all.nl, dan.carpenter@...cle.com
Cc:     linux-media@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH v4 03/11] media: hantro: change hantro_codec_ops run
 prototype to return errors


Le 03/03/2021 à 22:56, Ezequiel Garcia a écrit :
> On Wed, 2021-03-03 at 12:39 +0100, Benjamin Gaignard wrote:
>> Change hantro_codec_ops run prototype from 'void' to 'int'.
>> This allow to cancel the job if an error occur while configuring
>> the hardware.
>>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
>> ---
>>   drivers/staging/media/hantro/hantro_drv.c     |  4 +++-
>>   .../staging/media/hantro/hantro_g1_h264_dec.c |  6 ++++--
>>   .../media/hantro/hantro_g1_mpeg2_dec.c        |  4 +++-
>>   .../staging/media/hantro/hantro_g1_vp8_dec.c  |  6 ++++--
>>   .../staging/media/hantro/hantro_h1_jpeg_enc.c |  4 +++-
>>   drivers/staging/media/hantro/hantro_hw.h      | 19 ++++++++++---------
>>   .../media/hantro/rk3399_vpu_hw_jpeg_enc.c     |  4 +++-
>>   .../media/hantro/rk3399_vpu_hw_mpeg2_dec.c    |  4 +++-
>>   .../media/hantro/rk3399_vpu_hw_vp8_dec.c      |  6 ++++--
>>   9 files changed, 37 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
>> index e5f200e64993..ac1429f00b33 100644
>> --- a/drivers/staging/media/hantro/hantro_drv.c
>> +++ b/drivers/staging/media/hantro/hantro_drv.c
>> @@ -161,7 +161,9 @@ static void device_run(void *priv)
>>   
>>          v4l2_m2m_buf_copy_metadata(src, dst, true);
>>   
>> -       ctx->codec_ops->run(ctx);
>> +       if (ctx->codec_ops->run(ctx))
>> +               goto err_cancel_job;
>> +
>>          return;
>>   
>>   err_cancel_job:
>> diff --git a/drivers/staging/media/hantro/hantro_g1_h264_dec.c b/drivers/staging/media/hantro/hantro_g1_h264_dec.c
>> index 845bef73d218..fcd4db13c9fe 100644
>> --- a/drivers/staging/media/hantro/hantro_g1_h264_dec.c
>> +++ b/drivers/staging/media/hantro/hantro_g1_h264_dec.c
>> @@ -273,13 +273,13 @@ static void set_buffers(struct hantro_ctx *ctx)
>>          vdpu_write_relaxed(vpu, ctx->h264_dec.priv.dma, G1_REG_ADDR_QTABLE);
>>   }
>>   
>> -void hantro_g1_h264_dec_run(struct hantro_ctx *ctx)
>> +int hantro_g1_h264_dec_run(struct hantro_ctx *ctx)
>>   {
>>          struct hantro_dev *vpu = ctx->dev;
>>   
>>          /* Prepare the H264 decoder context. */
>>          if (hantro_h264_dec_prepare_run(ctx))
>> -               return;
>> +               return -EINVAL;
> This should be returning the value from hantro_h264_dec_prepare_run.

That will be fixed in the next version, thanks

Benjamin

>
> Thanks!
> Ezequiel
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ