aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorShahid Akhtar <sakhtar@ti.com>2012-06-07 11:32:20 -0500
committerZiyann <jaraidaniel@gmail.com>2014-10-01 12:58:51 +0200
commit6fbfdba64d4ee7ef0342cd5ab41d50ea1efb59e4 (patch)
tree2ca005b7d453face08481b7dc5047255824f821c /drivers/remoteproc
parent260f578f601f1909656ecb0318d95c97c4cc5abb (diff)
downloadkernel_samsung_tuna-6fbfdba64d4ee7ef0342cd5ab41d50ea1efb59e4.tar.gz
kernel_samsung_tuna-6fbfdba64d4ee7ef0342cd5ab41d50ea1efb59e4.tar.bz2
kernel_samsung_tuna-6fbfdba64d4ee7ef0342cd5ab41d50ea1efb59e4.zip
remoteproc: omap: differentiate auto-suspend from system suspend
The omap remoteproc driver sends a mailbox message to the remote processor requesting it to save its context and then be suspended. This can happen either through the runtime auto-suspend path or through the system suspend. The mailbox message being sent to the remote processor is now differentiated between the two paths. This differentiation provides flexibility on the remote processor to allow an application cancel auto-suspend. This flexibility is needed as there can be some operations wherein there is no on-going activity between the host and the remote processor with the remote processor idle waiting for an event that would take more time to complete than the auto-suspend timeout. The auto-suspend cancellation is detected by the driver on the host-side through a timeout for the processor to be idled, and is simply rescheduled. Change-Id: Ifdeeb80a632ac0145194d3c20f66256226e7efd4 Signed-off-by: Shahid Akhtar <sakhtar@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/omap_remoteproc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index ddb383fd216..5a5d1206d37 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -35,6 +35,7 @@
#include "../../arch/arm/mach-omap2/clockdomain.h"
#define PM_SUSPEND_MBOX 0xffffff07
+#define PM_SUSPEND_MBOX_FORCE 0xffffff09
#define PM_SUSPEND_TIMEOUT 300
struct omap_rproc_priv {
@@ -57,11 +58,14 @@ static bool _may_suspend(struct omap_rproc_priv *rpp)
return readl(rpp->idle) & rpp->idle_mask;
}
-static int _suspend(struct omap_rproc_priv *rpp)
+static int _suspend(struct omap_rproc_priv *rpp, bool force)
{
unsigned long timeout = msecs_to_jiffies(PM_SUSPEND_TIMEOUT) + jiffies;
- omap_mbox_msg_send(rpp->mbox, PM_SUSPEND_MBOX);
+ if (force)
+ omap_mbox_msg_send(rpp->mbox, PM_SUSPEND_MBOX_FORCE);
+ else
+ omap_mbox_msg_send(rpp->mbox, PM_SUSPEND_MBOX);
while (time_after(timeout, jiffies)) {
if ((readl(rpp->suspend) & rpp->suspend_mask) &&
@@ -78,7 +82,7 @@ static int omap_suspend(struct rproc *rproc, bool force)
struct omap_rproc_priv *rpp = rproc->priv;
if (rpp->idle && (force || _may_suspend(rpp)))
- return _suspend(rpp);
+ return _suspend(rpp, force);
return -EBUSY;
}