[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

Subsystems: arm port, omap2+ support, the rest

STALE5183d

5 messages, 2 authors, 2012-05-24 · open the first message on its own page

[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: nm@ti.com (Nishanth Menon)
Date: 2012-05-18 19:37:18

From: Vikram Pandita <redacted>

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 <tony@atomide.com>
Cc: Jon Hunter <redacted>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <redacted>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

Signed-off-by: Vikram Pandita <redacted>
---
 arch/arm/mach-omap2/dpll3xxx.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index fc56745..3cfd7c4 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -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;
 }
 
-- 
1.7.9.5

[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: paul@pwsan.com (Paul Walmsley)
Date: 2012-05-24 07:49:21

Hi Nishanth

On Fri, 18 May 2012, Nishanth Menon wrote:
From: Vikram Pandita <redacted>

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 <tony@atomide.com>
Cc: Jon Hunter <redacted>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <redacted>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

Signed-off-by: Vikram Pandita <redacted>
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 hunk
---
 arch/arm/mach-omap2/dpll3xxx.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index fc56745..3cfd7c4 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -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;
 }
 
-- 
1.7.9.5

- Paul

[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: nm@ti.com (Menon, Nishanth)
Date: 2012-05-24 13:09:33

On Thu, May 24, 2012 at 2:49 AM, Paul Walmsley [off-list ref] wrote:
Hi Nishanth

On Fri, 18 May 2012, Nishanth Menon wrote:
quoted
From: Vikram Pandita <redacted>

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 <tony@atomide.com>
Cc: Jon Hunter <redacted>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <redacted>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

Signed-off-by: Vikram Pandita <redacted>
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.
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

[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: paul@pwsan.com (Paul Walmsley)
Date: 2012-05-24 14:57:45

On Thu, 24 May 2012, Menon, Nishanth wrote:
On Thu, May 24, 2012 at 2:49 AM, Paul Walmsley [off-list ref] wrote:
quoted
On Fri, 18 May 2012, Nishanth Menon wrote:
quoted
From: Vikram Pandita <redacted>

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 <tony@atomide.com>
Cc: Jon Hunter <redacted>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <redacted>
Cc: linux-omap at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

Signed-off-by: Vikram Pandita <redacted>
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

[PATCH] ARM: OMAP3+: dpll: optimize noncore dpll locking logic

From: nm@ti.com (Menon, Nishanth)
Date: 2012-05-24 15:03:17

On Thu, May 24, 2012 at 9:57 AM, Paul Walmsley [off-list ref] wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help