Skip to contentSkip to conversation

clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

PATCH New Tero Kristo 2 participants 8 messages Jan 28, 2016 – Feb 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

---
 drivers/clk/ti/dpll3xxx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/ti/dpll3xxx.c +2 -1
index f4dec00..7ed24bc 100644
@@ -437,7 +437,8 @@ int omap3_noncore_dpll_enable(struct clk_hw *hw)
 
 	parent = clk_hw_get_parent(hw);
 
-	if (clk_hw_get_rate(hw) == clk_get_rate(dd->clk_bypass)) {
+	if (clk_hw_get_rate(hw) ==
+	    clk_hw_get_rate(__clk_get_hw(dd->clk_bypass))) {
 		WARN_ON(parent != __clk_get_hw(dd->clk_bypass));
 		r = _omap3_noncore_dpll_bypass(clk);
 	} else {
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 5 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

-Tero

Quoted 19 lines
---
  drivers/clk/ti/dpll3xxx.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/ti/dpll3xxx.c +2 -1
index f4dec00..7ed24bc 100644
@@ -437,7 +437,8 @@ int omap3_noncore_dpll_enable(struct clk_hw *hw)
 
  	parent = clk_hw_get_parent(hw);
 
-	if (clk_hw_get_rate(hw) == clk_get_rate(dd->clk_bypass)) {
+	if (clk_hw_get_rate(hw) ==
+	    clk_hw_get_rate(__clk_get_hw(dd->clk_bypass))) {
  		WARN_ON(parent != __clk_get_hw(dd->clk_bypass));
  		r = _omap3_noncore_dpll_bypass(clk);
  	} else {
#2 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 9 lines · Tero Kristo
Quoted 5 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Regards,

Tony

Quoted 19 lines
Quoted 18 lines
 drivers/clk/ti/dpll3xxx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/ti/dpll3xxx.c +2 -1
index f4dec00..7ed24bc 100644
@@ -437,7 +437,8 @@ int omap3_noncore_dpll_enable(struct clk_hw *hw)
 
 	parent = clk_hw_get_parent(hw);
 
-	if (clk_hw_get_rate(hw) == clk_get_rate(dd->clk_bypass)) {
+	if (clk_hw_get_rate(hw) ==
+	    clk_hw_get_rate(__clk_get_hw(dd->clk_bypass))) {
 		WARN_ON(parent != __clk_get_hw(dd->clk_bypass));
 		r = _omap3_noncore_dpll_bypass(clk);
 	} else {
#3 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Tero Kristo
Quoted 4 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Look at the other patch I sent, it should accomplish the same thing, and more.

https://www.spinics.net/lists/linux-clk/msg06094.html

-Tero

Quoted 25 lines

Regards,

Tony

Quoted 19 lines
Quoted 18 lines
  drivers/clk/ti/dpll3xxx.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/ti/dpll3xxx.c +2 -1
index f4dec00..7ed24bc 100644
@@ -437,7 +437,8 @@ int omap3_noncore_dpll_enable(struct clk_hw *hw)
 
  	parent = clk_hw_get_parent(hw);
 
-	if (clk_hw_get_rate(hw) == clk_get_rate(dd->clk_bypass)) {
+	if (clk_hw_get_rate(hw) ==
+	    clk_hw_get_rate(__clk_get_hw(dd->clk_bypass))) {
  		WARN_ON(parent != __clk_get_hw(dd->clk_bypass));
  		r = _omap3_noncore_dpll_bypass(clk);
  	} else {
#4 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 12 lines · Tero Kristo
Quoted 11 lines · Tony Lindgren
Quoted 9 lines · Tero Kristo
Quoted 5 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

Quoted 8 lines
Quoted 3 lines

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Look at the other patch I sent, it should accomplish the same thing, and more.

https://www.spinics.net/lists/linux-clk/msg06094.html

Right.. But is that suitable for the -rc cycle with cc stable?

You should also describe the bug it causes in the change log. Something like:

This fixes an issue where PM runtime will hang the system if enabled with a serial console before a suspend-resume cycle.

Regards,

Tony

#5 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Tero Kristo
Quoted 14 lines · Tony Lindgren
Quoted 9 lines · Tero Kristo
Quoted 5 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Quoted 6 lines
Quoted 4 lines

Look at the other patch I sent, it should accomplish the same thing, and more.

https://www.spinics.net/lists/linux-clk/msg06094.html

Right.. But is that suitable for the -rc cycle with cc stable?

Hmm yea, thats a good question, we may need to resurrect this patch after all.

Quoted 5 lines

You should also describe the bug it causes in the change log. Something like:

This fixes an issue where PM runtime will hang the system if enabled with a serial console before a suspend-resume cycle.

Yea I can add this to the desc if we want to keep this version of the patch.

-Tero

#6 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 21 lines · Tero Kristo
Quoted 20 lines · Tony Lindgren
Quoted 19 lines · Tero Kristo
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Tero Kristo
Quoted 4 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Look at the other patch I sent, it should accomplish the same thing, and more.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

https://www.spinics.net/lists/linux-clk/msg06094.html

Right.. But is that suitable for the -rc cycle with cc stable?

Hmm yea, thats a good question, we may need to resurrect this patch after all.

Yes a minimal fix first with cc stable, then the rest of the changes can be done for v4.6?

Quoted 7 lines
Quoted 5 lines

You should also describe the bug it causes in the change log. Something like:

This fixes an issue where PM runtime will hang the system if enabled with a serial console before a suspend-resume cycle.

Yea I can add this to the desc if we want to keep this version of the patch.

Yes please. It seems the fix should be cc stable for several merge windows.

Regards,

Tony

#7 lore raw

PATCH 1/1 clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

Quoted 35 lines · Tony Lindgren
Quoted 21 lines · Tero Kristo
Quoted 20 lines · Tony Lindgren
Quoted 19 lines · Tero Kristo
Quoted 6 lines · Tony Lindgren
Quoted 5 lines · Tero Kristo
Quoted 4 lines · Tero Kristo

As the code in this file is being executed within irq context in some cases, we must avoid the clk_get_rate which uses mutex internally. Switch the code to use clk_hw_get_rate instead which is non-locking.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Ooops, sorry. Sent wrong version (read: old) of this patch, please ignore this one. Will re-send the correct version in a bit.

I think this is still needed as a fix for -rc cycle with cc: stable as otherwise we have omap4 and 5 hang if PM runtime is enabled before a suspend/resume cycle?

Look at the other patch I sent, it should accomplish the same thing, and more.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

https://www.spinics.net/lists/linux-clk/msg06094.html

Right.. But is that suitable for the -rc cycle with cc stable?

Hmm yea, thats a good question, we may need to resurrect this patch after all.

Yes a minimal fix first with cc stable, then the rest of the changes can be done for v4.6?

Quoted 3 lines
Quoted 3 lines

You should also describe the bug it causes in the change log. Something like:

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

This fixes an issue where PM runtime will hang the system if enabled with a serial console before a suspend-resume cycle.

Yea I can add this to the desc if we want to keep this version of the patch.

Yes please. It seems the fix should be cc stable for several merge windows.

Tero, what's the status on this one? We have systems hang shortly after entering init if PM is enabled without this one.

Regards,

Tony