2019-10-06 05:42:26

by Bartosz Golaszewski

[permalink] [raw]
Subject: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

From: Bartosz Golaszewski <[email protected]>

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


2019-10-21 15:05:38

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <[email protected]> napisał(a):
>
> From: Bartosz Golaszewski <[email protected]>
>
> 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

2019-10-21 15:56:00

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <[email protected]> wrote:
> niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <[email protected]> napisał(a):
> > From: Bartosz Golaszewski <[email protected]>
> > 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

2019-10-21 16:30:07

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

pon., 21 paź 2019 o 17:53 Arnd Bergmann <[email protected]> napisał(a):
>
> On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <[email protected]> wrote:
> > niedz., 6 paź 2019 o 07:39 Bartosz Golaszewski <[email protected]> napisał(a):
> > > From: Bartosz Golaszewski <[email protected]>
> > > 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

2019-10-21 19:30:27

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

On Mon, Oct 21, 2019 at 6:29 PM Bartosz Golaszewski <[email protected]> wrote:
> pon., 21 paź 2019 o 17:53 Arnd Bergmann <[email protected]> napisał(a):
> > On Mon, Oct 21, 2019 at 5:04 PM Bartosz Golaszewski <[email protected]> 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

2019-10-30 21:38:43

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

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.

2019-10-31 06:42:53

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

śr., 30 paź 2019 o 22:35 Christoph Hellwig <[email protected]> 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

2019-10-31 08:13:44

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH v3 0/8] drivers: add new variants of devm_platform_ioremap_resource()

czw., 31 paź 2019 o 07:41 Bartosz Golaszewski
<[email protected]> napisał(a):
>
> śr., 30 paź 2019 o 22:35 Christoph Hellwig <[email protected]> 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