clk: at91: fix at91sam9x5 peripheral clock number
Subsystems (2)
Alexandre Belloni
maintainerPATCH 1/1 clk: at91: fix at91sam9x5 peripheral clock number
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.
--- drivers/clk/at91/at91sam9x5.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/at91/at91sam9x5.c +1 -2
@@ -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 ;
Signature · 1 line
2.20.1
[email protected]
maintainerQuoted 2 lines · Alexandre Belloni
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas 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?
Quoted 13 lines
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 <[email protected]>--- drivers/clk/at91/at91sam9x5.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/clk/at91/at91sam9x5.c +0
-0
drivers/clk/at91/at91sam9x5.c static void __init at91sam9x5_pmc_setup(struct device_node *np, · line 147
Quoted 6 lines
drivers/clk/at91/at91sam9x5.c +1
-2@@ -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.
Quoted 4 lines
drivers/clk/at91/at91sam9x5.c +0
-0if (!at91sam9x5_pmc)return ;
Signature · 5 lines
Nicolas Ferre _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Alexandre Belloni
maintainerQuoted 24 lines · Nicolas Ferre
Quoted 2 lines · Alexandre Belloni
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas a sentinel, hence the id is 0 and the calculatedWell, 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?
Quoted 15 lines
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 <[email protected]>--- drivers/clk/at91/at91sam9x5.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/clk/at91/at91sam9x5.c +0
-0@@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,return ;
Quoted 7 lines
drivers/clk/at91/at91sam9x5.c static void __init at91sam9x5_pmc_setup(struct device_node *np, · line 147
Quoted 4 lines
drivers/clk/at91/at91sam9x5.c +1
-2at91sam9x5_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?
Quoted 8 lines
Quoted 4 lines
drivers/clk/at91/at91sam9x5.c +0
-0if (!at91sam9x5_pmc)return ;Signature · 1 line
Nicolas Ferre
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
[email protected]
maintainerQuoted 33 lines · Alexandre Belloni
Quoted 24 lines · Nicolas Ferre
Quoted 2 lines · Alexandre Belloni
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas a sentinel, hence the id is 0 and the calculatedWell, 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?
Quoted 15 lines
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 <[email protected]>--- drivers/clk/at91/at91sam9x5.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/clk/at91/at91sam9x5.c +0
-0@@ -144,8 +144,7 @@ static void __init at91sam9x5_pmc_setup(struct device_node *np,return ;Quoted 7 lines
drivers/clk/at91/at91sam9x5.c static void __init at91sam9x5_pmc_setup(struct device_node *np, · line 147
Quoted 4 lines
drivers/clk/at91/at91sam9x5.c +1
-2at91sam9x5_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.
Quoted 1 line
Well, that is not possible, what do you suggest?
Okay: seen: let's keep it like this.
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
drivers/clk/at91/at91sam9x5.c +0
-0if (!at91sam9x5_pmc)return ;Signature · 1 line
Nicolas Ferre
Signature · 1 line
Nicolas Ferre
Quoted 6 lines · Alexandre Belloni
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas 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 <[email protected]>
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
Quoted 19 lines
--- drivers/clk/at91/at91sam9x5.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/clk/at91/at91sam9x5.c +1
-2@@ -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 ;
Signature · 1 line
Nicolas Ferre
Stephen Boyd
maintainerQuoting [email protected] (2019-02-20 03:18:40)
Quoted 8 lines · Alexandre Belloni
Quoted 6 lines
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas 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 <[email protected]>
Quoted 7 lines
Acked-by Nicolas Ferre <[email protected]>Cc <[email protected]> # 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.
Quoting Alexandre Belloni (2019-02-19 08:51:14)
Quoted 7 lines
nck()looks at the last id in an array and unfortunately,at91sam9x35_periphckhas 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 <[email protected]>---
Applied to clk-fixes