Commit 6421f450 authored by Todd Poynor's avatar Todd Poynor Committed by Tony Lindgren

[PATCH] ARM: OMAP: DSP wedges suspend on unsupported board

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: default avatarTodd Poynor <tpoynor@mvista.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 3152c7e3
...@@ -239,6 +239,7 @@ void dsp_set_idle_boot_base(unsigned long adr, size_t size) ...@@ -239,6 +239,7 @@ void dsp_set_idle_boot_base(unsigned long adr, size_t size)
} }
static unsigned short save_dsp_idlect2; static unsigned short save_dsp_idlect2;
static int init_done;
/* /*
* note: if we are in pm_suspend / pm_resume function, * note: if we are in pm_suspend / pm_resume function,
...@@ -251,6 +252,9 @@ void omap_dsp_pm_suspend(void) ...@@ -251,6 +252,9 @@ void omap_dsp_pm_suspend(void)
/* Reset DSP */ /* Reset DSP */
__dsp_reset(); __dsp_reset();
if (! init_done)
return;
clk_disable(dsp_ck_handle); clk_disable(dsp_ck_handle);
/* Stop any DSP domain clocks */ /* Stop any DSP domain clocks */
...@@ -265,6 +269,9 @@ void omap_dsp_pm_resume(void) ...@@ -265,6 +269,9 @@ void omap_dsp_pm_resume(void)
{ {
unsigned short save_arm_idlect2; unsigned short save_arm_idlect2;
if (! init_done)
return;
/* Restore DSP domain clocks */ /* Restore DSP domain clocks */
save_arm_idlect2 = omap_readw(ARM_IDLECT2); // api_ck is in ARM_IDLECT2 save_arm_idlect2 = omap_readw(ARM_IDLECT2); // api_ck is in ARM_IDLECT2
clk_enable(api_ck_handle); clk_enable(api_ck_handle);
...@@ -276,8 +283,6 @@ void omap_dsp_pm_resume(void) ...@@ -276,8 +283,6 @@ void omap_dsp_pm_resume(void)
__dsp_run(); __dsp_run();
} }
static int init_done;
static int __init omap_dsp_init(void) static int __init omap_dsp_init(void)
{ {
dspmem_size = 0; dspmem_size = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment