OMAP3: PM: Disable interrupt controller AUTOIDLE before WFI
authorTero Kristo <tero.kristo@nokia.com>
Fri, 23 Oct 2009 16:03:50 +0000 (19:03 +0300)
committerKevin Hilman <khilman@deeprootsystems.com>
Thu, 21 Jan 2010 02:16:00 +0000 (18:16 -0800)
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
arch/arm/mach-omap2/pm34xx.c
arch/arm/plat-omap/include/plat/irqs.h

index 54c5f0dcd6637d2ebdd008dcc5c0a59d96a84c21..27054025da2b5056ad6f15fe0223446f48e8359f 100644 (file)
@@ -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 */
index 8a148fbbab43905055b0a61c740078fd9e0fb066..af83555795ff98612cde080641d3018284772a73 100644 (file)
@@ -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) {
index 0082036f6a48f5fa100e2753399f3644cbb62ea7..c0ab7c80f72e75b1ec113acbb5147806c7623369 100644 (file)
@@ -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>
This page took 0.039656 seconds and 5 git commands to generate.