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]
Message-ID: <CAL_JsqLYGFP1zLH539=agLsJ6kmSMD4HCKs_p3U7ZZhhZcQ_xA@mail.gmail.com>
Date:   Thu, 12 Nov 2020 10:37:17 -0600
From:   Rob Herring <robh@...nel.org>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Dejin Zheng <zhengdejin5@...il.com>,
        Kishon Vijay Abraham I <kishon@...com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
        Shawn Guo <shawn.guo@...aro.org>,
        Andy Gross <agross@...nel.org>,
        linux-pci <linux-pci@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] PCI: dwc: convert to devm_platform_ioremap_resource_byname()

On Thu, Nov 12, 2020 at 8:22 AM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Dejin,
>
> On Thu, May 28, 2020 at 6:18 PM Dejin Zheng <zhengdejin5@...il.com> wrote:
> > Use devm_platform_ioremap_resource_byname() to simplify codes.
> > it contains platform_get_resource_byname() and devm_ioremap_resource().
> >
> > Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
>
> Thanks for your patch, which is now commit 936fa5cd7b8e3e2a ("PCI: dwc:
> Convert to devm_platform_ioremap_resource_byname()") in v5.9.

This is all changing again in my latest cleanups[1].

> > --- a/drivers/pci/controller/dwc/pci-dra7xx.c
> > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
> > @@ -593,13 +593,12 @@ static int __init dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx,
> >         ep = &pci->ep;
> >         ep->ops = &pcie_ep_ops;
> >
> > -       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ep_dbics");
> > -       pci->dbi_base = devm_ioremap_resource(dev, res);
> > +       pci->dbi_base = devm_platform_ioremap_resource_byname(pdev, "ep_dbics");
> >         if (IS_ERR(pci->dbi_base))
> >                 return PTR_ERR(pci->dbi_base);
> >
> > -       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ep_dbics2");
> > -       pci->dbi_base2 = devm_ioremap_resource(dev, res);
> > +       pci->dbi_base2 =
> > +               devm_platform_ioremap_resource_byname(pdev, "ep_dbics2");
> >         if (IS_ERR(pci->dbi_base2))
> >                 return PTR_ERR(pci->dbi_base2);
>
> The part above looks fine.
>
> > @@ -626,7 +625,6 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
> >         struct dw_pcie *pci = dra7xx->pci;
> >         struct pcie_port *pp = &pci->pp;
> >         struct device *dev = pci->dev;
> > -       struct resource *res;
> >
> >         pp->irq = platform_get_irq(pdev, 1);
> >         if (pp->irq < 0) {
> > @@ -638,8 +636,7 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
> >         if (ret < 0)
> >                 return ret;
> >
> > -       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rc_dbics");
> > -       pci->dbi_base = devm_ioremap_resource(dev, res);
> > +       pci->dbi_base = devm_platform_ioremap_resource_byname(pdev, "rc_dbics");
>
> Are you sure this is equivalent?
> Before, devm_ioremap_resource() was called on "dev" (= pci->dev),
> after it is called on "&pdev->dev" .

pci->dev is set to &pdev->dev in probe, so yes it's equivalent.

Rob

[1] https://lore.kernel.org/linux-pci/20201105211159.1814485-4-robh@kernel.org/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