Skip to contentSkip to conversation

OMAP: Added recalculation of clock rate in 'clk_set_rate'

PATCH New Shweta Gulati 5 participants 12 messages Apr 20, 2011 – May 11, 2011

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

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

From: Gulati, Shweta <[email protected]>

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071 calling of 'recalc' in API clk_set_rate is unintentionally removed, because of which clock's tree rates get goofed up when DVFS happens. This Patch adds recalc API back.

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak <[email protected]>
Cc Paul Wamsley <[email protected]>
---
 arch/arm/plat-omap/clock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -1
index c9122dd..5a0d06b 100644
@@ -130,8 +130,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
 	spin_lock_irqsave(&clockfw_lock, flags);
 	ret = arch_clock->clk_set_rate(clk, rate);
-	if (ret == 0)
+	if (ret == 0) {
+		if (clk->recalc)
+			clk->rate = clk->recalc(clk);
 		propagate_rate(clk);
+	}
 	spin_unlock_irqrestore(&clockfw_lock, flags);
 
 	return ret;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Quoted 11 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Gulati, Shweta
Sent: Wednesday, April 20, 2011 2:55 PM
To: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org; Gulati, Shweta; Nayak, Rajendra; Paul Wamsley
Subject: [PATCH] OMAP: Added recalculation of clock rate in 'clk_set_rate'

Quoted 7 lines

From: Gulati, Shweta <[email protected]>

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071 calling of 'recalc' in API clk_set_rate is unintentionally removed, because of which clock's tree rates get goofed up when DVFS happens. This Patch adds recalc API back.

I see that the patch is not adding API back.
It is adding a call to the API.

Quoted 15 lines

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak <[email protected]>
Cc Paul Wamsley <[email protected]>
---
 arch/arm/plat-omap/clock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +0 -0
index c9122dd..5a0d06b 100644

arch/arm/plat-omap/clock.c int clk_set_rate(struct clk *clk, unsigned long rate) · line 133

Quoted 5 lines
arch/arm/plat-omap/clock.c +1 -1
@@ -130,8 +130,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
 	spin_lock_irqsave(&clockfw_lock, flags);
 	ret = arch_clock->clk_set_rate(clk, rate);
-	if (ret == 0)
+	if (ret == 0) {

checking if (!ret) is an intelligent way.
But it is an individual's choice.

Quoted 14 lines
arch/arm/plat-omap/clock.c +3 -1
+		if (clk->recalc)
+			clk->rate = clk->recalc(clk);
 		propagate_rate(clk);
+	}
 	spin_unlock_irqrestore(&clockfw_lock, flags);
 
 	return ret;
--

1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Hi,

Quoted 13 lines · Mayuresh
Quoted 13 lines

-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Gulati, Shweta
Sent: Wednesday, April 20, 2011 2:55 PM
To: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org; Gulati, Shweta; Nayak, Rajendra; Paul Wamsley
Subject: [PATCH] OMAP: Added recalculation of clock rate in 'clk_set_rate'

From: Gulati, Shweta <[email protected]>

Quoted 8 lines
Quoted 5 lines

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071 calling of 'recalc' in API clk_set_rate is unintentionally removed, because of which clock's tree rates get goofed up when DVFS happens. This Patch adds recalc API back.

I see that the patch is not adding API back.
It is adding a call to the API.

Will Modify Commit message.

Quoted 16 lines
Quoted 16 lines

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak <[email protected]>
Cc Paul Wamsley <[email protected]>

---
?arch/arm/plat-omap/clock.c | ? ?5 ++++-
?1 files changed, 4 insertions(+), 1 deletions(-)

arch/arm/plat-omap/clock.c +0 -0
index c9122dd..5a0d06b 100644
@@ -130,8 +130,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
Quoted 7 lines

arch/arm/plat-omap/clock.c int clk_set_rate(struct clk *clk, unsigned long rate) · line 133

Quoted 4 lines
arch/arm/plat-omap/clock.c +1 -1
 ? ? ? spin_lock_irqsave(&clockfw_lock, flags);
 ? ? ? ret = arch_clock->clk_set_rate(clk, rate);
