clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates
Subsystems (3)
Sergio Paracuellos
maintainerPATCH 1/1 clk: ralink: avoid to set 'CLK_IS_CRITICAL' flag for gates
'clk_init_data' for gates is setting up 'CLK_IS_CRITICAL' flag for all of them. This was being doing because some drivers of this SoC might not be ready to use the clock and we don't wanted the kernel to disable them since default behaviour without clock driver was to set all gate bits to enabled state. After a bit more testing and checking driver code it is safe to remove this flag and just let the kernel to disable those gates that are not in use. No regressions seems to appear.
--- drivers/clk/ralink/clk-mt7621.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/clk/ralink/clk-mt7621.c +1 -8
@@ -131,14 +131,7 @@ static int mt7621_gate_ops_init(struct device *dev, struct mt7621_gate *sclk) {struct clk_init_data init = { -/* -* Until now no clock driver existed so -* these SoC drivers are not prepared -* yet for the clock. We don't want kernel to -* disable anything so we add CLK_IS_CRITICAL -* flag here. -*/ - .flags =CLK_SET_RATE_PARENT |CLK_IS_CRITICAL , + .flags =CLK_SET_RATE_PARENT , .num_parents =1 , .parent_names = &sclk->parent_name, .ops = &mt7621_gate_ops,
Signature · 1 line
2.25.1
Sergio Paracuellos
maintainerQuoted 11 lines · Sergio Paracuellos
'
clk_init_data' for gates is setting up 'CLK_IS_CRITICAL' flag for all of them. This was being doing because some drivers of this SoC might not be ready to use the clock and we don't wanted the kernel to disable them since default behaviour without clock driver was to set all gate bits to enabled state. After a bit more testing and checking driver code it is safe to remove this flag and just let the kernel to disable those gates that are not in use. No regressions seems to appear.
Quoted 5 lines
Fixes 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")Signed-off-by Sergio Paracuellos <[email protected]>--- drivers/clk/ralink/clk-mt7621.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
Hi Stephen,
Are you ok with this?? It has been a while without response.
Thanks in advance for your time.
Sergio Paracuellos
Quoted 24 lines
drivers/clk/ralink/clk-mt7621.c +1
-9@@ -131,14 +131,7 @@ static int mt7621_gate_ops_init(struct device *dev, struct mt7621_gate *sclk) {struct clk_init_data init = { - /* - * Until now no clock driver existed so - * these SoC drivers are not prepared - * yet for the clock. We don't want kernel to - * disable anything so we add CLK_IS_CRITICAL - * flag here. - */ - .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, + .flags =CLK_SET_RATE_PARENT , .num_parents =1 , .parent_names = &sclk->parent_name, .ops = &mt7621_gate_ops, --2.25.1
Quoting Sergio Paracuellos (2021-07-26 22:55:37)
Quoted 10 lines
'
clk_init_data' for gates is setting up 'CLK_IS_CRITICAL' flag for all of them. This was being doing because some drivers of this SoC might not be ready to use the clock and we don't wanted the kernel to disable them since default behaviour without clock driver was to set all gate bits to enabled state. After a bit more testing and checking driver code it is safe to remove this flag and just let the kernel to disable those gates that are not in use. No regressions seems to appear.
Quoted 3 lines
Fixes 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")Signed-off-by Sergio Paracuellos <[email protected]>---
Applied to clk-next