summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMiguel Vadillo <vadillo@ti.com>2010-08-23 15:15:40 -0500
committerRicardo Perez Olivares <x0081762@ti.com>2010-08-26 18:01:21 -0500
commit38f1ca928ad84cb9923cf0e6403cdb16461c7f74 (patch)
tree48da0f09b5675e7027edd79b5786cd2dd20e0761 /drivers
parent17449913f9fc14bc216d7d7dd07dedad7f49b943 (diff)
SYSLINK:IPU-PM: avoiding down_timeout when failing
In ipu_pm_notifications the PID_DEATH/SUSPEND/RESUME event is sent to IPU and a semaphore is used to wait for IPU to respond. In the case when the send_event is failing, there is no need to called the semaphore and wait. Also if one of the proc (SYS/APP) is not responding an error is returned without sending the notification to the other proc. Signed-off-by: Miguel Vadillo <vadillo@ti.com> Signed-off-by: Juan Gutierrez <jgutierrez@ti.com> Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: Paul Hunt <hunt@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dsp/syslink/ipu_pm/ipu_pm.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/dsp/syslink/ipu_pm/ipu_pm.c b/drivers/dsp/syslink/ipu_pm/ipu_pm.c
index b1791d4e7f21..997a57e2e8e9 100644
--- a/drivers/dsp/syslink/ipu_pm/ipu_pm.c
+++ b/drivers/dsp/syslink/ipu_pm/ipu_pm.c
@@ -606,7 +606,7 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
(unsigned int)pm_msg.whole,
true);
if (retval < 0)
- pr_err("Error sending notify event\n");
+ goto error_send;
/* wait until event from IPU (ipu_pm_notify_callback)*/
retval = down_timeout
(&handle->pm_event[PM_SUSPEND]
@@ -614,10 +614,8 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
msecs_to_jiffies(params->timeout));
pm_msg.whole = handle->pm_event[PM_SUSPEND].pm_msg;
if (WARN_ON((retval < 0) ||
- (pm_msg.fields.parm != PM_SUCCESS))) {
- pr_err("Error sending Suspend\n");
- pm_ack = EBUSY;
- }
+ (pm_msg.fields.parm != PM_SUCCESS)))
+ goto error;
break;
case PM_RESUME:
pm_msg.fields.msg_type = PM_NOTIFICATIONS;
@@ -634,7 +632,7 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
(unsigned int)pm_msg.whole,
true);
if (retval < 0)
- pr_err("Error sending notify event\n");
+ goto error_send;
/* wait until event from IPU (ipu_pm_notify_callback)*/
retval = down_timeout
(&handle->pm_event[PM_RESUME]
@@ -642,10 +640,8 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
msecs_to_jiffies(params->timeout));
pm_msg.whole = handle->pm_event[PM_RESUME].pm_msg;
if (WARN_ON((retval < 0) ||
- (pm_msg.fields.parm != PM_SUCCESS))) {
- pr_err("Error sending Resume\n");
- pm_ack = EBUSY;
- }
+ (pm_msg.fields.parm != PM_SUCCESS)))
+ goto error;
break;
case PM_HIBERNATE:
pm_msg.fields.msg_type = PM_NOTIFICATIONS;
@@ -662,7 +658,7 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
(unsigned int)pm_msg.whole,
true);
if (retval < 0)
- pr_err("Error sending notify event\n");
+ goto error_send;
/* wait until event from IPU (ipu_pm_notify_callback)*/
retval = down_timeout
(&handle->pm_event[PM_HIBERNATE]
@@ -670,10 +666,9 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
msecs_to_jiffies(params->timeout));
pm_msg.whole = handle->pm_event[PM_HIBERNATE].pm_msg;
if (WARN_ON((retval < 0) ||
- (pm_msg.fields.parm != PM_SUCCESS))) {
- pr_err("Error sending hibernate\n");
- pm_ack = EBUSY;
- } else {
+ (pm_msg.fields.parm != PM_SUCCESS)))
+ goto error;
+ else {
/*Remote Proc is ready to hibernate*/
handle->rcb_table->state_flag |=
REMOTE_PROC_DOWN;
@@ -696,7 +691,7 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
(unsigned int)pm_msg.whole,
true);
if (retval < 0)
- pr_err("Error sending notify event\n");
+ goto error_send;
/* wait until event from IPU (ipu_pm_notify_callback)*/
retval = down_timeout
(&handle->pm_event[PM_PID_DEATH]
@@ -704,14 +699,18 @@ int ipu_pm_notifications(enum pm_event_type event_type, void *data)
msecs_to_jiffies(params->timeout));
pm_msg.whole = handle->pm_event[PM_PID_DEATH].pm_msg;
if (WARN_ON((retval < 0) ||
- (pm_msg.fields.parm != PM_SUCCESS))) {
- pr_err("Error sending PID Death\n");
- pm_ack = EBUSY;
- }
+ (pm_msg.fields.parm != PM_SUCCESS)))
+ goto error;
break;
}
}
return pm_ack;
+
+error_send:
+ pr_err("Error notify_send event\n");
+error:
+ pr_err("Error sending Notification events\n");
+ return -EBUSY;
}
EXPORT_SYMBOL(ipu_pm_notifications);