- ? ? if (ret == 0)
+ ? ? if (ret == 0) {

checking if (!ret) is an intelligent way.
But it is an individual's choice.

It doesn't make much difference.

Quoted 15 lines
Quoted 14 lines
arch/arm/plat-omap/clock.c +3 -1
+ ? ? ? ? ? ? if (clk->recalc)
+ ? ? ? ? ? ? ? ? ? ? clk->rate = clk->recalc(clk);
 ? ? ? ? ? ? ? propagate_rate(clk);
+ ? ? }
 ? ? ? spin_unlock_irqrestore(&clockfw_lock, flags);
 
 ? ? ? return ret;
--

1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,
Regards,
Shweta
#3 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

In reply to Shweta Gulati

Hello.

Quoted 4 lines · Shweta Gulati

From: Gulati, Shweta<[email protected]>

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071

Please also specify that commit's summary -- for human readers.

Quoted 9 lines

calling of 'recalc' in API clk_set_rate is unintentionally removed, because of which clock's tree rates get goofed up when DVFS happens. This Patch adds recalc API back.

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak<[email protected]>
Cc Paul Wamsley<[email protected]>

WBR, Sergei

#4 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Hi,

Quoted 10 lines · Sergei Shtylyov

Hello.

Quoted 4 lines · Shweta Gulati

From: Gulati, Shweta<[email protected]>

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071

? Please also specify that commit's summary -- for human readers.

Will do.

Quoted 12 lines
Quoted 9 lines

calling of 'recalc' in API clk_set_rate is unintentionally removed, because of which clock's tree rates get goofed up when DVFS happens. This Patch adds recalc API back.

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak<[email protected]>
Cc Paul Wamsley<[email protected]>

WBR, Sergei

Signature · 3 lines
Thanks,
Regards,
Shweta
maintainer
#5 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

In reply to Shweta Gulati

Hi

Quoted 6 lines · Shweta Gulati

From: Gulati, Shweta <[email protected]>

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071 calling of 'recalc' in API clk_set_rate is unintentionally removed,

That's intentional. struct clk.set_rate functions need to set the struct clk.rate before returning. If they don't do that, it's a bug in the struct clk's .set_rate function.

Quoted 1 line

because of which clock's tree rates get goofed up when DVFS happens.

Clearly this isn't on the mainline kernel...

Quoted 31 lines

This Patch adds recalc API back.

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak <[email protected]>
Cc Paul Wamsley <[email protected]>
---
 arch/arm/plat-omap/clock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/clock.c +4 -1
index c9122dd..5a0d06b 100644
@@ -130,8 +130,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
 	spin_lock_irqsave(&clockfw_lock, flags);
 	ret = arch_clock->clk_set_rate(clk, rate);
-	if (ret == 0)
+	if (ret == 0) {
+		if (clk->recalc)
+			clk->rate = clk->recalc(clk);
 		propagate_rate(clk);
+	}
 	spin_unlock_irqrestore(&clockfw_lock, flags);
 
 	return ret;
Signature · 1 line
1.7.0.4

- Paul

#6 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Hi,

Quoted 6 lines · Paul Walmsley

Hi

Quoted 2 lines · Shweta Gulati

From: Gulati, Shweta <[email protected]>

Quoted 8 lines
Quoted 4 lines

Core Clk Tree shows incorrect Clk rates at OPP50, as in commit e07f469d284ca3d1f5dcf5438c22982be98bc071 calling of 'recalc' in API clk_set_rate is unintentionally removed,

That's intentional. ?struct clk.set_rate functions need to set the struct clk.rate before returning. ?If they don't do that, it's a bug in the struct clk's .set_rate function.

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate'
doesn't update clk.rate, I will submit patch fixing that bug and will make sure that
set_rate of all clocks should update clk.rate

Quoted 4 lines
Quoted 2 lines

because of which clock's tree rates get goofed up when DVFS happens.

Clearly this isn't on the mainline kernel...

If you check for OPP50, the core clocks would show wrong rates.

Thanks for reviewing.

Quoted 36 lines
Quoted 30 lines

This Patch adds recalc API back.

Tested on OMAP3630 SDP Board.

Cc Rajendra Nayak <[email protected]>
Cc Paul Wamsley <[email protected]>

