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

Commit 4e651c66 authored by Deepak Katragadda's avatar Deepak Katragadda Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: ssr: Check the subsystem state before initiating SSR



In the case when subsystem restart is triggered on a subsystem
which is being shutdown, there might be a race condition which
could involve the SSR framework trying to restart a subsystem
which is already shutdown. Print a warning and return from the
SSR function if this is the case.

Change-Id: I38083822db598e7b292bcf3b9e187a9f56d48bbb
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent de82da07
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -852,6 +852,12 @@ static void subsystem_restart_wq_func(struct work_struct *work)
	mutex_lock(&track->lock);
	do_epoch_check(dev);

	if (dev->track.state == SUBSYS_OFFLINE) {
		mutex_unlock(&track->lock);
		WARN(1, "SSR aborted: %s subsystem not online\n", desc->name);
		return;
	}

	/*
	 * It's necessary to take the registration lock because the subsystem
	 * list in the SoC restart order will be traversed and it shouldn't be