LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
@ 2019-02-19 16:51 Alexandre Belloni
  2019-02-20 10:20 ` Nicolas.Ferre
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexandre Belloni @ 2019-02-19 16:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Nicolas Ferre, Michael Turquette, linux-clk, linux-arm-kernel,
	linux-kernel, Alexandre Belloni

nck() looks at the last id in an array and unfortunately,
at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
number of peripheral clocks is 1 instead of a maximum of 31.

Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/clk/at91/at91sam9x5.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
index 2fe225a697df..d37e7ed9eb90 100644
--- a/drivers/clk/at91/at91sam9x5.c
+++ b/drivers/clk/at91/at91sam9x5.c
@@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
 		return;
 
 	at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
-					   nck(at91sam9x5_systemck),
-					   nck(at91sam9x35_periphck), 0);
+					   nck(at91sam9x5_systemck), 31, 0);
 	if (!at91sam9x5_pmc)
 		return;
 
-- 
2.20.1


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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-19 16:51 [PATCH] clk: at91: fix at91sam9x5 peripheral clock number Alexandre Belloni
@ 2019-02-20 10:20 ` Nicolas.Ferre
  2019-02-20 10:29   ` Alexandre Belloni
  2019-02-20 11:18 ` Nicolas.Ferre
  2019-02-20 19:39 ` Stephen Boyd
  2 siblings, 1 reply; 7+ messages in thread
From: Nicolas.Ferre @ 2019-02-20 10:20 UTC (permalink / raw)
  To: alexandre.belloni, sboyd
  Cc: mturquette, linux-clk, linux-arm-kernel, linux-kernel

On 19/02/2019 at 17:51, Alexandre Belloni wrote:
> nck() looks at the last id in an array and unfortunately,
> at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated

Well, the logic for all other SoC clk files is to not have such a 
sentinel and deal differently with this type of array: why not modify 
this file to match with others?


> number of peripheral clocks is 1 instead of a maximum of 31.
> 
> Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>   drivers/clk/at91/at91sam9x5.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
> index 2fe225a697df..d37e7ed9eb90 100644
> --- a/drivers/clk/at91/at91sam9x5.c
> +++ b/drivers/clk/at91/at91sam9x5.c
> @@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
>   		return;
>   
>   	at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
> -					   nck(at91sam9x5_systemck),
> -					   nck(at91sam9x35_periphck), 0);
> +					   nck(at91sam9x5_systemck), 31, 0);

I would prefer like it's done on other SoC clk files.

>   	if (!at91sam9x5_pmc)
>   		return;
>   
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-20 10:20 ` Nicolas.Ferre
@ 2019-02-20 10:29   ` Alexandre Belloni
  2019-02-20 10:48     ` Nicolas.Ferre
  0 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2019-02-20 10:29 UTC (permalink / raw)
  To: Nicolas.Ferre
  Cc: sboyd, mturquette, linux-clk, linux-arm-kernel, linux-kernel

On 20/02/2019 10:20:28+0000, Nicolas Ferre wrote:
> On 19/02/2019 at 17:51, Alexandre Belloni wrote:
> > nck() looks at the last id in an array and unfortunately,
> > at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
> 
> Well, the logic for all other SoC clk files is to not have such a 
> sentinel and deal differently with this type of array: why not modify 
> this file to match with others?
> 
> 
> > number of peripheral clocks is 1 instead of a maximum of 31.
> > 
> > Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > ---
> >   drivers/clk/at91/at91sam9x5.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
> > index 2fe225a697df..d37e7ed9eb90 100644
> > --- a/drivers/clk/at91/at91sam9x5.c
> > +++ b/drivers/clk/at91/at91sam9x5.c
> > @@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
> >   		return;
> >   
> >   	at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
> > -					   nck(at91sam9x5_systemck),
> > -					   nck(at91sam9x35_periphck), 0);
> > +					   nck(at91sam9x5_systemck), 31, 0);
> 
> I would prefer like it's done on other SoC clk files.
> 

Well, that is not possible, what do you suggest?

> >   	if (!at91sam9x5_pmc)
> >   		return;
> >   
> > 
> 
> 
> -- 
> Nicolas Ferre

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-20 10:29   ` Alexandre Belloni
@ 2019-02-20 10:48     ` Nicolas.Ferre
  0 siblings, 0 replies; 7+ messages in thread
From: Nicolas.Ferre @ 2019-02-20 10:48 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: sboyd, mturquette, linux-clk, linux-arm-kernel, linux-kernel

