All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] OMAP PM fixes for 2.6.33-rc
@ 2010-01-08 17:59 Kevin Hilman
  2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap

Here's a set of fixes from the OMAP PM brach intended for 2.6.33-rc.
This series applies on top Tony's omap-fixes-for-linus branch.

They can be also viewed/pulled from:

  git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git pm-fixes

Kevin Hilman (1):
  OMAP: timekeeping: time should not stop during suspend

Manjunatha GK (1):
  OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS

Peter Ujfalusi (1):
  OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules

Roel Kluin (1):
  OMAP: omap3_pm_get_suspend_state() error ignored in
    pwrdm_suspend_get()

Sanjeev Premi (1):
  OMAP3: PM: Remove duplicate code blocks

Sripathy, Vishwanath (1):
  OMAP3: PM: Removing redundant and potentially dangerous PRCM
    configration

Tero Kristo (7):
  OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
  OMAP3: PM: Ack pending interrupts before entering suspend
  OMAP3: PM: Enable system control module autoidle
  OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI
  OMAP3: CPUidle: Fixed timer resolution
  OMAP3: Fixed ARM aux ctrl register save/restore
  OMAP3: PM: Force write last pad config register into save area

 arch/arm/mach-omap2/cpuidle34xx.c      |    2 +-
 arch/arm/mach-omap2/irq.c              |   18 +++++++++++++
 arch/arm/mach-omap2/pm-debug.c         |    8 +++---
 arch/arm/mach-omap2/pm.h               |    8 ++++-
 arch/arm/mach-omap2/pm34xx.c           |   43 ++++++++++++++++---------------
 arch/arm/mach-omap2/prcm.c             |   11 --------
 arch/arm/mach-omap2/sleep34xx.S        |   13 ++++++---
 arch/arm/plat-omap/common.c            |   26 +++++++++++++++++++
 arch/arm/plat-omap/dmtimer.c           |   10 +++++++
 arch/arm/plat-omap/include/plat/irqs.h |    3 ++
 10 files changed, 99 insertions(+), 43 deletions(-)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
  2010-01-08 17:59 [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
@ 2010-01-08 17:59 ` Kevin Hilman
  2010-01-08 17:59   ` [PATCH 02/13] OMAP3: PM: Ack pending interrupts before entering suspend Kevin Hilman
  2010-01-10  7:42   ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Shilimkar, Santosh
  2010-01-13 23:53 ` [PATCH 14/13] DSS PM_WKEN to refill DMA Kevin Hilman
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

OMAP GP timers keep running for a few cycles after they are stopped,
which can cause the timer to expire and generate an interrupt. The pending
interrupt will prevent e.g. OMAP from entering suspend, thus we ack it
manually.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/plat-omap/dmtimer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 64f407e..5502ce8 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -551,6 +551,16 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer)
 	if (l & OMAP_TIMER_CTRL_ST) {
 		l &= ~0x1;
 		omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
+		/* Readback to make sure write has completed */
+		omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
+		 /*
+		  * Wait for functional clock period x 3.5 to make sure that
+		  * timer is stopped
+		  */
+		udelay(3500000 / clk_get_rate(timer->fclk) + 1);
+		/* Ack possibly pending interrupt */
+		omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG,
+				OMAP_TIMER_INT_OVERFLOW);
 	}
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 02/13] OMAP3: PM: Ack pending interrupts before entering suspend
  2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
@ 2010-01-08 17:59   ` Kevin Hilman
  2010-01-08 17:59     ` [PATCH 03/13] OMAP3: PM: Enable system control module autoidle Kevin Hilman
  2010-01-10  7:42   ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Shilimkar, Santosh
  1 sibling, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

Suspending drivers may still generate interrupts just before their suspend is
completed. Any pending interrupts here will prevent sleep.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/irq.c              |    6 ++++++
 arch/arm/mach-omap2/pm34xx.c           |    2 ++
 arch/arm/plat-omap/include/plat/irqs.h |    1 +
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index e9bc782..54c5f0d 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -274,4 +274,10 @@ void omap_intc_restore_context(void)
 	}
 	/* MIRs are saved and restore with other PRCM registers */
 }
+
+void omap3_intc_suspend(void)
+{
+	/* A pending interrupt would prevent OMAP from entering suspend */
+	omap_ack_irq(0);
+}
 #endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c6cc809..b26418d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -578,6 +578,8 @@ static int omap3_pm_suspend(void)
 	}
 
 	omap_uart_prepare_suspend();
+	omap3_intc_suspend();
+
 	omap_sram_idle();
 
 restore:
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 97d6c50..0082036 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -499,6 +499,7 @@ extern void omap_init_irq(void);
 extern int omap_irq_pending(void);
 void omap_intc_save_context(void);
 void omap_intc_restore_context(void);
+void omap3_intc_suspend(void);
 #endif
 
 #include <mach/hardware.h>
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 03/13] OMAP3: PM: Enable system control module autoidle
  2010-01-08 17:59   ` [PATCH 02/13] OMAP3: PM: Ack pending interrupts before entering suspend Kevin Hilman
@ 2010-01-08 17:59     ` Kevin Hilman
  2010-01-08 17:59       ` [PATCH 04/13] OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo, Mika Westerberg

From: Tero Kristo <tero.kristo@nokia.com>

Enable the auto-idle feature of the SCM block to save some additional
power.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm34xx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b26418d..8a148fb 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -837,6 +837,8 @@ static void __init prcm_setup_regs(void)
 			CM_AUTOIDLE);
 	}
 
