mbox series

[v3,0/8] drivers: add new variants of devm_platform_ioremap_resource()

Message ID 20191006053916.8849-1-brgl@bgdev.pl
Headers show
Series drivers: add new variants of devm_platform_ioremap_resource() | expand

Message

Bartosz Golaszewski Oct. 6, 2019, 5:39 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The new devm_platform_ioremap_resource() helper has now been widely
adopted and used in many drivers. Users of the write-combined ioremap()
variants could benefit from the same code shrinkage. This series provides
a write-combined version of devm_platform_ioremap_resource() and uses it in a
relevant driver with the assumption that - just like was the case
previously - a coccinelle script will be developed to ease the transition
for others.

There are also users of platform_get_resource_byname() who call
devm_ioremap_resource() next, so provide another variant that they can use
together with two examples.

v1 -> v2:
- dropped everything related to nocache ioremap as this is going away

v2 -> v3:
- don't call platform_get_resource() as an argument of devm_ioremap_resource(),
  it actually decreases readability
- add devm_platform_ioremap_resource_byname() as another variant

Bartosz Golaszewski (8):
  Documentation: devres: add missing entry for
    devm_platform_ioremap_resource()
  lib: devres: prepare devm_ioremap_resource() for more variants
  lib: devres: provide devm_ioremap_resource_wc()
  drivers: platform: provide devm_platform_ioremap_resource_wc()
  misc: sram: use devm_platform_ioremap_resource_wc()
  drivers: provide devm_platform_ioremap_resource_byname()
  gpio: mvebu: use devm_platform_ioremap_resource_byname()
  gpio: tegra186: use devm_platform_ioremap_resource_byname()

 .../driver-api/driver-model/devres.rst        |  4 ++
 drivers/base/platform.c                       | 39 +++++++++++-
 drivers/gpio/gpio-mvebu.c                     | 19 +++---
 drivers/gpio/gpio-tegra186.c                  |  4 +-
 drivers/misc/sram.c                           | 28 +++------
 include/linux/device.h                        |  2 +
 include/linux/platform_device.h               |  6 ++
 lib/devres.c                                  | 62 +++++++++++++------
 8 files changed, 108 insertions(+), 56 deletions(-)

Comments

Bartosz Golaszewski Oct. 21, 2019, 3:04 p.m. UTC | #1
niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
>
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> The new devm_platform_ioremap_resource() helper has now been widely
> adopted and used in many drivers. Users of the write-combined ioremap()
> variants could benefit from the same code shrinkage. This series provides
> a write-combined version of devm_platform_ioremap_resource() and uses it in a
> relevant driver with the assumption that - just like was the case
> previously - a coccinelle script will be developed to ease the transition
> for others.
>
> There are also users of platform_get_resource_byname() who call
> devm_ioremap_resource() next, so provide another variant that they can use
> together with two examples.
>
> v1 -> v2:
> - dropped everything related to nocache ioremap as this is going away
>
> v2 -> v3:
> - don't call platform_get_resource() as an argument of devm_ioremap_resource(),
>   it actually decreases readability
> - add devm_platform_ioremap_resource_byname() as another variant
>
> Bartosz Golaszewski (8):
>   Documentation: devres: add missing entry for
>     devm_platform_ioremap_resource()
>   lib: devres: prepare devm_ioremap_resource() for more variants
>   lib: devres: provide devm_ioremap_resource_wc()
>   drivers: platform: provide devm_platform_ioremap_resource_wc()
>   misc: sram: use devm_platform_ioremap_resource_wc()
>   drivers: provide devm_platform_ioremap_resource_byname()
>   gpio: mvebu: use devm_platform_ioremap_resource_byname()
>   gpio: tegra186: use devm_platform_ioremap_resource_byname()
>
>  .../driver-api/driver-model/devres.rst        |  4 ++
>  drivers/base/platform.c                       | 39 +++++++++++-
>  drivers/gpio/gpio-mvebu.c                     | 19 +++---
>  drivers/gpio/gpio-tegra186.c                  |  4 +-
>  drivers/misc/sram.c                           | 28 +++------
>  include/linux/device.h                        |  2 +
>  include/linux/platform_device.h               |  6 ++
>  lib/devres.c                                  | 62 +++++++++++++------
>  8 files changed, 108 insertions(+), 56 deletions(-)
>
> --
> 2.23.0
>

Greg, Arnd,

