All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: mvebu: drop pwm base assignment
@ 2022-04-11  6:23 Baruch Siach
  2022-04-11  6:48 ` Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Baruch Siach @ 2022-04-11  6:23 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König, Lee Jones
  Cc: Russell King, linux-pwm, linux-gpio, Baruch Siach

pwmchip_add() unconditionally assigns the base ID dynamically. Commit
f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
dropped all base assignment from drivers under drivers/pwm/. It missed
this driver. Fix that.

Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/gpio/gpio-mvebu.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 4c1f9e1091b7..a2c8dd329b31 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 	mvpwm->chip.dev = dev;
 	mvpwm->chip.ops = &mvebu_pwm_ops;
 	mvpwm->chip.npwm = mvchip->chip.ngpio;
-	/*
-	 * There may already be some PWM allocated, so we can't force
-	 * mvpwm->chip.base to a fixed point like mvchip->chip.base.
-	 * So, we let pwmchip_add() do the numbering and take the next free
-	 * region.
-	 */
-	mvpwm->chip.base = -1;
 
 	spin_lock_init(&mvpwm->lock);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-11  6:23 [PATCH] gpio: mvebu: drop pwm base assignment Baruch Siach
@ 2022-04-11  6:48 ` Uwe Kleine-König
  2022-04-22 16:48 ` Thierry Reding
  2022-05-02  8:47 ` Bartosz Golaszewski
  2 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2022-04-11  6:48 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Thierry Reding, Lee Jones, Russell King, linux-pwm, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

Hello Baruch,

On Mon, Apr 11, 2022 at 09:23:40AM +0300, Baruch Siach wrote:
> pwmchip_add() unconditionally assigns the base ID dynamically. Commit
> f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> dropped all base assignment from drivers under drivers/pwm/. It missed
> this driver. Fix that.
> 
> Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Thanks for catching this.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

There is another one in drivers/staging/greybus/pwm.c, will send a patch
shortly.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-11  6:23 [PATCH] gpio: mvebu: drop pwm base assignment Baruch Siach
  2022-04-11  6:48 ` Uwe Kleine-König
@ 2022-04-22 16:48 ` Thierry Reding
  2022-04-22 22:18   ` Linus Walleij
  2022-05-02  8:47 ` Bartosz Golaszewski
  2 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2022-04-22 16:48 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski
  Cc: Baruch Siach, Uwe Kleine-König, Lee Jones, Russell King,
	linux-pwm, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 1560 bytes --]

On Mon, Apr 11, 2022 at 09:23:40AM +0300, Baruch Siach wrote:
> pwmchip_add() unconditionally assigns the base ID dynamically. Commit
> f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> dropped all base assignment from drivers under drivers/pwm/. It missed
> this driver. Fix that.
> 
> Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  drivers/gpio/gpio-mvebu.c | 7 -------
>  1 file changed, 7 deletions(-)

Linus, Bartosz,

I see that this was Cc'ed to linux-gpio but not to you guys, so I'm not
sure if you're aware of this. Given that this touches the PWM-specific
bits of this driver I could also pick this up into the PWM tree if you
don't mind.

Quoting in full in case you don't have this in your inboxes.

Thierry

> diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
> index 4c1f9e1091b7..a2c8dd329b31 100644
> --- a/drivers/gpio/gpio-mvebu.c
> +++ b/drivers/gpio/gpio-mvebu.c
> @@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  	mvpwm->chip.dev = dev;
>  	mvpwm->chip.ops = &mvebu_pwm_ops;
>  	mvpwm->chip.npwm = mvchip->chip.ngpio;
> -	/*
> -	 * There may already be some PWM allocated, so we can't force
> -	 * mvpwm->chip.base to a fixed point like mvchip->chip.base.
> -	 * So, we let pwmchip_add() do the numbering and take the next free
> -	 * region.
> -	 */
> -	mvpwm->chip.base = -1;
>  
>  	spin_lock_init(&mvpwm->lock);
>  
> -- 
> 2.35.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-22 16:48 ` Thierry Reding
@ 2022-04-22 22:18   ` Linus Walleij
  2022-04-23 16:18     ` Uwe Kleine-König
  0 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2022-04-22 22:18 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Lee Jones, Russell King, linux-pwm, linux-gpio

On Fri, Apr 22, 2022 at 6:48 PM Thierry Reding <thierry.reding@gmail.com> wrote:

> > -     /*
> > -      * There may already be some PWM allocated, so we can't force
> > -      * mvpwm->chip.base to a fixed point like mvchip->chip.base.
> > -      * So, we let pwmchip_add() do the numbering and take the next free
> > -      * region.
> > -      */
> > -     mvpwm->chip.base = -1;

I don't see why this is removed. I understand why the comment is removed
but all contemporary GPIO chips should use dynamic assignment of numbers
i.e. base = -1.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-22 22:18   ` Linus Walleij
@ 2022-04-23 16:18     ` Uwe Kleine-König
  2022-04-24 13:30       ` Linus Walleij
  0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2022-04-23 16:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Thierry Reding, Bartosz Golaszewski, Baruch Siach, Lee Jones,
	Russell King, linux-pwm, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

On Sat, Apr 23, 2022 at 12:18:20AM +0200, Linus Walleij wrote:
> On Fri, Apr 22, 2022 at 6:48 PM Thierry Reding <thierry.reding@gmail.com> wrote:
> 
> > > -     /*
> > > -      * There may already be some PWM allocated, so we can't force
> > > -      * mvpwm->chip.base to a fixed point like mvchip->chip.base.
> > > -      * So, we let pwmchip_add() do the numbering and take the next free
> > > -      * region.
> > > -      */
> > > -     mvpwm->chip.base = -1;
> 
> I don't see why this is removed. I understand why the comment is removed
> but all contemporary GPIO chips should use dynamic assignment of numbers
> i.e. base = -1.

This is an assignment to struct pwm_chip::base, not struct gpio_chip::base.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-23 16:18     ` Uwe Kleine-König
@ 2022-04-24 13:30       ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2022-04-24 13:30 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Thierry Reding, Bartosz Golaszewski, Baruch Siach, Lee Jones,
	Russell King, linux-pwm, linux-gpio

On Sat, Apr 23, 2022 at 6:18 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> On Sat, Apr 23, 2022 at 12:18:20AM +0200, Linus Walleij wrote:
> > On Fri, Apr 22, 2022 at 6:48 PM Thierry Reding <thierry.reding@gmail.com> wrote:
> >
> > > > -     /*
> > > > -      * There may already be some PWM allocated, so we can't force
> > > > -      * mvpwm->chip.base to a fixed point like mvchip->chip.base.
> > > > -      * So, we let pwmchip_add() do the numbering and take the next free
> > > > -      * region.
> > > > -      */
> > > > -     mvpwm->chip.base = -1;
> >
> > I don't see why this is removed. I understand why the comment is removed
> > but all contemporary GPIO chips should use dynamic assignment of numbers
> > i.e. base = -1.
>
> This is an assignment to struct pwm_chip::base, not struct gpio_chip::base.

Ah, how confusing.
If this is OK with Uwe:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-04-11  6:23 [PATCH] gpio: mvebu: drop pwm base assignment Baruch Siach
  2022-04-11  6:48 ` Uwe Kleine-König
  2022-04-22 16:48 ` Thierry Reding
@ 2022-05-02  8:47 ` Bartosz Golaszewski
  2022-05-02  9:10   ` Baruch Siach
  2 siblings, 1 reply; 9+ messages in thread
From: Bartosz Golaszewski @ 2022-05-02  8:47 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Thierry Reding, Uwe Kleine-König, Lee Jones, Russell King,
	open list:PWM SUBSYSTEM, open list:GPIO SUBSYSTEM

On Mon, Apr 11, 2022 at 8:25 AM Baruch Siach <baruch@tkos.co.il> wrote:
>
> pwmchip_add() unconditionally assigns the base ID dynamically. Commit
> f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> dropped all base assignment from drivers under drivers/pwm/. It missed
> this driver. Fix that.
>
> Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  drivers/gpio/gpio-mvebu.c | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
> index 4c1f9e1091b7..a2c8dd329b31 100644
> --- a/drivers/gpio/gpio-mvebu.c
> +++ b/drivers/gpio/gpio-mvebu.c
> @@ -871,13 +871,6 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>         mvpwm->chip.dev = dev;
>         mvpwm->chip.ops = &mvebu_pwm_ops;
>         mvpwm->chip.npwm = mvchip->chip.ngpio;
> -       /*
> -        * There may already be some PWM allocated, so we can't force
> -        * mvpwm->chip.base to a fixed point like mvchip->chip.base.
> -        * So, we let pwmchip_add() do the numbering and take the next free
> -        * region.
> -        */
> -       mvpwm->chip.base = -1;
>
>         spin_lock_init(&mvpwm->lock);
>
> --
> 2.35.1
>

Queued for fixes, thanks!

Bart

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-05-02  8:47 ` Bartosz Golaszewski
@ 2022-05-02  9:10   ` Baruch Siach
  2022-05-02  9:30     ` Bartosz Golaszewski
  0 siblings, 1 reply; 9+ messages in thread
