Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd822c54 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta
Browse files

esoc: Reorder the events in graceful shutdown case.



The correct order for graceful shutdown should be: send sysmon-shutdown,
call the poweroff clinet hooks and finally pull the reset line to low
to trigger a poweroff of the modem.

Change-Id: Ife1aa1db3bcb5aaf2dd643885502ab0bdf005149
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
parent 5592496c
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -211,18 +211,13 @@ static int mdm_cmd_exe(enum esoc_cmd cmd, struct esoc_clink *esoc)
				dev_err(mdm->dev,
				 "sysmon shutdown fail, ret = %d\n", ret);
				graceful_shutdown = false;
				goto force_poff;
			}
		} else {
			esoc_clink_queue_request(ESOC_REQ_SEND_SHUTDOWN, esoc);
		}
force_poff:
	/* The case is a fallthrough of the previous case,
	 * where, after sending the shutdown command, we
	 * are actually turning off the modem.
	 */
		break;
	case ESOC_FORCE_PWR_OFF:
		if (!graceful_shutdown) {
		if (!graceful_shutdown && esoc->subsys.sysmon_shutdown_ret) {
			mdm_disable_irqs(mdm);
			mdm->debug = 0;
			mdm->ready = false;
+4 −1
Original line number Diff line number Diff line
@@ -190,14 +190,17 @@ static int mdm_subsys_shutdown(const struct subsys_desc *crashed_subsys,
				 * of the command engine as is.
				 */
				return 0;
			dev_dbg(&esoc_clink->dev, "Sending sysmon-shutdown\n");
			ret = clink_ops->cmd_exe(ESOC_PWR_OFF, esoc_clink);
		}
		if (ret) {
			dev_err(&esoc_clink->dev, "failed to exe power off\n");
			return ret;
		}
		mdm_drv->mode = PWR_OFF;
		esoc_client_link_power_off(esoc_clink, false);
		/* Pull the reset line low to turn off the device */
		clink_ops->cmd_exe(ESOC_FORCE_PWR_OFF, esoc_clink);
		mdm_drv->mode = PWR_OFF;
	}
	return 0;
}