gentle ping for this. I noticed that some maintainers are complaining
about being spammed with patches converting old drivers to using
devm_platform_ioremap_resource() and there's even a patch removing the
relevant coccinelle script on the list, but I think for new drivers
these are still useful. Do you want to pick them up for v5.5 (or at
all)?

Bart
Arnd Bergmann Oct. 21, 2019, 3:52 p.m. UTC | #2
On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > Bartosz Golaszewski (8):
> >   Documentation: devres: add missing entry for
> >     devm_platform_ioremap_resource()
> >   lib: devres: prepare devm_ioremap_resource() for more variants
> >   lib: devres: provide devm_ioremap_resource_wc()
> >   drivers: platform: provide devm_platform_ioremap_resource_wc()
> >   misc: sram: use devm_platform_ioremap_resource_wc()
> >   drivers: provide devm_platform_ioremap_resource_byname()
> >   gpio: mvebu: use devm_platform_ioremap_resource_byname()
> >   gpio: tegra186: use devm_platform_ioremap_resource_byname()
> >
> >  .../driver-api/driver-model/devres.rst        |  4 ++
> >  drivers/base/platform.c                       | 39 +++++++++++-
> >  drivers/gpio/gpio-mvebu.c                     | 19 +++---
> >  drivers/gpio/gpio-tegra186.c                  |  4 +-
> >  drivers/misc/sram.c                           | 28 +++------
> >  include/linux/device.h                        |  2 +
> >  include/linux/platform_device.h               |  6 ++
> >  lib/devres.c                                  | 62 +++++++++++++------
> >  8 files changed, 108 insertions(+), 56 deletions(-)
>
> Greg, Arnd,
>
> gentle ping for this. I noticed that some maintainers are complaining
> about being spammed with patches converting old drivers to using
> devm_platform_ioremap_resource() and there's even a patch removing the
> relevant coccinelle script on the list, but I think for new drivers
> these are still useful. Do you want to pick them up for v5.5 (or at
> all)?

I think this series is useful and we should merge it. Are there any
remaining dependencies or conflicts with Christoph Hellwig's recent
__ioremap rework? If there are, I would prioritize his work and maybe
delay this one by another merge window, otherwise please add
my Reviewed-by to all patches and resend them for Greg to pick
up (provided he has no objections).

        Arnd
Bartosz Golaszewski Oct. 21, 2019, 4:29 p.m. UTC | #3
pon., 21 paź 2019 o 17:53 Arnd Bergmann <arnd@arndb.de> napisał(a):
>
> On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <brgl@bgdev.pl> napisał(a):
> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > Bartosz Golaszewski (8):
> > >   Documentation: devres: add missing entry for
> > >     devm_platform_ioremap_resource()
> > >   lib: devres: prepare devm_ioremap_resource() for more variants
> > >   lib: devres: provide devm_ioremap_resource_wc()
> > >   drivers: platform: provide devm_platform_ioremap_resource_wc()
> > >   misc: sram: use devm_platform_ioremap_resource_wc()
> > >   drivers: provide devm_platform_ioremap_resource_byname()
> > >   gpio: mvebu: use devm_platform_ioremap_resource_byname()
> > >   gpio: tegra186: use devm_platform_ioremap_resource_byname()
> > >
> > >  .../driver-api/driver-model/devres.rst        |  4 ++
> > >  drivers/base/platform.c                       | 39 +++++++++++-
> > >  drivers/gpio/gpio-mvebu.c                     | 19 +++---
> > >  drivers/gpio/gpio-tegra186.c                  |  4 +-
> > >  drivers/misc/sram.c                           | 28 +++------
> > >  include/linux/device.h                        |  2 +
> > >  include/linux/platform_device.h               |  6 ++
> > >  lib/devres.c                                  | 62 +++++++++++++------
> > >  8 files changed, 108 insertions(+), 56 deletions(-)
> >
> > Greg, Arnd,
> >
> > gentle ping for this. I noticed that some maintainers are complaining
> > about being spammed with patches converting old drivers to using
> > devm_platform_ioremap_resource() and there's even a patch removing the
> > relevant coccinelle script on the list, but I think for new drivers
> > these are still useful. Do you want to pick them up for v5.5 (or at
> > all)?
>
> I think this series is useful and we should merge it. Are there any
> remaining dependencies or conflicts with Christoph Hellwig's recent
> __ioremap rework? If there are, I would prioritize his work and maybe
> delay this one by another merge window, otherwise please add
> my Reviewed-by to all patches and resend them for Greg to pick
> up (provided he has no objections).
>
>         Arnd

Is Christoph's work in next? The series doesn't apply cleanly on next,
I needed to fix a couple conflicts. What branch should I rebase it on
before resending?

