Skip to contentSkip to conversation

clk: imx8mq: Mark AHB clock as critical

PATCH Superseded Abel Vesa 4 participants 7 messages Jun 25, 2019 – Aug 3, 2019

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

PATCH 1/1 clk: imx8mq: Mark AHB clock as critical

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +1 -1
index 5fbc2a7..b48268b 100644
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
 	clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
 	/* AHB */
-	clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+	clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);
 	clks[IMX8MQ_CLK_AUDIO_AHB] = imx8m_clk_composite("audio_ahb", imx8mq_audio_ahb_sels, base + 0x9100);
 
 	/* IPG */
Signature · 1 line
2.7.4
maintainer
#1 lore raw

Quoting Abel Vesa (2019-06-25 02:01:56)

Quoted 13 lines

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +0 -0
index 5fbc2a7..b48268b 100644

drivers/clk/imx/clk-imx8mq.c static int imx8mq_clocks_probe(struct platform_device *pdev) · line 401

Quoted 5 lines
drivers/clk/imx/clk-imx8mq.c +1 -1
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
        clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
        /* AHB */
-       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);

Please add a comment into the code why it's critical.

Quoted 6 lines
drivers/clk/imx/clk-imx8mq.c +0 -0
        clks[IMX8MQ_CLK_AUDIO_AHB] = imx8m_clk_composite("audio_ahb", imx8mq_audio_ahb_sels, base + 0x9100);
 
        /* IPG */
Signature · 1 line
2.7.4
author
#2 lore raw
Quoted 16 lines · Stephen Boyd

Quoting Abel Vesa (2019-06-25 02:01:56)

Quoted 15 lines

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +0 -0
index 5fbc2a7..b48268b 100644
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
        clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
Quoted 5 lines

drivers/clk/imx/clk-imx8mq.c static int imx8mq_clocks_probe(struct platform_device *pdev) · line 401

Quoted 3 lines
drivers/clk/imx/clk-imx8mq.c +1 -1
        /* AHB */
-       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);

Please add a comment into the code why it's critical.

Comment explaining why the AHB bus clock is critical ? Isn't that self-explanatory ?

Quoted 7 lines
Quoted 7 lines
drivers/clk/imx/clk-imx8mq.c +0 -0
        clks[IMX8MQ_CLK_AUDIO_AHB] = imx8m_clk_composite("audio_ahb", imx8mq_audio_ahb_sels, base + 0x9100);
 
        /* IPG */
Signature · 1 line
2.7.4
maintainer
#3 lore raw

Quoting Abel Vesa (2019-07-05 01:52:19)

Quoted 17 lines · Stephen Boyd
Quoted 16 lines

Quoting Abel Vesa (2019-06-25 02:01:56)

Quoted 15 lines

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +0 -0
index 5fbc2a7..b48268b 100644
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
        clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
Quoted 8 lines
Quoted 5 lines

drivers/clk/imx/clk-imx8mq.c static int imx8mq_clocks_probe(struct platform_device *pdev) · line 401

Quoted 3 lines
drivers/clk/imx/clk-imx8mq.c +1 -1
        /* AHB */
-       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);

Please add a comment into the code why it's critical.

Comment explaining why the AHB bus clock is critical ? Isn't that self-explanatory ?

Nope, it isn't self-explanatory, because nothing on this line says "bus" and it could be that someone reading this code isn't well versed in the concepts of ARM world AHB to connect the two.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/clk/imx/clk-imx8mq.c +0 -0
        clks[IMX8MQ_CLK_AUDIO_AHB] = imx8m_clk_composite("audio_ahb", imx8mq_audio_ahb_sels, base + 0x9100);
Tested-by
#4 lore raw
Quoted 25 lines · Stephen Boyd

Quoting Abel Vesa (2019-07-05 01:52:19)

Quoted 23 lines · Stephen Boyd
Quoted 21 lines

Quoting Abel Vesa (2019-06-25 02:01:56)

Quoted 13 lines

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +0 -0
index 5fbc2a7..b48268b 100644

drivers/clk/imx/clk-imx8mq.c static int imx8mq_clocks_probe(struct platform_device *pdev) · line 401

Quoted 5 lines
drivers/clk/imx/clk-imx8mq.c +1 -1
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
        clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
        /* AHB */
-       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);

Please add a comment into the code why it's critical.

Quoted 6 lines
Quoted 2 lines

Comment explaining why the AHB bus clock is critical ? Isn't that self-explanatory ?

Nope, it isn't self-explanatory, because nothing on this line says "bus" and it could be that someone reading this code isn't well versed in the concepts of ARM world AHB to connect the two.

Agree with Stephen. Commit message should try to give as much details as possible
also maybe educate the readers who might not have that much knowledge.

Abel, I understand that for someone who works daily with this part of the kernel this change might look trivial.

Also, without this patch linux-next hangs on imx8mq.

With the explanation added you can add my:

thanks,
Daniel.

#5 lore raw
Quoted 33 lines · Daniel Baluta
Quoted 25 lines · Stephen Boyd

Quoting Abel Vesa (2019-07-05 01:52:19)

Quoted 23 lines · Stephen Boyd
Quoted 21 lines

Quoting Abel Vesa (2019-06-25 02:01:56)

Quoted 13 lines

Keep the AHB clock always on since there is no driver to control it and all the other clocks that use it as parent rely on it being always enabled.

---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +0 -0
index 5fbc2a7..b48268b 100644

drivers/clk/imx/clk-imx8mq.c static int imx8mq_clocks_probe(struct platform_device *pdev) · line 401

Quoted 5 lines
drivers/clk/imx/clk-imx8mq.c +1 -1
@@ -398,7 +398,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
        clks[IMX8MQ_CLK_NOC_APB] = imx8m_clk_composite_critical("noc_apb", imx8mq_noc_apb_sels, base + 0x8d80);
 
        /* AHB */
-       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite("ahb", imx8mq_ahb_sels, base + 0x9000);
+       clks[IMX8MQ_CLK_AHB] = imx8m_clk_composite_critical("ahb", imx8mq_ahb_sels, base + 0x9000);

Please add a comment into the code why it's critical.

Quoted 6 lines
Quoted 2 lines

Comment explaining why the AHB bus clock is critical ? Isn't that self-explanatory ?

Nope, it isn't self-explanatory, because nothing on this line says "bus" and it could be that someone reading this code isn't well versed in the concepts of ARM world AHB to connect the two.

Quoted 8 lines

Agree with Stephen. Commit message should try to give as much details as possible
also maybe educate the readers who might not have that much knowledge.

Abel, I understand that for someone who works daily with this part of the kernel this change might look trivial.

Also, without this patch linux-next hangs on imx8mq.

How does that happen? Mainline is fine there?

Shawn

#6 lore raw
Quoted 3 lines · Shawn Guo
Quoted 1 line

Also, without this patch linux-next hangs on imx8mq.

How does that happen? Mainline is fine there?

Okay, understood it by reading more threads.

Shawn