+	omap_ctrl_writel(OMAP3430_AUTOIDLE, OMAP2_CONTROL_SYSCONFIG);
+
 	/*
 	 * Set all plls to autoidle. This is needed until autoidle is
 	 * enabled by clockfw
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 04/13] OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI
  2010-01-08 17:59     ` [PATCH 03/13] OMAP3: PM: Enable system control module autoidle Kevin Hilman
@ 2010-01-08 17:59       ` Kevin Hilman
  2010-01-08 17:59         ` [PATCH 05/13] OMAP3: PM: Remove duplicate code blocks Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

OMAP interrupt controller goes to unknown state when there is right
combination of l3,l4 sleep/wake-up transitions, l4 autoidle in
interrupt controller and some interrupt. When this happens, interrupts
are not delivered to ARM anymore and ARM will remain in WFI (wait for
interrupt) until interrupt controller is forced to wake-up
(i.e. lauterbach).

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/irq.c              |   12 ++++++++++++
 arch/arm/mach-omap2/pm34xx.c           |    2 ++
 arch/arm/plat-omap/include/plat/irqs.h |    2 ++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 54c5f0d..2705402 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -280,4 +280,16 @@ void omap3_intc_suspend(void)
 	/* A pending interrupt would prevent OMAP from entering suspend */
 	omap_ack_irq(0);
 }
+
+void omap3_intc_prepare_idle(void)
+{
+	/* Disable autoidle as it can stall interrupt controller */
+	intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG);
+}
+
+void omap3_intc_resume_idle(void)
+{
+	/* Re-enable autoidle */
+	intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
+}
 #endif /* CONFIG_ARCH_OMAP3 */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 8a148fb..af83555 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -392,6 +392,7 @@ void omap_sram_idle(void)
 		prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
 		omap3_enable_io_chain();
 	}
+	omap3_intc_prepare_idle();
 
 	/*
 	* On EMU/HS devices ROM code restores a SRDC value
@@ -438,6 +439,7 @@ void omap_sram_idle(void)
 					       OMAP3430_GR_MOD,
 					       OMAP3_PRM_VOLTCTRL_OFFSET);
 	}
+	omap3_intc_resume_idle();
 
 	/* PER */
 	if (per_next_state < PWRDM_POWER_ON) {
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 0082036..c0ab7c8 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -500,6 +500,8 @@ extern int omap_irq_pending(void);
 void omap_intc_save_context(void);
 void omap_intc_restore_context(void);
 void omap3_intc_suspend(void);
+void omap3_intc_prepare_idle(void);
+void omap3_intc_resume_idle(void);
 #endif
 
 #include <mach/hardware.h>
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 05/13] OMAP3: PM: Remove duplicate code blocks
  2010-01-08 17:59       ` [PATCH 04/13] OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI Kevin Hilman
@ 2010-01-08 17:59         ` Kevin Hilman
  2010-01-08 17:59           ` [PATCH 06/13] OMAP3: CPUidle: Fixed timer resolution Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

From: Sanjeev Premi <premi@ti.com>

This patch removes code blocks that are repeated
in function prcm_setup_regs().

Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm34xx.c |   18 ------------------
 1 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index af83555..d6cab33 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -910,24 +910,6 @@ static void __init prcm_setup_regs(void)
 	/* Clear any pending PRCM interrupts */
 	prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
 
-	/* Don't attach IVA interrupts */
-	prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
-	prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
-	prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
-	prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
-
-	/* Clear any pending 'reset' flags */
-	prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST);
-	prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST);
-
-	/* Clear any pending PRCM interrupts */
-	prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
-
 	omap3_iva_idle();
 	omap3_d2d_idle();
 }
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 06/13] OMAP3: CPUidle: Fixed timer resolution
  2010-01-08 17:59         ` [PATCH 05/13] OMAP3: PM: Remove duplicate code blocks Kevin Hilman
