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:   Wed, 12 Jan 2022 13:32:37 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        "Lad, Prabhakar" <prabhakar.csengg@...il.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] media: davinci: vpif: Use platform_get_irq_optional()
 to get the interrupt

On Tue, Jan 11, 2022 at 9:40 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> wrote:
>
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_optional().
>
> While at it, propagate error code in case devm_request_irq() fails
> instead of returning -EINVAL.

...

> +       while (1) {

The infinite loop use is discouraged.

> +               int irq;
> +
> +               err = platform_get_irq_optional(pdev, res_idx);
> +               if (err < 0 && err != -ENXIO)
> +                       goto vpif_unregister;
> +               if (err > 0)
> +                       irq = err;
> +               else
> +                       break;
> +
> +               err = devm_request_irq(&pdev->dev, irq, vpif_channel_isr,
> +                                      IRQF_SHARED, VPIF_DRIVER_NAME,
> +                                      (void *)(&vpif_obj.dev[res_idx]->channel_id));
> +               if (err)
>                         goto vpif_unregister;
> -               }
>                 res_idx++;
>         }

Slightly better

  do {
  ...
  } while (++res_idx);

...

> +       while (1) {

Ditto.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