From: Baruch Siach @ 2022-05-02  9:10 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Thierry Reding, Uwe Kleine-König, Lee Jones, Russell King,
	open list:PWM SUBSYSTEM, open list:GPIO SUBSYSTEM, Linus Walleij

Hi Bartosz,

On Mon, May 02 2022, Bartosz Golaszewski wrote:
> On Mon, Apr 11, 2022 at 8:25 AM Baruch Siach <baruch@tkos.co.il> wrote:
>>
>> pwmchip_add() unconditionally assigns the base ID dynamically. Commit
>> f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
>> dropped all base assignment from drivers under drivers/pwm/. It missed
>> this driver. Fix that.
>>
>> Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

[...]

> Queued for fixes, thanks!

Thanks. I see it's in your tree (brgl/linux). Is that the main GPIO
development tree now? The MAINTAINERS entry for GPIO SUBSYSTEM currently
lists linusw/linux-gpio.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] gpio: mvebu: drop pwm base assignment
  2022-05-02  9:10   ` Baruch Siach
@ 2022-05-02  9:30     ` Bartosz Golaszewski
  0 siblings, 0 replies; 9+ messages in thread
From: Bartosz Golaszewski @ 2022-05-02  9:30 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Thierry Reding, Uwe Kleine-König, Lee Jones, Russell King,
	open list:PWM SUBSYSTEM, open list:GPIO SUBSYSTEM, Linus Walleij

On Mon, May 2, 2022 at 11:14 AM Baruch Siach <baruch@tkos.co.il> wrote:
>
> Hi Bartosz,
>
> On Mon, May 02 2022, Bartosz Golaszewski wrote:
> > On Mon, Apr 11, 2022 at 8:25 AM Baruch Siach <baruch@tkos.co.il> wrote:
> >>
> >> pwmchip_add() unconditionally assigns the base ID dynamically. Commit
> >> f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> >> dropped all base assignment from drivers under drivers/pwm/. It missed
> >> this driver. Fix that.
> >>
> >> Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically")
> >> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>
> [...]
>
> > Queued for fixes, thanks!
>
> Thanks. I see it's in your tree (brgl/linux). Is that the main GPIO
> development tree now? The MAINTAINERS entry for GPIO SUBSYSTEM currently
> lists linusw/linux-gpio.
>
> baruch

Thanks for spotting that! Yes, that's the main tree, I will send a fix.

Bart

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-02  9:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11  6:23 [PATCH] gpio: mvebu: drop pwm base assignment Baruch Siach
2022-04-11  6:48 ` Uwe Kleine-König
2022-04-22 16:48 ` Thierry Reding
2022-04-22 22:18   ` Linus Walleij
2022-04-23 16:18     ` Uwe Kleine-König
2022-04-24 13:30       ` Linus Walleij
2022-05-02  8:47 ` Bartosz Golaszewski
2022-05-02  9:10   ` Baruch Siach
2022-05-02  9:30     ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.