@ 2010-01-08 17:59           ` Kevin Hilman
  2010-01-08 17:59             ` [PATCH 07/13] OMAP3: Fixed ARM aux ctrl register save/restore Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

Previously used u32 as temporary data storage that wraps around at 4.294s.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index a26d6a0..12f0cbf 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -137,7 +137,7 @@ return_sleep_time:
 	local_irq_enable();
 	local_fiq_enable();
 
-	return (u32)timespec_to_ns(&ts_idle)/1000;
+	return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;
 }
 
 /**
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 07/13] OMAP3: Fixed ARM aux ctrl register save/restore
  2010-01-08 17:59           ` [PATCH 06/13] OMAP3: CPUidle: Fixed timer resolution Kevin Hilman
@ 2010-01-08 17:59             ` Kevin Hilman
  2010-01-08 17:59               ` [PATCH 08/13] OMAP3: PM: Removing redundant and potentially dangerous PRCM configration Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

Current value is stored on SDRAM and it is written back during wakeup.
Previously a static value of 0x72 was written there.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Acked-by: Thara Gopinath <thara@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/sleep34xx.S |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 15268f8..c3626ea 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -245,7 +245,8 @@ restore:
 	mov	r1, #0		@ set task id for ROM code in r1
 	mov	r2, #4		@ set some flags in r2, r6
 	mov	r6, #0xff
-	adr	r3, write_aux_control_params	@ r3 points to parameters
+	ldr	r4, scratchpad_base
+	ldr	r3, [r4, #0xBC]	@ r3 points to parameters
 	mcr	p15, 0, r0, c7, c10, 4	@ data write barrier
 	mcr	p15, 0, r0, c7, c10, 5	@ data memory barrier
 	.word	0xE1600071		@ call SMI monitor (smi #1)
@@ -253,14 +254,14 @@ restore:
 	b	logic_l1_restore
 l2_inv_api_params:
 	.word   0x1, 0x00
-write_aux_control_params:
-	.word   0x1, 0x72
 l2_inv_gp:
 	/* Execute smi to invalidate L2 cache */
 	mov r12, #0x1                         @ set up to invalide L2
 smi:    .word 0xE1600070		@ Call SMI monitor (smieq)
 	/* Write to Aux control register to set some bits */
