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

Commit b58cba17 authored by Raghavendra Rao Ananta's avatar Raghavendra Rao Ananta Committed by Isaac J. Manjarres
Browse files

soc: qcom: ssr: Initialize the shutdown_ack completion variable properly



The shutdown_ack completion varaible, used during a call to
sysmon_send_shutdown(), is not initialized correctly. Initialize
it first while a subsystem regsiters with the SSR framework, followed
by a reinitialization before every wait_for_completion(). This gives
the flexibility for any subsystem that registers with the SSR
framework to make a call to sysmon_send_shutdown.

Change-Id: Ib28b9e27916bfb5ba41c82dae37e733e439eb4ee
Signed-off-by: default avatarRaghavendra Rao Ananta <rananta@codeaurora.org>
parent 381b504a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -771,10 +771,10 @@ static void subsys_stop(struct subsys_device *subsys)
	const char *name = subsys->desc->name;

	notify_each_subsys_device(&subsys, 1, SUBSYS_BEFORE_SHUTDOWN, NULL);
	reinit_completion(&subsys->shutdown_ack);
	if (!of_property_read_bool(subsys->desc->dev->of_node,
					"qcom,pil-force-shutdown")) {
		subsys_set_state(subsys, SUBSYS_OFFLINING);
		init_completion(&subsys->shutdown_ack);
		subsys->desc->sysmon_shutdown_ret =
				sysmon_send_shutdown(subsys->desc);
		if (subsys->desc->sysmon_shutdown_ret)
@@ -1700,6 +1700,7 @@ struct subsys_device *subsys_register(struct subsys_desc *desc)
	dev_set_name(&subsys->dev, "subsys%d", subsys->id);

	mutex_init(&subsys->track.lock);
	init_completion(&subsys->shutdown_ack);

	ret = device_register(&subsys->dev);
	if (ret) {