summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Solaira <gustavos@codeaurora.org>2018-04-16 10:30:23 -0700
committerGustavo Solaira <gustavos@codeaurora.org>2018-04-17 21:47:44 -0700
commitee837fb6334dff6b1a37ffeb34b4b7c5d1d6b5ef (patch)
tree988321c1811602b13ec1716f617105549047d12f
parentdb005c458c701ded1856bc6facd07349f62e98a2 (diff)
esoc: Only force power off if the graceful shutdown fails
Force power off should only be used in case the graceful shutdown fails otherwise the esoc will be resetted even when not needed. Change-Id: I2180e36a10bb325e55a8782554c71165fa7a6bee Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
-rw-r--r--drivers/esoc/esoc-mdm-4x.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/esoc/esoc-mdm-4x.c b/drivers/esoc/esoc-mdm-4x.c
index d071e89d3124..99fd598b5069 100644
--- a/drivers/esoc/esoc-mdm-4x.c
+++ b/drivers/esoc/esoc-mdm-4x.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2015, 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -230,10 +230,15 @@ static int mdm_cmd_exe(enum esoc_cmd cmd, struct esoc_clink *esoc)
}
msleep(100);
}
- if (status_down)
+ if (status_down) {
dev_dbg(dev, "shutdown successful\n");
- else
+ esoc_clink_queue_request(ESOC_REQ_SHUTDOWN, esoc);
+ } else {
dev_err(mdm->dev, "graceful poff ipc fail\n");
+ graceful_shutdown = false;
+ goto force_poff;
+ }
+ break;
force_poff:
case ESOC_FORCE_PWR_OFF:
if (!graceful_shutdown) {