]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: DSP wedges suspend on unsupported board
authorTodd Poynor <tpoynor@mvista.com>
Tue, 11 Oct 2005 15:26:30 +0000 (18:26 +0300)
committerTony Lindgren <tony@atomide.com>
Tue, 11 Oct 2005 15:26:30 +0000 (18:26 +0300)
DSP suspend/resume callbacks don't ref uninitialized clock handles on
unsupported boards or after other errors.  Avoid lockup at system suspend.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dsp/dsp_common.c

index 3fe291662ef42928dd129940e81d2e1a48b7bed4..c1747f21fa19f4d0e7447056e960134dbe49aa05 100644 (file)
@@ -239,6 +239,7 @@ void dsp_set_idle_boot_base(unsigned long adr, size_t size)
 }
 
 static unsigned short save_dsp_idlect2;
+static int init_done;
 
 /*
  * note: if we are in pm_suspend / pm_resume function,
@@ -251,6 +252,9 @@ void omap_dsp_pm_suspend(void)
        /* Reset DSP */
        __dsp_reset();
 
+       if (! init_done)
+               return;
+
        clk_disable(dsp_ck_handle);
 
        /* Stop any DSP domain clocks */
@@ -265,6 +269,9 @@ void omap_dsp_pm_resume(void)
 {
        unsigned short save_arm_idlect2;
 
+       if (! init_done)
+               return;
+
        /* Restore DSP domain clocks */
        save_arm_idlect2 = omap_readw(ARM_IDLECT2); // api_ck is in ARM_IDLECT2
        clk_enable(api_ck_handle);
@@ -276,8 +283,6 @@ void omap_dsp_pm_resume(void)
                __dsp_run();
 }
 
-static int init_done;
-
 static int __init omap_dsp_init(void)
 {
        dspmem_size = 0;