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: <OSZPR01MB70197F402C7BA0147AD50DF6AA409@OSZPR01MB7019.jpnprd01.prod.outlook.com>
Date:   Sat, 25 Dec 2021 23:45:28 +0000
From:   Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Florian Fainelli <f.fainelli@...il.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>,
        bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        Chris Brandt <Chris.Brandt@...esas.com>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-i2c <linux-i2c@...r.kernel.org>,
        linux-rpi-kernel <linux-rpi-kernel@...ts.infradead.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Lad, Prabhakar" <prabhakar.csengg@...il.com>
Subject: RE: [PATCH v2 2/3] i2c: sh_mobile: Use platform_get_irq_optional() to
 get the interrupt

Hi Andy,

Thank you for the review.

> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@...il.com>
> Sent: 25 December 2021 17:49
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>
> Cc: Florian Fainelli <f.fainelli@...il.com>; Ray Jui <rjui@...adcom.com>; Scott Branden
> <sbranden@...adcom.com>; bcm-kernel-feedback-list <bcm-kernel-feedback-list@...adcom.com>; Nicolas
> Saenz Julienne <nsaenz@...nel.org>; Chris Brandt <Chris.Brandt@...esas.com>; Wolfram Sang
> <wsa+renesas@...g-engineering.com>; linux-i2c <linux-i2c@...r.kernel.org>; linux-rpi-kernel <linux-
> rpi-kernel@...ts.infradead.org>; linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>; Linux-
> Renesas <linux-renesas-soc@...r.kernel.org>; Linux Kernel Mailing List <linux-kernel@...r.kernel.org>;
> Prabhakarprabhakar.csengg@...il.com
> Subject: Re: [PATCH v2 2/3] i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt
> 
> On Wed, Dec 22, 2021 at 2:41 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() for DT users only.
> 
> ...
> 
> > +       if (np) {
> 
> Same comments as per your other patches, i.e.
> Why is this check here?
> 
Because the interrupt resource has range of interrupts in one IRQ resource [0]. Let me know if there is any other alternative way to avoid such case.

> > +               int irq;
> > +
> > +               while ((irq = platform_get_irq_optional(dev, k)) !=
> > + -ENXIO) {
> 
> Consider 0 as no IRQ.
> 
OK.

[0] https://elixir.bootlin.com/linux/v5.16-rc6/source/arch/sh/kernel/cpu/sh4a/setup-sh7724.c#L454

Cheers,
Prabhakar

> > +                       if (irq < 0)
> > +                               return irq;
> > +                       ret = devm_request_irq(&dev->dev, irq, sh_mobile_i2c_isr,
> > +                                              0, dev_name(&dev->dev),
> > + pd);
> >                         if (ret) {
> > -                               dev_err(&dev->dev, "cannot request IRQ %pa\n", &n);
> > +                               dev_err(&dev->dev, "cannot request IRQ
> > + %d\n", irq);
> >                                 return ret;
> >                         }
> > +                       k++;
> > +               };
> > +       } else {
> > +               struct resource *res;
> > +               resource_size_t n;
> > +
> > +               while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) {
> > +                       for (n = res->start; n <= res->end; n++) {
> > +                               ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr,
> > +                                                      0, dev_name(&dev->dev), pd);
> > +                               if (ret) {
> > +                                       dev_err(&dev->dev, "cannot request IRQ %pa\n", &n);
> > +                                       return ret;
> > +                               }
> > +                       }
> > +                       k++;
> >                 }
> > -               k++;
> >         }
> 
> --
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