Skip to content

Commit e7f60cf

Browse files
Miguel VadilloLuis Henriques
authored andcommitted
omap: mach-omap2: don't wake ipu from hibernation for suspend
If the IPU subsystem has hibernated, there is no need to wake it up and forward suspend notifications. Also, resume notifications will not be forwarded to the IPU SS if it has hibernated. This is because self-hibernation only occurs when no resources are in use. In this case the SysLink PM context save/restore should be all that is needed. Change-Id: I892e58b569d922038db8fb8604d1432087235f75 Signed-off-by: Miguel Vadillo <[email protected]> Signed-off-by: Paul Hunt <[email protected]> Signed-off-by: Juan Gutierrez <[email protected]> Signed-off-by: Axel Haslam <[email protected]>
1 parent 3969e19 commit e7f60cf

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

arch/arm/mach-omap2/ipu_drv.c

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static struct class *omap_ipu_pm_class;
4848
static dev_t omap_ipu_pm_dev;
4949

5050
int ipu_pm_first_dev;
51+
int need_resume_notifications;
5152

5253
static struct proc_dir_entry *ipu_pm_proc_entry;
5354
/* we could iterate over something much more
@@ -180,6 +181,8 @@ static int __devinit ipu_pm_probe(struct platform_device *pdev)
180181
/* int id = pdev->id; */
181182
/* ivahd.pdev = pdev; */
182183

184+
need_resume_notifications = 0;
185+
183186
if (!is_driver_init) {
184187
is_driver_init = 1;
185188
/* FIXME: maybe needed for multiple dev */
@@ -210,18 +213,26 @@ static int ipu_pm_drv_suspend(struct device *dev)
210213
*/
211214
/* call notification function */
212215
if (ipu_pm_get_handle(APP_M3)) {
213-
retval = ipu_pm_notifications(APP_M3, PM_SUSPEND, NULL);
214-
if (retval)
215-
goto error;
216+
if (!(ipu_pm_get_state(APP_M3) & APP_PROC_DOWN)) {
217+
retval = ipu_pm_notifications(APP_M3,
218+
PM_SUSPEND, NULL);
219+
if (retval)
220+
goto error;
221+
}
216222
}
217223
if (ipu_pm_get_handle(SYS_M3)) {
218-
retval = ipu_pm_notifications(SYS_M3, PM_SUSPEND, NULL);
219-
if (retval)
220-
goto error;
221-
/* sysm3 is handling hibernation of ducati currently */
222-
ipu_pm_save_ctx(SYS_M3);
224+
if (!(ipu_pm_get_state(SYS_M3) & SYS_PROC_DOWN)) {
225+
retval = ipu_pm_notifications(SYS_M3,
226+
PM_SUSPEND, NULL);
227+
if (retval)
228+
goto error;
229+
/* sysm3 is handling hibernation of ducati
230+
* currently
231+
*/
232+
ipu_pm_save_ctx(SYS_M3);
233+
need_resume_notifications = 1;
234+
}
223235
}
224-
225236
/* return result, should be zero if all Ducati clients
226237
* returned zero else fail code
227238
*/
@@ -242,15 +253,20 @@ static int ipu_pm_drv_resume(struct device *dev)
242253
*/
243254

244255
/* call our notification function */
245-
if (ipu_pm_get_handle(APP_M3)) {
246-
retval = ipu_pm_notifications(APP_M3, PM_RESUME, NULL);
247-
if (retval)
248-
goto error;
249-
}
250-
if (ipu_pm_get_handle(SYS_M3)) {
251-
retval = ipu_pm_notifications(SYS_M3, PM_RESUME, NULL);
252-
if (retval)
253-
goto error;
256+
if (need_resume_notifications) {
257+
if (ipu_pm_get_handle(APP_M3)) {
258+
retval = ipu_pm_notifications(APP_M3,
259+
PM_RESUME, NULL);
260+
if (retval)
261+
goto error;
262+
}
263+
if (ipu_pm_get_handle(SYS_M3)) {
264+
retval = ipu_pm_notifications(SYS_M3,
265+
PM_RESUME, NULL);
266+
if (retval)
267+
goto error;
268+
}
269+
need_resume_notifications = 0;
254270
}
255271

256272
/* return result, should be zero if all Ducati clients

drivers/dsp/syslink/ipu_pm/ipu_pm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,7 @@ u32 ipu_pm_get_state(int proc_id)
23282328

23292329
return handle->rcb_table->state_flag;
23302330
}
2331+
EXPORT_SYMBOL(ipu_pm_get_state);
23312332

23322333
/*
23332334
Function to get ipu pm object

0 commit comments

Comments
 (0)