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

Commit ab1b838b authored by Avaneesh Kumar Dwivedi's avatar Avaneesh Kumar Dwivedi
Browse files

soc: qcom: Add offlining state to subsystem private state machine



There are certain occasions when a subsystem though already in STM
mode, sometimes its acknowledgment of ready to shutdown gets delayed
and meanwhile being sent and awaited for response of sysmon event on
simultaneous crash of another subsystem.

This scenario results in deadlock, adding and setting private state
of subsystem with offlining state before graceful shutdown so that
during any delay in acknowledgment no sysmon event should be sent
to the subsystem which is already down.

CRs-Fixed: 991688
Change-Id: I9841ddc88a114fa94aa93571ee27c8c2f7bf6d39
Signed-off-by: default avatarAvaneesh Kumar Dwivedi <akdwived@codeaurora.org>
parent d3068532
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -69,17 +69,20 @@ enum p_subsys_state {

/**
 * enum subsys_state - state of a subsystem (public)
 * @SUBSYS_OFFLINING: subsystem is offlining
 * @SUBSYS_OFFLINE: subsystem is offline
 * @SUBSYS_ONLINE: subsystem is online
 *
 * The 'public' side of the subsytem state, exposed to userspace.
 */
enum subsys_state {
	SUBSYS_OFFLINING,
	SUBSYS_OFFLINE,
	SUBSYS_ONLINE,
};

static const char * const subsys_states[] = {
	[SUBSYS_OFFLINING] = "OFFLINING",
	[SUBSYS_OFFLINE] = "OFFLINE",
	[SUBSYS_ONLINE] = "ONLINE",
};
@@ -727,6 +730,7 @@ static void subsys_stop(struct subsys_device *subsys)

	if (!of_property_read_bool(subsys->desc->dev->of_node,
					"qcom,pil-force-shutdown")) {
		subsys_set_state(subsys, SUBSYS_OFFLINING);
		subsys->desc->sysmon_shutdown_ret =
				sysmon_send_shutdown(subsys->desc);
		if (subsys->desc->sysmon_shutdown_ret)