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] [day] [month] [year] [list]
Date:   Fri, 26 Aug 2022 17:46:53 +0800
From:   Irui Wang <irui.wang@...iatek.com>
To:     Chen-Yu Tsai <wenst@...omium.org>,
        Hans Verkuil <hverkuil-cisco@...all.nl>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        <angelogioacchino.delregno@...labora.com>
CC:     Tiffany Lin <tiffany.lin@...iatek.com>,
        Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        Maoguang Meng <maoguang.meng@...iatek.com>,
        Longfei Wang <longfei.wang@...iatek.com>,
        Yunfei Dong <yunfei.dong@...iatek.com>,
        <linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-mediatek@...ts.infradead.org>,
        <Project_Global_Chrome_Upstream_Group@...iatek.com>
Subject: Re: [PATCH v2, 4/6] media: mediatek: vcodec: Remove encoder driver
 get IRQ resource

Dear Chen-Yu,

many thanks for your comments.

On Fri, 2022-08-26 at 12:08 +0800, Chen-Yu Tsai wrote:
> Hi,
> 
> On Wed, Jul 20, 2022 at 4:58 PM Irui Wang <irui.wang@...iatek.com>
> wrote:
> > 
> > The "platform_get_resource(pdev, IORESOURCE_IRQ, 0)" is no longer
> > used after commit a1a2b7125e107("of/platform: Drop static setup of
> > IRQ resource from DT core"), so just remove the function in
> > encoder driver to avoid driver probe failed.
> > 
> > Signed-off-by: Irui Wang <irui.wang@...iatek.com>
> > ---
> >  .../media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c   | 8 ----
> > ----
> >  1 file changed, 8 deletions(-)
> > 
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
> > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
> > index ea667b867b56..6d8964fb4fa2 100644
> > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
> > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
> > @@ -228,7 +228,6 @@ static int mtk_vcodec_probe(struct
> > platform_device *pdev)
> >  {
> >         struct mtk_vcodec_dev *dev;
> >         struct video_device *vfd_enc;
> > -       struct resource *res;
> >         phandle rproc_phandle;
> >         enum mtk_vcodec_fw_type fw_type;
> >         int ret;
> > @@ -272,13 +271,6 @@ static int mtk_vcodec_probe(struct
> > platform_device *pdev)
> >                 goto err_res;
> >         }
> > 
> > -       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > -       if (res == NULL) {
> > -               dev_err(&pdev->dev, "failed to get irq resource");
> > -               ret = -ENOENT;
> > -               goto err_res;
> > -       }
> > -
> >         dev->enc_irq = platform_get_irq(pdev, 0);
> 
> platform_get_irq() returns a negative number on failure. You should
> check for errors here as the previous check was removed.
> 
> The description of platform_get_irq() explicitly mentions:
> 
>     Device drivers should check the return value for errors so as to
>     not pass a negative integer value to the request_irq() APIs.
> 
> Hans has queued up this patch, so maybe you could provide a follow-up
> patch to fix this?
> 
Another same patch has been already merged into linux-next tree, so
this current patch can be dropped.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c?id=750a914adb7ded3669b47daed6d9d749110b4107
 

Thanks
Best Regards
> 
> Regards
> ChenYu
> 
> 
> >         irq_set_status_flags(dev->enc_irq, IRQ_NOAUTOEN);
> >         ret = devm_request_irq(&pdev->dev, dev->enc_irq,
> > --
> > 2.18.0
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