Patchwork [02/17] powerpc/85xx: do not sync time base at boot time

login
register
mail settings
Submitter chenhui zhao
Date April 3, 2013, 1:09 p.m.
Message ID <1364994565-16010-2-git-send-email-chenhui.zhao@freescale.com>
Download mbox | patch
Permalink /patch/233444/
State Superseded
Delegated to: Kumar Gala
Headers show

Comments

chenhui zhao - April 3, 2013, 1:09 p.m.
From: Chen-Hui Zhao <chenhui.zhao@freescale.com>

The bootloader have done time base sync for all cores, so skip
the synchronization process at boot time of kernel.

Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 arch/powerpc/platforms/85xx/smp.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Kumar Gala - April 3, 2013, 3:10 p.m.
On Apr 3, 2013, at 8:09 AM, Zhao Chenhui wrote:

> From: Chen-Hui Zhao <chenhui.zhao@freescale.com>
> 
> The bootloader have done time base sync for all cores, so skip
> the synchronization process at boot time of kernel.
> 
> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
> arch/powerpc/platforms/85xx/smp.c |    8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)

What harm is there in doing the sync?  I'm sure there is another reason you want to skip the TB sync that should be conveyed in the commit message.

- k
Zhao Chenhui - April 4, 2013, 1:20 a.m.
No other reason. Just avoid doing it again at boot time in kernel.

-Chenhui

Patch

diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 6a17599..35dae8e 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -62,6 +62,10 @@  static void mpc85xx_give_timebase(void)
 {
 	unsigned long flags;
 
+	/* only do time base sync when system is running */
+	if (system_state == SYSTEM_BOOTING)
+		return;
+
 	local_irq_save(flags);
 
 	while (!tb_req)
@@ -85,6 +89,10 @@  static void mpc85xx_take_timebase(void)
 {
 	unsigned long flags;
 
+	/* only do time base sync when system is running */
+	if (system_state == SYSTEM_BOOTING)
+		return;
+
 	local_irq_save(flags);
 
 	tb_req = 1;