-	mov	r0, #0x72
+	ldr	r4, scratchpad_base
+	ldr	r3, [r4,#0xBC]
+	ldr	r0, [r3,#4]
 	mov	r12, #0x3
 	.word 0xE1600070	@ Call SMI monitor (smieq)
 logic_l1_restore:
@@ -271,6 +272,7 @@ logic_l1_restore:
 
 	ldr	r4, scratchpad_base
 	ldr	r3, [r4,#0xBC]
+	adds	r3, r3, #8
 	ldmia	r3!, {r4-r6}
 	mov	sp, r4
 	msr	spsr_cxsf, r5
@@ -387,6 +389,9 @@ usettbr0:
 save_context_wfi:
 	/*b	save_context_wfi*/	@ enable to debug save code
 	mov	r8, r0 /* Store SDRAM address in r8 */
+	mrc	p15, 0, r5, c1, c0, 1	@ Read Auxiliary Control Register
+	mov	r4, #0x1		@ Number of parameters for restore call
+	stmia	r8!, {r4-r5}
         /* Check what that target sleep state is:stored in r1*/
         /* 1 - Only L1 and logic lost */
         /* 2 - Only L2 lost */
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 08/13] OMAP3: PM: Removing redundant and potentially dangerous PRCM configration
  2010-01-08 17:59             ` [PATCH 07/13] OMAP3: Fixed ARM aux ctrl register save/restore Kevin Hilman
@ 2010-01-08 17:59               ` Kevin Hilman
  2010-01-08 17:59                 ` [PATCH 09/13] OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Sripathy, Vishwanath

From: Sripathy, Vishwanath <vishwanath.bs@ti.com>

As part of Core domain context restoration while coming out of off mode
there are some registers being restored which are not required to be restored.
ROM code will have restored them already. Overwriting some of them can have
potential side effect. Eg: CM_CLKEN_PLL register should not be written while dpll is locked.
Tested on OMAP 3430 SDP for suspend/resume and off mode with sleep_while_idle enabled.

Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/prcm.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 3ea8177..cf466ea 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -44,7 +44,6 @@ struct omap3_prcm_regs {
 	u32 iva2_cm_clksel2;
 	u32 cm_sysconfig;
 	u32 sgx_cm_clksel;
-	u32 wkup_cm_clksel;
 	u32 dss_cm_clksel;
 	u32 cam_cm_clksel;
 	u32 per_cm_clksel;
@@ -53,7 +52,6 @@ struct omap3_prcm_regs {
 	u32 pll_cm_autoidle2;
 	u32 pll_cm_clksel4;
 	u32 pll_cm_clksel5;
-	u32 pll_cm_clken;
 	u32 pll_cm_clken2;
 	u32 cm_polctrl;
 	u32 iva2_cm_fclken;
@@ -77,7 +75,6 @@ struct omap3_prcm_regs {
 	u32 usbhost_cm_iclken;
 	u32 iva2_cm_autiidle2;
 	u32 mpu_cm_autoidle2;
-	u32 pll_cm_autoidle;
 	u32 iva2_cm_clkstctrl;
 	u32 mpu_cm_clkstctrl;
 	u32 core_cm_clkstctrl;
@@ -274,7 +271,6 @@ void omap3_prcm_save_context(void)
 	prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
 	prcm_context.sgx_cm_clksel =
 			 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
-	prcm_context.wkup_cm_clksel = cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
 	prcm_context.dss_cm_clksel =
 			 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
 	prcm_context.cam_cm_clksel =
@@ -291,8 +287,6 @@ void omap3_prcm_save_context(void)
 			cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
 	prcm_context.pll_cm_clksel5 =
 			 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
-	prcm_context.pll_cm_clken =
-			cm_read_mod_reg(PLL_MOD, CM_CLKEN);
 	prcm_context.pll_cm_clken2 =
 			cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
 	prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
@@ -338,8 +332,6 @@ void omap3_prcm_save_context(void)
 			 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
 	prcm_context.mpu_cm_autoidle2 =
 			 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
-	prcm_context.pll_cm_autoidle =
-			 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
 	prcm_context.iva2_cm_clkstctrl =
 			 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL);
 	prcm_context.mpu_cm_clkstctrl =
@@ -431,7 +423,6 @@ void omap3_prcm_restore_context(void)
 	__raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
 	cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
 					 CM_CLKSEL);
-	cm_write_mod_reg(prcm_context.wkup_cm_clksel, WKUP_MOD, CM_CLKSEL);
 	cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
 					 CM_CLKSEL);
 	cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
@@ -448,7 +439,6 @@ void omap3_prcm_restore_context(void)
 					OMAP3430ES2_CM_CLKSEL4);
 	cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD,
 					 OMAP3430ES2_CM_CLKSEL5);
-	cm_write_mod_reg(prcm_context.pll_cm_clken, PLL_MOD, CM_CLKEN);
 	cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD,
 					OMAP3430ES2_CM_CLKEN2);
 	__raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
@@ -487,7 +477,6 @@ void omap3_prcm_restore_context(void)
 	cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD,
 					CM_AUTOIDLE2);
 	cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
-	cm_write_mod_reg(prcm_context.pll_cm_autoidle, PLL_MOD, CM_AUTOIDLE);
 	cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
 					CM_CLKSTCTRL);
 	cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL);
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 09/13] OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS
  2010-01-08 17:59               ` [PATCH 08/13] OMAP3: PM: Removing redundant and potentially dangerous PRCM configration Kevin Hilman
@ 2010-01-08 17:59                 ` Kevin Hilman
  2010-01-08 17:59                   ` [PATCH 10/13] OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Manjunatha GK

From: Manjunatha GK <manjugk@ti.com>

The PM debug code fails to build on when CONFIG_DEBUG_FS is not
enabled.

Build error log:
arch/arm/mach-omap2/built-in.o: In function `omap_sram_idle':
arch/arm/mach-omap2/pm34xx.c:449: undefined reference to `pm_dbg_regset_save'
arch/arm/mach-omap2/pm34xx.c:460: undefined reference to `pm_dbg_regset_save'
arch/arm/mach-omap2/built-in.o: In function `configure_vc':
arch/arm/mach-omap2/pm34xx.c:1237: undefined reference to `pm_dbg_regset_init'
arch/arm/mach-omap2/pm34xx.c:1238: undefined reference to `pm_dbg_regset_init'
make: *** [.tmp_vmlinux1] Error 1

This patch fixes the above errors.

Kernel booting is tested on omap zoom2 and zoom3 boards.

Signed-off-by: Manjunatha GK <manjugk@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm-debug.c |    2 --
 arch/arm/mach-omap2/pm.h       |    8 ++++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 860b755..e9d3993 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -604,6 +604,4 @@ static int __init pm_dbg_init(void)
 }
 arch_initcall(pm_dbg_init);
 
-#else
-void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) {}
 #endif
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 0bf345d..7a9c2d0 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -32,12 +32,16 @@ extern struct omap_dm_timer *gptimer_wakeup;
 #ifdef CONFIG_PM_DEBUG
 extern void omap2_pm_dump(int mode, int resume, unsigned int us);
 extern int omap2_pm_debug;
