All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
@ 2024-04-30  9:54 ` André Draszik
  0 siblings, 0 replies; 8+ messages in thread
From: André Draszik @ 2024-04-30  9:54 UTC (permalink / raw
  To: Peter Griffin, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Tudor Ambarus, Will McVicker, kernel-team, André Draszik

The system hangs when any of these clocks are turned off.

With the introduction of pinctrl clock support [1], the approach taken
in this clock driver for the APM clocks to rely solely on the
clk_ignore_unused kernel command line option does not work anymore and
the system hangs during boot.

gout_apm_func is a parent clock to the clocks that are going to be
handled by the pinctrl driver [2], namely
gout_apm_apbif_gpio_alive_pclk and gout_apm_apbif_gpio_far_alive_pclk.
It also is the parent to the clocks marked as critical in this commit
here (and some others that aren't relevant for this commit)). This
means that once the pinctrl driver decides to turn off clocks, the
clock framework will subsequently turn off parent clocks of those
pinctrl clocks if they have no (apparent) user. Since gout_apm_func is
the parent, and since no drivers are hooked up to it or any of its
other children, gout_apm_func will be turned off. This will cause the
system to hang, as the clocks marked as critical in this commit stop
having an input.

We might have to add a driver for these clocks, but in the meantime
let's just ensure they stay on even if siblings are turned off.

For the avoidance of doubt: This commit doesn't mean that we can boot
with clk_ignore_unused.

Link: https://lore.kernel.org/r/20240426-samsung-pinctrl-busclock-v3-0-adb8664b8a7e@linaro.org [1]
Link: https://lore.kernel.org/r/20240429-samsung-pinctrl-busclock-dts-v1-0-5e935179f3ca@linaro.org [2]
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 drivers/clk/samsung/clk-gs101.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c
index 05129c3b2f68..e2a6a1992505 100644
--- a/drivers/clk/samsung/clk-gs101.c
+++ b/drivers/clk/samsung/clk-gs101.c
@@ -1896,16 +1896,16 @@ static const struct samsung_gate_clock apm_gate_clks[] __initconst = {
 	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_G_SWD_IPCLKPORT_PCLK, 21, 0, 0),
 	GATE(CLK_GOUT_APM_UASC_P_APM_ACLK,
 	     "gout_apm_uasc_p_apm_aclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0),
 	GATE(CLK_GOUT_APM_UASC_P_APM_PCLK,
 	     "gout_apm_uasc_p_apm_pclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, CLK_IS_CRITICAL, 0),
 	GATE(CLK_GOUT_APM_WDT_APM_PCLK,
 	     "gout_apm_wdt_apm_pclk", "gout_apm_func",
 	     CLK_CON_GAT_GOUT_BLK_APM_UID_WDT_APM_IPCLKPORT_PCLK, 21, 0, 0),
 	GATE(CLK_GOUT_APM_XIU_DP_APM_ACLK,
 	     "gout_apm_xiu_dp_apm_aclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0),
 };
 
 static const struct samsung_cmu_info apm_cmu_info __initconst = {

---
base-commit: d04466706db5e241ee026f17b5f920e50dee26b5
change-id: 20240430-gs101-apm-clocks-fb0918ceaecb

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>


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

* [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
@ 2024-04-30  9:54 ` André Draszik
  0 siblings, 0 replies; 8+ messages in thread
