From: Todd Poynor Date: Tue, 11 Oct 2005 15:26:30 +0000 (+0300) Subject: [PATCH] ARM: OMAP: DSP wedges suspend on unsupported board X-Git-Tag: v2.6.15-omap2~164 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6421f450a6c3c0bd5d3ab31cc8f8e469d876115b;p=linux-2.6-omap-h63xx.git [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: Todd Poynor Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/plat-omap/dsp/dsp_common.c b/arch/arm/plat-omap/dsp/dsp_common.c index 3fe291662ef..c1747f21fa1 100644 --- a/arch/arm/plat-omap/dsp/dsp_common.c +++ b/arch/arm/plat-omap/dsp/dsp_common.c @@ -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;