+#else
+#define omap2_pm_dump(mode, resume, us)		do {} while (0);
+#define omap2_pm_debug				0
+#endif
+
+#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev);
 extern int pm_dbg_regset_save(int reg_set);
 extern int pm_dbg_regset_init(int reg_set);
 #else
-#define omap2_pm_dump(mode, resume, us)		do {} while (0);
-#define omap2_pm_debug				0
 #define pm_dbg_update_time(pwrdm, prev) do {} while (0);
 #define pm_dbg_regset_save(reg_set) do {} while (0);
 #define pm_dbg_regset_init(reg_set) do {} while (0);
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 10/13] OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules
  2010-01-08 17:59                 ` [PATCH 09/13] OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS Kevin Hilman
@ 2010-01-08 17:59                   ` Kevin Hilman
  2010-01-08 17:59                     ` [PATCH 11/13] OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get() Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter Ujfalusi

From: Peter Ujfalusi <peter.ujfalusi@nokia.com>

Wake-up from McBSP ports are needed, especially when the THRESHOLD
dma mode is in use for audio playback.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm34xx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index d6cab33..96075bf 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -884,12 +884,16 @@ static void __init prcm_setup_regs(void)
 	/* Enable wakeups in PER */
 	prm_write_mod_reg(OMAP3430_EN_GPIO2 | OMAP3430_EN_GPIO3 |
 			  OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 |
-			  OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3,
+			  OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3 |
+			  OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 |
+			  OMAP3430_EN_MCBSP4,
 			  OMAP3430_PER_MOD, PM_WKEN);
 	/* and allow them to wake up MPU */
 	prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 |
 			  OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 |
-			  OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3,
+			  OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3 |
+			  OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 |
+			  OMAP3430_EN_MCBSP4,
 			  OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
 
 	/* Don't attach IVA interrupts */
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 11/13] OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get()
  2010-01-08 17:59                   ` [PATCH 10/13] OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules Kevin Hilman
@ 2010-01-08 17:59                     ` Kevin Hilman
  2010-01-08 17:59                       ` [PATCH 12/13] OMAP3: PM: Force write last pad config register into save area Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Roel Kluin

From: Roel Kluin <roel.kluin@gmail.com>

val is an u64 pointer, we need an int to check the error.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm-debug.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index e9d3993..562d190 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -488,9 +488,11 @@ int pm_dbg_regset_init(int reg_set)
 
 static int pwrdm_suspend_get(void *data, u64 *val)
 {
-	*val = omap3_pm_get_suspend_state((struct powerdomain *)data);
+	int ret;
+	ret = omap3_pm_get_suspend_state((struct powerdomain *)data);
+	*val = ret;
 
-	if (*val >= 0)
+	if (ret >= 0)
 		return 0;
 	return *val;
 }
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 12/13] OMAP3: PM: Force write last pad config register into save area
  2010-01-08 17:59                     ` [PATCH 11/13] OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get() Kevin Hilman
@ 2010-01-08 17:59                       ` Kevin Hilman
  2010-01-08 17:59                         ` [PATCH 13/13] OMAP: timekeeping: time should not stop during suspend Kevin Hilman
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap; +Cc: Tero Kristo

From: Tero Kristo <tero.kristo@nokia.com>

Due to OMAP3 erratas 1.157, 1.185 the save of the last pad register
(ETK_D14 and ETK_D15) can fail sometimes when there is simultaneous
OCP access to the SCM register area. Fixed by writing the last
register to the save area.

Also, optimized the delay loop for the HW save to include an udelay(1),
which limits the number of unnecessary HW accesses to SCM register area
during the save.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Acked-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/pm34xx.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 96075bf..31762ca 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -26,6 +26,7 @@
 #include <linux/err.h>
 #include <linux/gpio.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 
 #include <plat/sram.h>
 #include <plat/clockdomain.h>
@@ -126,7 +127,15 @@ static void omap3_core_save_context(void)
 	/* wait for the save to complete */
 	while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
 			& PADCONF_SAVE_DONE))
-		;
+		udelay(1);
+
+	/*
+	 * Force write last pad into memory, as this can fail in some
+	 * cases according to erratas 1.157, 1.185
+	 */
+	omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
+		OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
+
 	/* Save the Interrupt controller context */
 	omap_intc_save_context();
 	/* Save the GPMC context */
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 13/13] OMAP: timekeeping: time should not stop during suspend
  2010-01-08 17:59                       ` [PATCH 12/13] OMAP3: PM: Force write last pad config register into save area Kevin Hilman
@ 2010-01-08 17:59                         ` Kevin Hilman
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-08 17:59 UTC (permalink / raw)
  To: linux-omap

During suspend, the kernel timekeeping subsystem is shut down.  Before
suspend and upon resume, it uses a weak function
read_persistent_clock() to determine the amount of time that elapsed
during suspend.

This function was not implemented on OMAP, so from the timekeeping
subsystem perspective (and thus userspace as well) it appeared that no
time elapsed during suspend.

This patch uses the 32k sync timer as a the persistent clock.

NOTE: This does *NOT* fully handle wrapping of the 32k sync timer, so
      more than one wrapping of the 32k sync timer during suspend may
      cause problems.  Also note there are not interrupts when the 32k
      sync timer wraps, so something else has to be done.

Reported-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/plat-omap/common.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index bf1eaf3..dddc027 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -172,6 +172,32 @@ unsigned long long sched_clock(void)
 				  clocksource_32k.mult, clocksource_32k.shift);
 }
 
+/**
+ * read_persistent_clock -  Return time from a persistent clock.
+ *
+ * Reads the time from a source which isn't disabled during PM, the
+ * 32k sync timer.  Convert the cycles elapsed since last read into
+ * nsecs and adds to a monotonically increasing timespec.
+ */
+static struct timespec persistent_ts;
+static cycles_t cycles, last_cycles;
+void read_persistent_clock(struct timespec *ts)
+{
+	unsigned long long nsecs;
+	cycles_t delta;
+	struct timespec *tsp = &persistent_ts;
+
+	last_cycles = cycles;
+	cycles = clocksource_32k.read(&clocksource_32k);
+	delta = cycles - last_cycles;
+
+	nsecs = clocksource_cyc2ns(delta,
+				   clocksource_32k.mult, clocksource_32k.shift);
+
+	timespec_add_ns(tsp, nsecs);
+	*ts = *tsp;
+}
+
 static int __init omap_init_clocksource_32k(void)
 {
 	static char err[] __initdata = KERN_ERR
-- 
1.6.6.rc2.1.g42108


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* RE: [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
  2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
  2010-01-08 17:59   ` [PATCH 02/13] OMAP3: PM: Ack pending interrupts before entering suspend Kevin Hilman
@ 2010-01-10  7:42   ` Shilimkar, Santosh
  2010-01-11 17:42     ` Paul Walmsley
  1 sibling, 1 reply; 19+ messages in thread
From: Shilimkar, Santosh @ 2010-01-10  7:42 UTC (permalink / raw)
  To: Kevin Hilman, linux-omap; +Cc: Tero Kristo


> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Kevin
> Hilman
> Sent: Friday, January 08, 2010 11:29 PM
> To: linux-omap@vger.kernel.org
> Cc: Tero Kristo
> Subject: [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
> 
> From: Tero Kristo <tero.kristo@nokia.com>
> 
> OMAP GP timers keep running for a few cycles after they are stopped,
> which can cause the timer to expire and generate an interrupt. The pending
> interrupt will prevent e.g. OMAP from entering suspend, thus we ack it
> manually.
> 
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
>  arch/arm/plat-omap/dmtimer.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 64f407e..5502ce8 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -551,6 +551,16 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer)
>  	if (l & OMAP_TIMER_CTRL_ST) {
>  		l &= ~0x1;
>  		omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
> +		/* Readback to make sure write has completed */
> +		omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
Hopefully compiler don't optimize your readback.
> +		 /*
> +		  * Wait for functional clock period x 3.5 to make sure that
> +		  * timer is stopped
> +		  */
> +		udelay(3500000 / clk_get_rate(timer->fclk) + 1);
> +		/* Ack possibly pending interrupt */
> +		omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG,
> +				OMAP_TIMER_INT_OVERFLOW);
>  	}
>  }
>  EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
> --
> 1.6.6.rc2.1.g42108
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* RE: [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
  2010-01-10  7:42   ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Shilimkar, Santosh
@ 2010-01-11 17:42     ` Paul Walmsley
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Walmsley @ 2010-01-11 17:42 UTC (permalink / raw)
  To: Shilimkar, Santosh; +Cc: Kevin Hilman, linux-omap, Tero Kristo

Hello Santosh,

On Sun, 10 Jan 2010, Shilimkar, Santosh wrote:

> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Kevin
> > Hilman
> > Sent: Friday, January 08, 2010 11:29 PM
> > To: linux-omap@vger.kernel.org
> > Cc: Tero Kristo
> > Subject: [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer
> > 
> > From: Tero Kristo <tero.kristo@nokia.com>
> > 
> > OMAP GP timers keep running for a few cycles after they are stopped,
> > which can cause the timer to expire and generate an interrupt. The pending
> > interrupt will prevent e.g. OMAP from entering suspend, thus we ack it
> > manually.
> > 
> > Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> > Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> > ---
> >  arch/arm/plat-omap/dmtimer.c |   10 ++++++++++
> >  1 files changed, 10 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> > index 64f407e..5502ce8 100644
> > --- a/arch/arm/plat-omap/dmtimer.c
> > +++ b/arch/arm/plat-omap/dmtimer.c
> > @@ -551,6 +551,16 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer)
> >  	if (l & OMAP_TIMER_CTRL_ST) {
> >  		l &= ~0x1;
> >  		omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
> > +		/* Readback to make sure write has completed */
> > +		omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
> Hopefully compiler don't optimize your readback.

It can't - if it does, it is a gcc bug.  omap_dm_timer_read_reg() 
ultimately calls __raw_readl() which uses the 'volatile' keyword:

http://en.wikipedia.org/wiki/Volatile_variable

...

Separately from the compiler, one must also ensure that the ARM core 
itself does not cache the readback.  This is handled by mapping the 
GPTIMER memory space as MT_DEVICE in mach-omap2/io.c.  See also the 
MT_DEVICE section in arch/arm/mm/mmu.c.  Further details are in the ARMv7 
Architecture Reference Manual, section A3.5.5, "Device Memory".


- Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 14/13] DSS PM_WKEN to refill DMA
  2010-01-08 17:59 [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
  2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
@ 2010-01-13 23:53 ` Kevin Hilman
  2010-01-14 18:51 ` [PATCH 15/13] PM debug: Fix warning when no CONFIG_DEBUG_FS Kevin Hilman
  2010-01-15 19:43 ` [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
  3 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-13 23:53 UTC (permalink / raw)
  To: linux-omap; +Cc: Subramani Venkatesh, Subramani Venkatesh

From: Subramani Venkatesh <x0108988@ti.com>

Currently, DSS doesnot wakeup when there is a DMA request.
DSS wake up event must be enabled so that the DMA request to refill
the FIFO will wake up the CORE domain.

Signed-off-by: Subramani Venkatesh <subramani.venkatesh@windriver.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
One more PM fix for the 2.6.33-rc series.
This has been added to my pm-fixes branch.

 arch/arm/mach-omap2/pm34xx.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 31762ca..46fbced 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -739,6 +739,11 @@ static void __init prcm_setup_regs(void)
 	prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
 	prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
 	prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
+
+	/* Enable PM_WKEN to support DSS LPR */
+	prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS,
+				OMAP3430_DSS_MOD, PM_WKEN);
+
 	prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
 	prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
 	prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 15/13] PM debug: Fix warning when no CONFIG_DEBUG_FS
  2010-01-08 17:59 [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
  2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
  2010-01-13 23:53 ` [PATCH 14/13] DSS PM_WKEN to refill DMA Kevin Hilman
@ 2010-01-14 18:51 ` Kevin Hilman
  2010-01-15 19:43 ` [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
  3 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-14 18:51 UTC (permalink / raw)
  To: linux-omap; +Cc: Aguirre, Sergio

From: Aguirre, Sergio <saaguirre@ti.com>

>From ec3f04ec8cf4851fceb249acf832755b7aad1766 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Thu, 14 Jan 2010 11:01:15 -0600
Subject: [PATCH] PM debug: Fix warning when no CONFIG_DEBUG_FS

Fix following warning when CONFIG_DEBUG_FS wasn't selected:

arch/arm/mach-omap2/pm-debug.c:57: warning: 'pm_dbg_init' declared 'static' but never defined

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
OK, this should be the last of the PM fixes for this round.

 arch/arm/mach-omap2/pm-debug.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 562d190..a086626 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -54,8 +54,6 @@ int omap2_pm_debug;
 	regs[reg_count++].val = \
 			 __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off)))
 
-static int __init pm_dbg_init(void);
-
 void omap2_pm_dump(int mode, int resume, unsigned int us)
 {
 	struct reg {
@@ -167,6 +165,8 @@ struct dentry *pm_dbg_dir;
 
 static int pm_dbg_init_done;
 
+static int __init pm_dbg_init(void);
+
 enum {
 	DEBUG_FILE_COUNTERS = 0,
 	DEBUG_FILE_TIMERS,
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 00/13] OMAP PM fixes for 2.6.33-rc
  2010-01-08 17:59 [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
                   ` (2 preceding siblings ...)
  2010-01-14 18:51 ` [PATCH 15/13] PM debug: Fix warning when no CONFIG_DEBUG_FS Kevin Hilman
@ 2010-01-15 19:43 ` Kevin Hilman
  3 siblings, 0 replies; 19+ messages in thread
From: Kevin Hilman @ 2010-01-15 19:43 UTC (permalink / raw)
  To: linux-omap

On Fri, 2010-01-08 at 09:59 -0800, Kevin Hilman wrote:
> Here's a set of fixes from the OMAP PM brach intended for 2.6.33-rc.
> This series applies on top Tony's omap-fixes-for-linus branch.
> 
> They can be also viewed/pulled from:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git pm-fixes

Tony, 

In addition to adding patches 14 & 15, I've rebased this after your
latest update to -rc4.   My pm-fixes branch is now based on your current
omap-fixes branch.

Kevin




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-01-15 19:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 17:59 [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman
2010-01-08 17:59 ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Kevin Hilman
2010-01-08 17:59   ` [PATCH 02/13] OMAP3: PM: Ack pending interrupts before entering suspend Kevin Hilman
2010-01-08 17:59     ` [PATCH 03/13] OMAP3: PM: Enable system control module autoidle Kevin Hilman
2010-01-08 17:59       ` [PATCH 04/13] OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI Kevin Hilman
2010-01-08 17:59         ` [PATCH 05/13] OMAP3: PM: Remove duplicate code blocks Kevin Hilman
2010-01-08 17:59           ` [PATCH 06/13] OMAP3: CPUidle: Fixed timer resolution Kevin Hilman
2010-01-08 17:59             ` [PATCH 07/13] OMAP3: Fixed ARM aux ctrl register save/restore Kevin Hilman
2010-01-08 17:59               ` [PATCH 08/13] OMAP3: PM: Removing redundant and potentially dangerous PRCM configration Kevin Hilman
2010-01-08 17:59                 ` [PATCH 09/13] OMAP3: PM debug: fix build error when !CONFIG_DEBUG_FS Kevin Hilman
2010-01-08 17:59                   ` [PATCH 10/13] OMAP3: PM: Enable wake-up from McBSP2, 3 and 4 modules Kevin Hilman
2010-01-08 17:59                     ` [PATCH 11/13] OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get() Kevin Hilman
2010-01-08 17:59                       ` [PATCH 12/13] OMAP3: PM: Force write last pad config register into save area Kevin Hilman
2010-01-08 17:59                         ` [PATCH 13/13] OMAP: timekeeping: time should not stop during suspend Kevin Hilman
2010-01-10  7:42   ` [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Shilimkar, Santosh
2010-01-11 17:42     ` Paul Walmsley
2010-01-13 23:53 ` [PATCH 14/13] DSS PM_WKEN to refill DMA Kevin Hilman
2010-01-14 18:51 ` [PATCH 15/13] PM debug: Fix warning when no CONFIG_DEBUG_FS Kevin Hilman
2010-01-15 19:43 ` [PATCH 00/13] OMAP PM fixes for 2.6.33-rc Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.