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: <CA+V-a8tuc02C85T5rWg16qW+1jY7=a3Q-kBiuuDahVfyX7hQcw@mail.gmail.com>
Date:   Sat, 25 Dec 2021 17:17:50 +0000
From:   "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        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>,
        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

Hi Andy,

Thank you for the review.

On Sat, Dec 25, 2021 at 4:59 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> 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?
>
The earlier code looped the resource from start to end and then
requested the resources. So I believed the the IORESOURCE_IRQ was
sending the range of interrupts. But now looking at the mach-davinci
folder I can confirm its just send an single IRQ resource. So this
check can be dropped and same approach can be used for OF and non OF
users.

> > +               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.
>
Right, Ill have a look.

Cheers,
Prabhakar
> > +                       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