On 20/02/2019 at 11:29, Alexandre Belloni wrote:
> On 20/02/2019 10:20:28+0000, Nicolas Ferre wrote:
>> On 19/02/2019 at 17:51, Alexandre Belloni wrote:
>>> nck() looks at the last id in an array and unfortunately,
>>> at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
>>
>> Well, the logic for all other SoC clk files is to not have such a
>> sentinel and deal differently with this type of array: why not modify
>> this file to match with others?
>>
>>
>>> number of peripheral clocks is 1 instead of a maximum of 31.
>>>
>>> Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
>>> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>> ---
>>>    drivers/clk/at91/at91sam9x5.c | 3 +--
>>>    1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
>>> index 2fe225a697df..d37e7ed9eb90 100644
>>> --- a/drivers/clk/at91/at91sam9x5.c
>>> +++ b/drivers/clk/at91/at91sam9x5.c
>>> @@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
>>>    		return;
>>>    
>>>    	at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
>>> -					   nck(at91sam9x5_systemck),
>>> -					   nck(at91sam9x35_periphck), 0);
>>> +					   nck(at91sam9x5_systemck), 31, 0);
>>
>> I would prefer like it's done on other SoC clk files.
>>
> 
> Well, that is not possible, what do you suggest?

Okay: seen: let's keep it like this.

> 
>>>    	if (!at91sam9x5_pmc)
>>>    		return;
>>>    
>>>
>>
>>
>> -- 
>> Nicolas Ferre
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-19 16:51 [PATCH] clk: at91: fix at91sam9x5 peripheral clock number Alexandre Belloni
  2019-02-20 10:20 ` Nicolas.Ferre
@ 2019-02-20 11:18 ` Nicolas.Ferre
  2019-02-20 19:39   ` Stephen Boyd
  2019-02-20 19:39 ` Stephen Boyd
  2 siblings, 1 reply; 7+ messages in thread
From: Nicolas.Ferre @ 2019-02-20 11:18 UTC (permalink / raw)
  To: alexandre.belloni, sboyd
  Cc: mturquette, linux-clk, linux-arm-kernel, linux-kernel

On 19/02/2019 at 17:51, Alexandre Belloni wrote:
> nck() looks at the last id in an array and unfortunately,
> at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
> number of peripheral clocks is 1 instead of a maximum of 31.
> 
> Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: <stable@vger.kernel.org> # v4.20+

It would be nice to queue it as a fix the soonest, as it impacts 5.0 but 
not 4.20 due to a switch from one DT binding to another (read: a real 
regression)... But I know it's a bit late in the cycle...

Regards,
   Nicolas

> ---
>   drivers/clk/at91/at91sam9x5.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c
> index 2fe225a697df..d37e7ed9eb90 100644
> --- a/drivers/clk/at91/at91sam9x5.c
> +++ b/drivers/clk/at91/at91sam9x5.c
> @@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,
>   		return;
>   
>   	at91sam9x5_pmc = pmc_data_allocate(PMC_MAIN + 1,
> -					   nck(at91sam9x5_systemck),
> -					   nck(at91sam9x35_periphck), 0);
> +					   nck(at91sam9x5_systemck), 31, 0);
>   	if (!at91sam9x5_pmc)
>   		return;
>   
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-20 11:18 ` Nicolas.Ferre
@ 2019-02-20 19:39   ` Stephen Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2019-02-20 19:39 UTC (permalink / raw)
  To: Nicolas.Ferre, alexandre.belloni
  Cc: mturquette, linux-clk, linux-arm-kernel, linux-kernel

Quoting Nicolas.Ferre@microchip.com (2019-02-20 03:18:40)
> On 19/02/2019 at 17:51, Alexandre Belloni wrote:
> > nck() looks at the last id in an array and unfortunately,
> > at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
> > number of peripheral clocks is 1 instead of a maximum of 31.
> > 
> > Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: <stable@vger.kernel.org> # v4.20+
> 
> It would be nice to queue it as a fix the soonest, as it impacts 5.0 but 
> not 4.20 due to a switch from one DT binding to another (read: a real 
> regression)... But I know it's a bit late in the cycle...
> 

Ok. Let's send it off tomorrow.


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

* Re: [PATCH] clk: at91: fix at91sam9x5 peripheral clock number
  2019-02-19 16:51 [PATCH] clk: at91: fix at91sam9x5 peripheral clock number Alexandre Belloni
  2019-02-20 10:20 ` Nicolas.Ferre
  2019-02-20 11:18 ` Nicolas.Ferre
@ 2019-02-20 19:39 ` Stephen Boyd
  2 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2019-02-20 19:39 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolas Ferre, Michael Turquette, linux-clk, linux-arm-kernel,
	linux-kernel, Alexandre Belloni

Quoting Alexandre Belloni (2019-02-19 08:51:14)
> nck() looks at the last id in an array and unfortunately,
> at91sam9x35_periphck has a sentinel, hence the id is 0 and the calculated
> number of peripheral clocks is 1 instead of a maximum of 31.
> 
> Fixes: 1eabdc2f9dd8 ("clk: at91: add at91sam9x5 PMCs driver")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---

Applied to clk-fixes


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

end of thread, other threads:[~2019-02-20 19:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 16:51 [PATCH] clk: at91: fix at91sam9x5 peripheral clock number Alexandre Belloni
2019-02-20 10:20 ` Nicolas.Ferre
2019-02-20 10:29   ` Alexandre Belloni
2019-02-20 10:48     ` Nicolas.Ferre
2019-02-20 11:18 ` Nicolas.Ferre
2019-02-20 19:39   ` Stephen Boyd
2019-02-20 19:39 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).