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]
Date:   Fri, 17 Dec 2021 00:44:02 +0000
From:   "Lad, Prabhakar" <prabhakar.csengg@...il.com>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
        "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" 
        <linux-ide@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ata: pata_of_platform: Use of_irq_to_resource() to
 populate IRQ resource

Hi Rob,

On Fri, Dec 17, 2021 at 12:39 AM Rob Herring <robh+dt@...nel.org> wrote:
>
> On Thu, Dec 16, 2021 at 6:12 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 bypassed the hierarchical setup and messed up the
> > irq chaining.
> >
> > In preparation for removal of static setup of IRQ resource from DT core
> > code use of_irq_to_resource().
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> > ---
> > Hi,
> >
> > Dropping usage of platform_get_resource() was agreed based on
> > the discussion [0].
> >
> > [0] https://patchwork.kernel.org/project/linux-renesas-soc/
> > patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@...renesas.com/
> >
> > Cheers,
> > Prabhakar
> > ---
> >  drivers/ata/pata_of_platform.c | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
> > index 35aa158fc976..557f349eb533 100644
> > --- a/drivers/ata/pata_of_platform.c
> > +++ b/drivers/ata/pata_of_platform.c
> > @@ -9,6 +9,7 @@
> >  #include <linux/kernel.h>
> >  #include <linux/module.h>
> >  #include <linux/of_address.h>
> > +#include <linux/of_irq.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/ata_platform.h>
> >  #include <linux/libata.h>
> > @@ -25,11 +26,12 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> >         struct device_node *dn = ofdev->dev.of_node;
> >         struct resource io_res;
> >         struct resource ctl_res;
> > -       struct resource *irq_res;
> > +       struct resource irq_res;
> >         unsigned int reg_shift = 0;
> >         int pio_mode = 0;
> >         int pio_mask;
> >         bool use16bit;
> > +       int irq;
> >
> >         ret = of_address_to_resource(dn, 0, &io_res);
> >         if (ret) {
> > @@ -45,7 +47,9 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
> >                 return -EINVAL;
> >         }
> >
> > -       irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
> > +       irq = of_irq_to_resource(dn, 0, &irq_res);
>
> No, platform_get_irq() please. I really want to get rid of the 4 users
> of of_irq_to_resource() in the tree, not add more.
>
Ouch I wasn't aware of it.

> Yeah, that means __pata_platform_probe() needs to change, but it's all
> of 2 callers. Really, I think pata_platform.c and pata_of_platform.c
> should be merged. I'm guessing the separation traces back to DT using
> a different bus type.
>
Or we could fill in the IRQ resource by using platform_get_irq()
without touching __pata_platform_probe()?

Cheers,
Prabhakar

> Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