diff options
authorSuman Anna2017-05-11 00:55:59 -0500
committerSuman Anna2019-03-11 12:02:01 -0500
commit9582a7a2a16e4096b96b370e180e4f137053a7b4 (patch)
parent81d5a33c5aa79a15d3e1ebca8c5f226bb68b954a (diff)
remoteproc/omap: fix auto-suspend failure warning during crashed state
The runtime autosuspend on a OMAP remoteproc device is attempted when the suspend timer expires (autosuspend delay elapsed since the last time the device is busy). This is the normal autosuspend scenario for a device functioning normally. This timer can also expire during the debugging of a remoteproc crash when the remoteproc recovery is disabled. This is an invalid pre-condition though, so check for the RPROC_CRASHED state and bail out before the actual check for the RPROC_RUNNING state. The auto-suspend is also not re-attempted until the remoteproc is recovered and restored to normal functional state. Signed-off-by: Suman Anna <s-anna@ti.com>
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index db39527bde0b..5142d01f1cd6 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -854,6 +854,11 @@ static int omap_rproc_runtime_suspend(struct device *dev)
854 struct omap_rproc *oproc = rproc->priv; 854 struct omap_rproc *oproc = rproc->priv;
855 int ret; 855 int ret;
856 856
857 if (rproc->state == RPROC_CRASHED) {
858 dev_dbg(dev, "rproc cannot be runtime suspended when crashed!\n");
859 return -EBUSY;
860 }
857 if (WARN_ON(rproc->state != RPROC_RUNNING)) { 862 if (WARN_ON(rproc->state != RPROC_RUNNING)) {
858 dev_err(dev, "rproc cannot be runtime suspended when not running!\n"); 863 dev_err(dev, "rproc cannot be runtime suspended when not running!\n");
859 return -EBUSY; 864 return -EBUSY;