Skip to contentSkip to conversation

clk: meson: mark clk81 as critical

PATCH New Jerome Brunet 3 participants 7 messages May 24, 2017 – May 29, 2017

Subsystems (3)
lore
Share & tools
lore

Jerome Brunet

author maintainer
#0 lore raw

v2 cover clk: meson: mark clk81 as critical

The GX (gxbb.c) clock controller driver already marks the clk81 clock as criticial. However, the Meson8b clock controller driver does not do this yet.
This can lead to a freeze of the whole system when clk81 is disabled by the common clock framework (for example after the last child clock is disabled by a driver which used that child clock).

Changes since v1: [0]
With the clock flagged as CRITICAL, CLK_IGNORE_UNUSED is no longer useful. Remove this flag from meson8b and gxbb's clk81.

[0]: https://lkml.kernel.org/r/20170504183201.13175-1-martin.blumenstingl at googlemail.com

Jerome Brunet (1):
clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

Martin Blumenstingl (1):
clk: meson: meson8b: mark clk81 as critical

 drivers/clk/meson/gxbb.c    | 2 +-
 drivers/clk/meson/meson8b.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.4
author maintainer
#1 lore raw

PATCH v2 1/2 clk: meson: meson8b: mark clk81 as critical

From: Martin Blumenstingl <[email protected]>

Disabling clk81 results in an immediate freeze of the whole system. This can happen "accidentally" when the last child-clock of clk81 is disabled (in this case the common clock framework also disables clk81, even if it was only enabled indirectly before).

---
 drivers/clk/meson/meson8b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/meson8b.c +1 -1
index e9985503165c..9d1aaf6e9ac6 100644
@@ -399,7 +399,7 @@ struct clk_gate meson8b_clk81 = {
 		.ops = &clk_gate_ops,
 		.parent_names = (const char *[]){ "mpeg_clk_div" },
 		.num_parents = 1,
-		.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED),
+		.flags = (CLK_SET_RATE_PARENT | CLK_IS_CRITICAL),
 	},
 };
 
Signature · 1 line
2.9.4
#2 lore raw

PATCH v2 1/2 clk: meson: meson8b: mark clk81 as critical

Quoted 19 lines · Jerome Brunet

From: Martin Blumenstingl <[email protected]>

Disabling clk81 results in an immediate freeze of the whole system. This can happen "accidentally" when the last child-clock of clk81 is disabled (in this case the common clock framework also disables clk81, even if it was only enabled indirectly before).

---
 drivers/clk/meson/meson8b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/meson8b.c +0 -0
index e9985503165c..9d1aaf6e9ac6 100644

drivers/clk/meson/meson8b.c struct clk_gate meson8b_clk81 = { · line 405

Quoted 8 lines
drivers/clk/meson/meson8b.c +1 -1
@@ -399,7 +399,7 @@ struct clk_gate meson8b_clk81 = {
 		.ops = &clk_gate_ops,
 		.parent_names = (const char *[]){ "mpeg_clk_div" },
 		.num_parents = 1,
-		.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED),
+		.flags = (CLK_SET_RATE_PARENT | CLK_IS_CRITICAL),
 	},
 };
 
author maintainer
#3 lore raw

PATCH v2 2/2 clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

In reply to Jerome Brunet

clk81 already has CLK_IS_CRITICAL so CLK_IGNORE_UNUSED is not necessary

---
 drivers/clk/meson/gxbb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/gxbb.c +1 -1
index ad5f027af1a2..be6350a03074 100644
@@ -676,7 +676,7 @@ static struct clk_gate gxbb_clk81 = {
 		.ops = &clk_gate_ops,
 		.parent_names = (const char *[]){ "mpeg_clk_div" },
 		.num_parents = 1,
-		.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED | CLK_IS_CRITICAL),
+		.flags = (CLK_SET_RATE_PARENT | CLK_IS_CRITICAL),
 	},
 };
 
Signature · 1 line
2.9.4
#4 lore raw

PATCH v2 2/2 clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

Quoted 14 lines · Jerome Brunet

clk81 already has CLK_IS_CRITICAL so CLK_IGNORE_UNUSED is not necessary

---
 drivers/clk/meson/gxbb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/gxbb.c +0 -0
index ad5f027af1a2..be6350a03074 100644

drivers/clk/meson/gxbb.c static struct clk_gate gxbb_clk81 = { · line 682

Quoted 8 lines
drivers/clk/meson/gxbb.c +1 -1
@@ -676,7 +676,7 @@ static struct clk_gate gxbb_clk81 = {
 		.ops = &clk_gate_ops,
 		.parent_names = (const char *[]){ "mpeg_clk_div" },
 		.num_parents = 1,
-		.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED | CLK_IS_CRITICAL),
+		.flags = (CLK_SET_RATE_PARENT | CLK_IS_CRITICAL),
 	},
 };
 
#5 lore raw

v2 cover clk: meson: mark clk81 as critical

In reply to Jerome Brunet

Quoting Jerome Brunet (2017-05-24 02:39:30)

Quoted 10 lines

The GX (gxbb.c) clock controller driver already marks the clk81 clock as criticial. However, the Meson8b clock controller driver does not do this yet.
This can lead to a freeze of the whole system when clk81 is disabled by the common clock framework (for example after the last child clock is disabled by a driver which used that child clock).

Changes since v1: [0]
With the clock flagged as CRITICAL, CLK_IGNORE_UNUSED is no longer useful. Remove this flag from meson8b and gxbb's clk81.

Both patches look good to me.

Regards,
Mike

Quoted 16 lines

[0]: https://lkml.kernel.org/r/20170504183201.13175-1-martin.blumenstingl at googlemail.com

Jerome Brunet (1):
clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

Martin Blumenstingl (1):
clk: meson: meson8b: mark clk81 as critical

 drivers/clk/meson/gxbb.c    | 2 +-
 drivers/clk/meson/meson8b.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.4
#6 lore raw

v2 cover clk: meson: mark clk81 as critical

In reply to Jerome Brunet
Quoted 16 lines · Jerome Brunet

The GX (gxbb.c) clock controller driver already marks the clk81 clock as criticial. However, the Meson8b clock controller driver does not do this yet.
This can lead to a freeze of the whole system when clk81 is disabled by the common clock framework (for example after the last child clock is disabled by a driver which used that child clock).

Changes since v1: [0]
With the clock flagged as CRITICAL, CLK_IGNORE_UNUSED is no longer useful. Remove this flag from meson8b and gxbb's clk81.

[0]: https://lkml.kernel.org/r/20170504183201.13175-1-martin.blumenstingl at googlemail.com

Jerome Brunet (1):
clk: gxbb: remove CLK_IGNORE_UNUSED from clk81

Quoted 7 lines

Martin Blumenstingl (1):
clk: meson: meson8b: mark clk81 as critical

 drivers/clk/meson/gxbb.c    | 2 +-
 drivers/clk/meson/meson8b.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied,

Thanks,
Neil