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

Commit 04ca8dc0 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

qcom: ssr: Abort SSR when called on an offline subsystem



Currently, if SSR is triggered on a subsystem that is offline,
a kernel panic is triggered. Instead of restarting the whole
device, print a warning and abort the SSR process.

Change-Id: Ib0e03a0527002fbaa847ada491b5d43c9b0c4ff8
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 51802bb1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -792,16 +792,18 @@ static void __subsystem_restart_dev(struct subsys_device *dev)
	 * they want up until the point where the subsystem is shutdown.
	 */
	spin_lock_irqsave(&track->s_lock, flags);
	if (track->p_state != SUBSYS_CRASHED) {
		if (dev->track.state == SUBSYS_ONLINE &&
		    track->p_state != SUBSYS_RESTARTING) {
	if (track->p_state != SUBSYS_CRASHED &&
					dev->track.state == SUBSYS_ONLINE) {
		if (track->p_state != SUBSYS_RESTARTING) {
			track->p_state = SUBSYS_CRASHED;
			__pm_stay_awake(&dev->ssr_wlock);
			queue_work(ssr_wq, &dev->work);
		} else {
			panic("Subsystem %s crashed during SSR!", name);
		}
	}
	} else
		WARN(dev->track.state == SUBSYS_OFFLINE,
			"SSR aborted: %s subsystem not online\n", name);
	spin_unlock_irqrestore(&track->s_lock, flags);
}