From 6421f450a6c3c0bd5d3ab31cc8f8e469d876115b Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 11 Oct 2005 18:26:30 +0300 Subject: [PATCH] [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 --- arch/arm/plat-omap/dsp/dsp_common.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; -- 2.41.1