OSDN Git Service

esoc: Only force power off if the graceful shutdown fails
authorGustavo Solaira <gustavos@codeaurora.org>
Mon, 16 Apr 2018 17:30:23 +0000 (10:30 -0700)
committerGustavo Solaira <gustavos@codeaurora.org>
Wed, 18 Apr 2018 04:47:44 +0000 (21:47 -0700)
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>
drivers/esoc/esoc-mdm-4x.c

index d071e89..99fd598 100644 (file)
@@ -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) {