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

Commit 8945a238 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: subsystem_restart: Send sysmon event notifications on powerup"

parents d8a8714c f373664c
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ struct restart_log {
 * @do_ramdump_on_put: ramdump on subsystem_put() if true
 * @err_ready: completion variable to record error ready from subsystem
 * @crashed: indicates if subsystem has crashed
 * @notif_state: current state of subsystem in terms of subsys notifications
 */
struct subsys_device {
	struct subsys_desc *desc;
@@ -171,6 +172,7 @@ struct subsys_device {
	dev_t dev_no;
	struct completion err_ready;
	bool crashed;
	int notif_state;
	struct list_head list;
};

@@ -376,6 +378,18 @@ out:
	mutex_unlock(&restart_log_mutex);
}

static void send_sysmon_notif(struct subsys_device *dev)
{
	struct subsys_device *subsys;

	mutex_lock(&subsys_list_lock);
	list_for_each_entry(subsys, &subsys_list, list)
		if ((subsys->notif_state > 0) && (subsys != dev))
			sysmon_send_event(dev->desc->name, subsys->desc->name,
						subsys->notif_state);
	mutex_unlock(&subsys_list_lock);
}

static void for_each_subsys_device(struct subsys_device **list, unsigned count,
		void *data, void (*fn)(struct subsys_device *, void *))
{
@@ -403,6 +417,8 @@ static void notify_each_subsys_device(struct subsys_device **list,

		pdev = container_of(dev->desc->dev, struct platform_device,
									dev);
		dev->notif_state = notif;

		mutex_lock(&subsys_list_lock);
		list_for_each_entry(subsys, &subsys_list, list)
			if (dev != subsys)
@@ -411,6 +427,9 @@ static void notify_each_subsys_device(struct subsys_device **list,
						notif);
		mutex_unlock(&subsys_list_lock);

		if (notif == SUBSYS_AFTER_POWERUP)
			send_sysmon_notif(dev);

		notif_data.crashed = subsys_get_crash_status(dev);
		notif_data.enable_ramdump = enable_ramdumps;
		notif_data.no_auth = dev->desc->no_auth;
@@ -1358,6 +1377,7 @@ struct subsys_device *subsys_register(struct subsys_desc *desc)
	subsys->dev.parent = desc->dev;
	subsys->dev.bus = &subsys_bus_type;
	subsys->dev.release = subsys_device_release;
	subsys->notif_state = -1;

	subsys->notify = subsys_notif_add_subsys(desc->name);