From: André Draszik @ 2024-04-30  9:54 UTC (permalink / raw
  To: Peter Griffin, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Tudor Ambarus, Will McVicker, kernel-team, André Draszik

The system hangs when any of these clocks are turned off.

With the introduction of pinctrl clock support [1], the approach taken
in this clock driver for the APM clocks to rely solely on the
clk_ignore_unused kernel command line option does not work anymore and
the system hangs during boot.

gout_apm_func is a parent clock to the clocks that are going to be
handled by the pinctrl driver [2], namely
gout_apm_apbif_gpio_alive_pclk and gout_apm_apbif_gpio_far_alive_pclk.
It also is the parent to the clocks marked as critical in this commit
here (and some others that aren't relevant for this commit)). This
means that once the pinctrl driver decides to turn off clocks, the
clock framework will subsequently turn off parent clocks of those
pinctrl clocks if they have no (apparent) user. Since gout_apm_func is
the parent, and since no drivers are hooked up to it or any of its
other children, gout_apm_func will be turned off. This will cause the
system to hang, as the clocks marked as critical in this commit stop
having an input.

We might have to add a driver for these clocks, but in the meantime
let's just ensure they stay on even if siblings are turned off.

For the avoidance of doubt: This commit doesn't mean that we can boot
with clk_ignore_unused.

Link: https://lore.kernel.org/r/20240426-samsung-pinctrl-busclock-v3-0-adb8664b8a7e@linaro.org [1]
Link: https://lore.kernel.org/r/20240429-samsung-pinctrl-busclock-dts-v1-0-5e935179f3ca@linaro.org [2]
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
 drivers/clk/samsung/clk-gs101.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/samsung/clk-gs101.c b/drivers/clk/samsung/clk-gs101.c
index 05129c3b2f68..e2a6a1992505 100644
--- a/drivers/clk/samsung/clk-gs101.c
+++ b/drivers/clk/samsung/clk-gs101.c
@@ -1896,16 +1896,16 @@ static const struct samsung_gate_clock apm_gate_clks[] __initconst = {
 	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_G_SWD_IPCLKPORT_PCLK, 21, 0, 0),
 	GATE(CLK_GOUT_APM_UASC_P_APM_ACLK,
 	     "gout_apm_uasc_p_apm_aclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0),
 	GATE(CLK_GOUT_APM_UASC_P_APM_PCLK,
 	     "gout_apm_uasc_p_apm_pclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_UASC_P_APM_IPCLKPORT_PCLK, 21, CLK_IS_CRITICAL, 0),
 	GATE(CLK_GOUT_APM_WDT_APM_PCLK,
 	     "gout_apm_wdt_apm_pclk", "gout_apm_func",
 	     CLK_CON_GAT_GOUT_BLK_APM_UID_WDT_APM_IPCLKPORT_PCLK, 21, 0, 0),
 	GATE(CLK_GOUT_APM_XIU_DP_APM_ACLK,
 	     "gout_apm_xiu_dp_apm_aclk", "gout_apm_func",
-	     CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, 0, 0),
+	     CLK_CON_GAT_GOUT_BLK_APM_UID_XIU_DP_APM_IPCLKPORT_ACLK, 21, CLK_IS_CRITICAL, 0),
 };
 
 static const struct samsung_cmu_info apm_cmu_info __initconst = {

---
base-commit: d04466706db5e241ee026f17b5f920e50dee26b5
change-id: 20240430-gs101-apm-clocks-fb0918ceaecb

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
  2024-04-30  9:54 ` André Draszik
@ 2024-05-02  7:03   ` Tudor Ambarus
  -1 siblings, 0 replies; 8+ messages in thread
From: Tudor Ambarus @ 2024-05-02  7:03 UTC (permalink / raw
  To: André Draszik, Peter Griffin, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Will McVicker, kernel-team



On 4/30/24 10:54, André Draszik wrote:
> The system hangs when any of these clocks are turned off.
> 
> With the introduction of pinctrl clock support [1], the approach taken
> in this clock driver for the APM clocks to rely solely on the
> clk_ignore_unused kernel command line option does not work anymore and
> the system hangs during boot.
> 
> gout_apm_func is a parent clock to the clocks that are going to be
> handled by the pinctrl driver [2], namely
> gout_apm_apbif_gpio_alive_pclk and gout_apm_apbif_gpio_far_alive_pclk.
> It also is the parent to the clocks marked as critical in this commit
> here (and some others that aren't relevant for this commit)). This
> means that once the pinctrl driver decides to turn off clocks, the
> clock framework will subsequently turn off parent clocks of those
> pinctrl clocks if they have no (apparent) user. Since gout_apm_func is
> the parent, and since no drivers are hooked up to it or any of its
> other children, gout_apm_func will be turned off. This will cause the
> system to hang, as the clocks marked as critical in this commit stop
> having an input.
> 
> We might have to add a driver for these clocks, but in the meantime
> let's just ensure they stay on even if siblings are turned off.

It's sane, yes.

> 
> For the avoidance of doubt: This commit doesn't mean that we can boot
> with clk_ignore_unused.
> 

s/with/without. Because there are still other clocks that are not yet
handled/marked as critical where needed. There's still work to do.

With the typo addressed:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
@ 2024-05-02  7:03   ` Tudor Ambarus
  0 siblings, 0 replies; 8+ messages in thread
From: Tudor Ambarus @ 2024-05-02  7:03 UTC (permalink / raw
  To: André Draszik, Peter Griffin, Krzysztof Kozlowski,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Will McVicker, kernel-team



On 4/30/24 10:54, André Draszik wrote:
> The system hangs when any of these clocks are turned off.
> 
> With the introduction of pinctrl clock support [1], the approach taken
> in this clock driver for the APM clocks to rely solely on the
> clk_ignore_unused kernel command line option does not work anymore and
> the system hangs during boot.
> 
> gout_apm_func is a parent clock to the clocks that are going to be
> handled by the pinctrl driver [2], namely
> gout_apm_apbif_gpio_alive_pclk and gout_apm_apbif_gpio_far_alive_pclk.
> It also is the parent to the clocks marked as critical in this commit
> here (and some others that aren't relevant for this commit)). This
> means that once the pinctrl driver decides to turn off clocks, the
> clock framework will subsequently turn off parent clocks of those
> pinctrl clocks if they have no (apparent) user. Since gout_apm_func is
> the parent, and since no drivers are hooked up to it or any of its
> other children, gout_apm_func will be turned off. This will cause the
> system to hang, as the clocks marked as critical in this commit stop
> having an input.
> 
> We might have to add a driver for these clocks, but in the meantime
> let's just ensure they stay on even if siblings are turned off.

It's sane, yes.

> 
> For the avoidance of doubt: This commit doesn't mean that we can boot
> with clk_ignore_unused.
> 

s/with/without. Because there are still other clocks that are not yet
handled/marked as critical where needed. There's still work to do.

With the typo addressed:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
  2024-05-02  7:03   ` Tudor Ambarus
@ 2024-05-03  8:35     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-03  8:35 UTC (permalink / raw
  To: Tudor Ambarus, André Draszik, Peter Griffin,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Will McVicker, kernel-team

On 02/05/2024 09:03, Tudor Ambarus wrote:
>> We might have to add a driver for these clocks, but in the meantime
>> let's just ensure they stay on even if siblings are turned off.
> 
> It's sane, yes.
> 
>>
>> For the avoidance of doubt: This commit doesn't mean that we can boot
>> with clk_ignore_unused.
>>
> 
> s/with/without. Because there are still other clocks that are not yet
> handled/marked as critical where needed. There's still work to do.
> 
> With the typo addressed:

Thanks, applied with fix above.

Best regards,
Krzysztof


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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
@ 2024-05-03  8:35     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-03  8:35 UTC (permalink / raw
  To: Tudor Ambarus, André Draszik, Peter Griffin,
	Sylwester Nawrocki, Chanwoo Choi, Alim Akhtar, Michael Turquette,
	Stephen Boyd
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Will McVicker, kernel-team

On 02/05/2024 09:03, Tudor Ambarus wrote:
>> We might have to add a driver for these clocks, but in the meantime
>> let's just ensure they stay on even if siblings are turned off.
> 
> It's sane, yes.
> 
>>
>> For the avoidance of doubt: This commit doesn't mean that we can boot
>> with clk_ignore_unused.
>>
> 
> s/with/without. Because there are still other clocks that are not yet
> handled/marked as critical where needed. There's still work to do.
> 
> With the typo addressed:

Thanks, applied with fix above.

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
  2024-04-30  9:54 ` André Draszik
@ 2024-05-03  8:35   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-03  8:35 UTC (permalink / raw
  To: Peter Griffin, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
	André Draszik
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Tudor Ambarus, Will McVicker, kernel-team


On Tue, 30 Apr 2024 10:54:59 +0100, André Draszik wrote:
> The system hangs when any of these clocks are turned off.
> 
> With the introduction of pinctrl clock support [1], the approach taken
> in this clock driver for the APM clocks to rely solely on the
> clk_ignore_unused kernel command line option does not work anymore and
> the system hangs during boot.
> 
> [...]

Applied, thanks!

[1/1] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
      https://git.kernel.org/krzk/linux/c/6b32d7474e9b833dc7fadc1b4d4f08af9bd87fde

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


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

* Re: [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
@ 2024-05-03  8:35   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-03  8:35 UTC (permalink / raw
  To: Peter Griffin, Krzysztof Kozlowski, Sylwester Nawrocki,
	Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
	André Draszik
  Cc: linux-arm-kernel, linux-samsung-soc, linux-clk, linux-kernel,
	Tudor Ambarus, Will McVicker, kernel-team


On Tue, 30 Apr 2024 10:54:59 +0100, André Draszik wrote:
> The system hangs when any of these clocks are turned off.
> 
> With the introduction of pinctrl clock support [1], the approach taken
> in this clock driver for the APM clocks to rely solely on the
> clk_ignore_unused kernel command line option does not work anymore and
> the system hangs during boot.
> 
> [...]

Applied, thanks!

[1/1] clk: samsung: gs101: mark some apm UASC and XIU clocks critical
      https://git.kernel.org/krzk/linux/c/6b32d7474e9b833dc7fadc1b4d4f08af9bd87fde

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-05-03  8:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  9:54 [PATCH] clk: samsung: gs101: mark some apm UASC and XIU clocks critical André Draszik
2024-04-30  9:54 ` André Draszik
2024-05-02  7:03 ` Tudor Ambarus
2024-05-02  7:03   ` Tudor Ambarus
2024-05-03  8:35   ` Krzysztof Kozlowski
2024-05-03  8:35     ` Krzysztof Kozlowski
2024-05-03  8:35 ` Krzysztof Kozlowski
2024-05-03  8:35   ` Krzysztof Kozlowski

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.