Skip to contentSkip to conversation

ARM: OMAP3+: dpll: optimize noncore dpll locking logic

PATCH New Nishanth Menon 2 participants 5 messages May 18, 2012 – May 24, 2012

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

PATCH 1/1 ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: Vikram Pandita <[email protected]>

If the dpll is already locked, code can be optimized to return much earlier than doing redundent set of lock mode and wait on idlest.

Cc Tony Lindgren <[email protected]>
Cc Jon Hunter <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Mike Turquette <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
---
 arch/arm/mach-omap2/dpll3xxx.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/dpll3xxx.c +11 -1
index fc56745..3cfd7c4 100644
@@ -135,11 +135,20 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
  */
 static int _omap3_noncore_dpll_lock(struct clk *clk)
 {
+	const struct dpll_data *dd;
 	u8 ai;
-	int r;
+	u8 state = 1;
+	int r = 0;
 
 	pr_debug("clock: locking DPLL %s\n", clk->name);
 
+	dd = clk->dpll_data;
+	state <<= __ffs(dd->idlest_mask);
+
+	/* Check if already locked */
+	if ((__raw_readl(dd->idlest_reg) & dd->idlest_mask) == state)
+		goto done;
+
 	ai = omap3_dpll_autoidle_read(clk);
 
 	omap3_dpll_deny_idle(clk);
@@ -151,6 +160,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
 	if (ai)
 		omap3_dpll_allow_idle(clk);
 
+done:
 	return r;
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: OMAP3+: dpll: optimize noncore dpll locking logic

Hi Nishanth

Quoted 6 lines · Nishanth Menon

From: Vikram Pandita <[email protected]>

If the dpll is already locked, code can be optimized to return much earlier than doing redundent set of lock mode and wait on idlest.

Quoted 8 lines
Cc Tony Lindgren <[email protected]>
Cc Jon Hunter <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Mike Turquette <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org

Did you intend to add your Signed-off-by: to this patch?

Also, just FYI, no need to add the Cc: lines for the mailing lists in the bottom of the patch description.

- Paul

Quoted 41 lines
---
 arch/arm/mach-omap2/dpll3xxx.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/dpll3xxx.c +11 -1
index fc56745..3cfd7c4 100644
@@ -135,11 +135,20 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
  */
 static int _omap3_noncore_dpll_lock(struct clk *clk)
 {
+	const struct dpll_data *dd;
 	u8 ai;
-	int r;
+	u8 state = 1;
+	int r = 0;
 
 	pr_debug("clock: locking DPLL %s\n", clk->name);
 
+	dd = clk->dpll_data;
+	state <<= __ffs(dd->idlest_mask);
+
+	/* Check if already locked */
+	if ((__raw_readl(dd->idlest_reg) & dd->idlest_mask) == state)
+		goto done;
+
 	ai = omap3_dpll_autoidle_read(clk);
 
 	omap3_dpll_deny_idle(clk);
@@ -151,6 +160,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
 	if (ai)
 		omap3_dpll_allow_idle(clk);
 
+done:
 	return r;
 }
 
Signature · 1 line
1.7.9.5

- Paul

#2 lore raw

PATCH 1/1 ARM: OMAP3+: dpll: optimize noncore dpll locking logic

Quoted 17 lines · Paul Walmsley

Hi Nishanth

Quoted 13 lines · Nishanth Menon

From: Vikram Pandita <[email protected]>

If the dpll is already locked, code can be optimized to return much earlier than doing redundent set of lock mode and wait on idlest.

Cc Tony Lindgren <[email protected]>
Cc Jon Hunter <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Mike Turquette <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Quoted 3 lines
Quoted 1 line

Did you intend to add your Signed-off-by: to this patch?

Other than forwarding the patch over(since it seems to have slipped through the fingers of folks monitoring the product trees), I have had no other contributions to the patch.

Quoted 3 lines

Also, just FYI, no need to add the Cc: lines for the mailing lists in the bottom of the patch description.

Thanks. point taken. will take care of that in future patches.

Regards,
Nishanth Menon

#3 lore raw

PATCH 1/1 ARM: OMAP3+: dpll: optimize noncore dpll locking logic

Quoted 16 lines · Nishanth
Quoted 15 lines · Paul Walmsley
Quoted 13 lines · Nishanth Menon

From: Vikram Pandita <[email protected]>

If the dpll is already locked, code can be optimized to return much earlier than doing redundent set of lock mode and wait on idlest.

Cc Tony Lindgren <[email protected]>
Cc Jon Hunter <[email protected]>
Cc Paul Walmsley <[email protected]>
Cc Mike Turquette <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Did you intend to add your Signed-off-by: to this patch?

Other than forwarding the patch over(since it seems to have slipped through the fingers of folks monitoring the product trees), I have had no other contributions to the patch.

Okay. As I understand it, the maintainers above me would like Signed-off-by:s from the entire submission patch, even if there are no contributions to the patch itself. So please let me know if it's okay for me to add your S-o-b.

- Paul

#4 lore raw

PATCH 1/1 ARM: OMAP3+: dpll: optimize noncore dpll locking logic

Quoted 5 lines · Paul Walmsley

Okay. ?As I understand it, the maintainers above me would like Signed-off-by:s from the entire submission patch, even if there are no contributions to the patch itself. ?So please let me know if it's okay for me to add your S-o-b.

Thanks. ok with me :)

Regards,
Nishanth Menon