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

Commit de3cf520 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

msm: subsystem_restart: Add notification to indicate powerup failure



Currently, if powering on a subsystem during restart fails, a
kernel panic is trigerred immediately.
Instead, send a 'powerup failure' notification to the drivers
that have registered for notifications regarding the subsystem.
The drivers can then do the necessary cleanup/logging before a
kernel panic is triggered.

Change-Id: I252f221ee009436b7075c203b2a3de45e395c1b0
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 36981829
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ enum subsys_notif_type {
	SUBSYS_BEFORE_POWERUP,
	SUBSYS_AFTER_POWERUP,
	SUBSYS_RAMDUMP_NOTIFICATION,
	SUBSYS_POWERUP_FAILURE,
	SUBSYS_NOTIF_TYPE_COUNT
};

+8 −2
Original line number Diff line number Diff line
@@ -495,14 +495,20 @@ static void subsystem_powerup(struct subsys_device *dev, void *data)
	pr_info("[%p]: Powering up %s\n", current, name);
	init_completion(&dev->err_ready);

	if (dev->desc->powerup(dev->desc) < 0)
	if (dev->desc->powerup(dev->desc) < 0) {
		notify_each_subsys_device(&dev, 1, SUBSYS_POWERUP_FAILURE,
								NULL);
		panic("[%p]: Powerup error: %s!", current, name);
	}
	enable_all_irqs(dev);

	ret = wait_for_err_ready(dev);
	if (ret)
	if (ret) {
		notify_each_subsys_device(&dev, 1, SUBSYS_POWERUP_FAILURE,
								NULL);
		panic("[%p]: Timed out waiting for error ready: %s!",
			current, name);
	}
	subsys_set_state(dev, SUBSYS_ONLINE);
}