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

Commit 136a448a authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

msm: ssr: Add flag to differentiate between subsys_stop/shutdown



Currently, the drivers that have registered for notifications
regarding the subsystems have no way to determine whether the
subsystem is being restarted or just shutdown.
Send the force_stop flag along with the *_SHUTDOWN notifier
during SSR. Drivers can then perform different operations based
on the value of force_stop.

Change-Id: I40e3ce3c90fab438c492dd5468de2a3df360f1e3
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent d96f7618
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -690,6 +690,7 @@ static void subsystem_restart_wq_func(struct work_struct *work)
	struct subsys_tracking *track;
	unsigned count;
	unsigned long flags;
	bool force_stop = true;

	/*
	 * It's OK to not take the registration lock at this point.
@@ -718,9 +719,11 @@ static void subsystem_restart_wq_func(struct work_struct *work)

	pr_debug("[%p]: Starting restart sequence for %s\n", current,
			desc->name);
	notify_each_subsys_device(list, count, SUBSYS_BEFORE_SHUTDOWN, NULL);
	notify_each_subsys_device(list, count, SUBSYS_BEFORE_SHUTDOWN,
							(void *)force_stop);
	for_each_subsys_device(list, count, NULL, subsystem_shutdown);
	notify_each_subsys_device(list, count, SUBSYS_AFTER_SHUTDOWN, NULL);
	notify_each_subsys_device(list, count, SUBSYS_AFTER_SHUTDOWN,
							(void *)force_stop);

	notify_each_subsys_device(list, count, SUBSYS_RAMDUMP_NOTIFICATION,
							  &enable_ramdumps);