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: <CAEExFWt+8FL45kLMWc3odS4GsCRkskD1Z08q6UAF1sYx32Hf-w@mail.gmail.com>
Date:   Sun, 29 Dec 2019 22:36:38 +0800
From:   Frank Lee <tiny.windzz@...il.com>
To:     Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc:     Jonathan Corbet <corbet@....net>,
        Greg KH <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>, Stephen Boyd <sboyd@...nel.org>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
        Phil Edworthy <phil.edworthy@...esas.com>,
        suzuki.poulose@....com, saravanak@...gle.com,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        dan.j.williams@...el.com, Joe Perches <joe@...ches.com>,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>, mans@...sr.com,
        Thomas Gleixner <tglx@...utronix.de>, hdegoede@...hat.com,
        Andrew Morton <akpm@...ux-foundation.org>,
        Ulf Hansson <ulf.hansson@...aro.org>, ztuowen@...il.com,
        Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
        linux-doc <linux-doc@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] lib: devres: provide devm_ioremap_resource_nocache()

On Sun, Dec 29, 2019 at 8:11 PM Bartosz Golaszewski
<bgolaszewski@...libre.com> wrote:
>
> niedz., 29 gru 2019 o 11:43 Yangtao Li <tiny.windzz@...il.com> napisaƂ(a):
> >
> > Provide a variant of devm_ioremap_resource() for nocache ioremap.
> >
> > Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
> > ---
> >  Documentation/driver-api/driver-model/devres.rst |  1 +
> >  include/linux/device.h                           |  2 ++
> >  lib/devres.c                                     | 15 +++++++++++++++
> >  3 files changed, 18 insertions(+)
> >
> > diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> > index 13046fcf0a5d..af1b1b9e3a17 100644
> > --- a/Documentation/driver-api/driver-model/devres.rst
> > +++ b/Documentation/driver-api/driver-model/devres.rst
> > @@ -317,6 +317,7 @@ IOMAP
> >    devm_ioremap_uc()
> >    devm_ioremap_wc()
> >    devm_ioremap_resource() : checks resource, requests memory region, ioremaps
> > +  devm_ioremap_resource_nocache()
> >    devm_ioremap_resource_wc()
> >    devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device
> >    devm_platform_ioremap_resource_wc()
> > diff --git a/include/linux/device.h b/include/linux/device.h
> > index 96ff76731e93..3aa353aa52e2 100644
> > --- a/include/linux/device.h
> > +++ b/include/linux/device.h
> > @@ -962,6 +962,8 @@ extern void devm_free_pages(struct device *dev, unsigned long addr);
> >
> >  void __iomem *devm_ioremap_resource(struct device *dev,
> >                                     const struct resource *res);
> > +void __iomem *devm_ioremap_resource_nocache(struct device *dev,
> > +                                           const struct resource *res);
> >  void __iomem *devm_ioremap_resource_wc(struct device *dev,
> >                                        const struct resource *res);
> >
> > diff --git a/lib/devres.c b/lib/devres.c
> > index f56070cf970b..a182f8479fbf 100644
> > --- a/lib/devres.c
> > +++ b/lib/devres.c
> > @@ -188,6 +188,21 @@ void __iomem *devm_ioremap_resource(struct device *dev,
> >  }
> >  EXPORT_SYMBOL(devm_ioremap_resource);
> >
> > +/**
> > + * devm_ioremap_resource_nocache() - nocache variant of
> > + *                                   devm_ioremap_resource()
> > + * @dev: generic device to handle the resource for
> > + * @res: resource to be handled
> > + *
> > + * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
> > + * on failure.
> > + */
> > +void __iomem *devm_ioremap_resource_nocache(struct device *dev,
> > +                                           const struct resource *res)
> > +{
> > +       return __devm_ioremap_resource(dev, res, DEVM_IOREMAP_NC);
> > +}
> > +
> >  /**
> >   * devm_ioremap_resource_wc() - write-combined variant of
> >   *                             devm_ioremap_resource()
> > --
> > 2.17.1
> >
>
> This has been discussed before. The nocache variants of ioremap() are
> being phased out as they're only ever needed on one obscure
> architecture IIRC. This is not needed, rather we should convert all
> nocache calls to regular ioremap().

Thanks for pointing out!
I have seen the use of ioremap_nocache in many architectures,
so they are wrong and should be changed to ioremap?

Yangtao

>
> Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