Loading drivers/soc/qcom/subsystem_restart.c +20 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -171,6 +172,7 @@ struct subsys_device { dev_t dev_no; struct completion err_ready; bool crashed; int notif_state; struct list_head list; }; Loading Loading @@ -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 *)) { Loading Loading @@ -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) Loading @@ -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; Loading Loading @@ -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); Loading Loading
drivers/soc/qcom/subsystem_restart.c +20 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -171,6 +172,7 @@ struct subsys_device { dev_t dev_no; struct completion err_ready; bool crashed; int notif_state; struct list_head list; }; Loading Loading @@ -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 *)) { Loading Loading @@ -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) Loading @@ -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; Loading Loading @@ -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); Loading