Bart
Arnd Bergmann Oct. 21, 2019, 7:29 p.m. UTC | #4
On Mon, Oct 21, 2019 at 6:29 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> pon., 21 paź 2019 o 17:53 Arnd Bergmann <arnd@arndb.de> napisał(a):
> > On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > gentle ping for this. I noticed that some maintainers are complaining
> > > about being spammed with patches converting old drivers to using
> > > devm_platform_ioremap_resource() and there's even a patch removing the
> > > relevant coccinelle script on the list, but I think for new drivers
> > > these are still useful. Do you want to pick them up for v5.5 (or at
> > > all)?
> >
> > I think this series is useful and we should merge it. Are there any
> > remaining dependencies or conflicts with Christoph Hellwig's recent
> > __ioremap rework? If there are, I would prioritize his work and maybe
> > delay this one by another merge window, otherwise please add
> > my Reviewed-by to all patches and resend them for Greg to pick
> > up (provided he has no objections).
>
> Is Christoph's work in next? The series doesn't apply cleanly on next,
> I needed to fix a couple conflicts. What branch should I rebase it on
> before resending?

Not sure, maybe Christoph can comment.

Your patches would best go through the char-misc tree and be based
on top of that, for Christoph's I think the idea is to have some go
through the architecture maintainer trees, and have whatever is
left go through my asm-generic tree.

      Arnd
Christoph Hellwig Oct. 30, 2019, 9:35 p.m. UTC | #5
On Mon, Oct 21, 2019 at 09:29:30PM +0200, Arnd Bergmann wrote:
> > Is Christoph's work in next? The series doesn't apply cleanly on next,
> > I needed to fix a couple conflicts. What branch should I rebase it on
> > before resending?
> 
> Not sure, maybe Christoph can comment.
> 
> Your patches would best go through the char-misc tree and be based
> on top of that, for Christoph's I think the idea is to have some go
> through the architecture maintainer trees, and have whatever is
> left go through my asm-generic tree.

Actually I thought of just doing an ioremap tree for this merge window.

What kind of changes does Bartosz have?  I'm kinda missing the context
here.
Bartosz Golaszewski Oct. 31, 2019, 6:41 a.m. UTC | #6
śr., 30 paź 2019 o 22:35 Christoph Hellwig <hch@infradead.org> napisał(a):
>
> On Mon, Oct 21, 2019 at 09:29:30PM +0200, Arnd Bergmann wrote:
> > > Is Christoph's work in next? The series doesn't apply cleanly on next,
> > > I needed to fix a couple conflicts. What branch should I rebase it on
> > > before resending?
> >
> > Not sure, maybe Christoph can comment.
> >
> > Your patches would best go through the char-misc tree and be based
> > on top of that, for Christoph's I think the idea is to have some go
> > through the architecture maintainer trees, and have whatever is
> > left go through my asm-generic tree.
>
> Actually I thought of just doing an ioremap tree for this merge window.
>
> What kind of changes does Bartosz have?  I'm kinda missing the context
> here.

Just the series you've responded to here, but I don't think it should
conflict with your changes (not very much anyway).

Greg: can this be picked up into char-misc?

Bart
Bartosz Golaszewski Oct. 31, 2019, 8:12 a.m. UTC | #7
czw., 31 paź 2019 o 07:41 Bartosz Golaszewski
<bgolaszewski@baylibre.com> napisał(a):
>
> śr., 30 paź 2019 o 22:35 Christoph Hellwig <hch@infradead.org> napisał(a):
> >
> > On Mon, Oct 21, 2019 at 09:29:30PM +0200, Arnd Bergmann wrote:
> > > > Is Christoph's work in next? The series doesn't apply cleanly on next,
> > > > I needed to fix a couple conflicts. What branch should I rebase it on
> > > > before resending?
> > >
> > > Not sure, maybe Christoph can comment.
> > >
> > > Your patches would best go through the char-misc tree and be based
> > > on top of that, for Christoph's I think the idea is to have some go
> > > through the architecture maintainer trees, and have whatever is
> > > left go through my asm-generic tree.
> >
> > Actually I thought of just doing an ioremap tree for this merge window.
> >
> > What kind of changes does Bartosz have?  I'm kinda missing the context
> > here.
>
> Just the series you've responded to here, but I don't think it should
> conflict with your changes (not very much anyway).
>
> Greg: can this be picked up into char-misc?
>
> Bart

I refer of course to the re-sent version rebased on top of char-misc.

Bart