---
?arch/arm/plat-omap/clock.c | ? ?5 ++++-
?1 files changed, 4 insertions(+), 1 deletions(-)

arch/arm/plat-omap/clock.c +4 -2
index c9122dd..5a0d06b 100644
@@ -130,8 +130,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 
 ? ? ? spin_lock_irqsave(&clockfw_lock, flags);
 ? ? ? ret = arch_clock->clk_set_rate(clk, rate);
- ? ? if (ret == 0)
+ ? ? if (ret == 0) {
+ ? ? ? ? ? ? if (clk->recalc)
+ ? ? ? ? ? ? ? ? ? ? clk->rate = clk->recalc(clk);
 ? ? ? ? ? ? ? propagate_rate(clk);
+ ? ? }
 ? ? ? spin_unlock_irqrestore(&clockfw_lock, flags);
 
 ? ? ? return ret;
--
Quoted 2 lines

1.7.0.4

- Paul

Signature · 3 lines
Thanks,
Regards,
Shweta
maintainer
#7 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Quoted 4 lines · Shweta

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate' doesn't update clk.rate, I will submit patch fixing that bug and will make sure that set_rate of all clocks should update clk.rate

Yes, that's the right thing to do, please send that. Such a patch was originally part of the series for the last merge window; it seems I inadvertently dropped it.

- Paul

maintainer
#8 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

In reply to Gulati, Shweta
Quoted 5 lines · Shweta

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate'
doesn't update clk.rate, I will submit patch fixing that bug and will make sure that
set_rate of all clocks should update clk.rate

Ping. Do you plan to post this soon? This should be a trivial patch.

- Paul

#9 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Hi,

Quoted 9 lines · Paul Walmsley
Quoted 5 lines · Shweta

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate'
doesn't update clk.rate, I will submit patch fixing that bug and will make sure that
set_rate of all clocks should update clk.rate

Ping. ?Do you plan to post this soon? ?This should be a trivial patch.

Sorry for the delay, I will post today.

Quoted 2 lines

- Paul

Signature · 3 lines
Thanks,
Regards,
Shweta
#10 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Quoted 5 lines · Shweta

Hi,

Quoted 2 lines · Paul Walmsley

On Thu, 21 Apr 2011, Gulati, Shweta wrote:

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate'
doesn't update clk.rate, I will submit patch fixing that bug and will make sure that
set_rate of all clocks should update clk.rate

Ping. ?Do you plan to post this soon? ?This should be a trivial patch.

Sorry for the delay, I will post today.

Hi Shweta ,

To avoid delay, yesterday posted a patch for the same with your signed off by :

http://www.spinics.net/lists/linux-omap/msg50776.html

Please verify the patch and if anything is missing, please submit a new patch.

thanks ,

- Avinash

Quoted 14 lines
Quoted 2 lines

- Paul

Signature · 8 lines
Thanks,
Regards,
Shweta

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#11 lore raw

PATCH 1/1 OMAP: Added recalculation of clock rate in 'clk_set_rate'

Hi,

Quoted 17 lines · Avinash.H.M.
Quoted 5 lines · Shweta

Hi,

Quoted 2 lines · Paul Walmsley

On Thu, 21 Apr 2011, Gulati, Shweta wrote:

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

Yes, but in current code clk_set_rate of dpll3_m2 - 'omap3_core_dpll_m2_set_rate'
doesn't update clk.rate, I will submit patch fixing that bug and will make sure that
set_rate of all clocks should update clk.rate

Ping. ?Do you plan to post this soon? ?This should be a trivial patch.

Sorry for the delay, I will post today.

Hi Shweta ,

Quoted 7 lines

To avoid delay, yesterday posted a patch for the same with your signed off by :

http://www.spinics.net/lists/linux-omap/msg50776.html

Please verify the patch and if anything is missing, please submit a new patch.

Thanks Avinash for posting the Patch on time.
I have checked all clk's set_rate, other than 'omap3_dpll3_m2_set_rate' all set_rate APIs update clk rate, so the patch is complete. Acked.

Quoted 20 lines

thanks ,

- Avinash

Quoted 14 lines
Quoted 2 lines

- Paul

--
Thanks,
Regards,
Shweta

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

Signature · 3 lines
Thanks,
Regards,
Shweta