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: <CAHp75Vd60ftgzvWqz+r5YcptimDwURmwOucOBw-WqdHega6NqA@mail.gmail.com>
Date:   Sat, 25 Dec 2021 18:58:45 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc:     netdev <netdev@...r.kernel.org>,
        Grygorii Strashko <grygorii.strashko@...com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Prabhakar <prabhakar.csengg@...il.com>,
        Linux OMAP Mailing List <linux-omap@...r.kernel.org>
Subject: Re: [PATCH 8/8] net: ethernet: ti: davinci_emac: Use
 platform_get_irq() to get the interrupt

On Sat, Dec 25, 2021 at 4:06 AM 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() for DT users only.
>
> While at it propagate error code in case request_irq() fails instead of
> returning -EBUSY.


> +       if (dev_of_node(&priv->pdev->dev)) {

Why?! What's wrong with using the same approach in all cases?

> +               while ((ret = platform_get_irq_optional(priv->pdev, res_num)) != -ENXIO) {

This is wrong.

You need to check better as I pointed several times against your patches.

> +                       if (ret < 0)
> +                               goto rollback;
>
> +                       ret = request_irq(ret, emac_irq, 0, ndev->name, ndev);
> +                       if (ret) {
> +                               dev_err(emac_dev, "DaVinci EMAC: request_irq() failed\n");
>                                 goto rollback;
>                         }
> +                       res_num++;
>                 }
> -               res_num++;
> +       } else {
> +               while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, res_num))) {
> +                       for (irq_num = res->start; irq_num <= res->end; irq_num++) {
> +                               ret = request_irq(irq_num, emac_irq, 0, ndev->name, ndev);
> +                               if (ret) {
> +                                       dev_err(emac_dev, "DaVinci EMAC: request_irq() failed\n");
> +                                       goto rollback;
> +                               }
> +                       }
> +                       res_num++;
> +               }
> +               /* prepare counters for rollback in case of an error */
> +               res_num--;
> +               irq_num--;
>         }

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