Loading drivers/soc/qcom/subsystem_restart.c +16 −3 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ struct restart_log { * @work: context for subsystem_restart_wq_func() for this device * @ssr_wlock: prevents suspend during subsystem_restart() * @wlname: name of wakeup source * @device_restart_work: work struct for device restart * @track: state tracking and locking * @notify: subsys notify handle * @dev: device Loading @@ -145,6 +146,7 @@ struct subsys_device { struct work_struct work; struct wakeup_source ssr_wlock; char wlname[64]; struct work_struct device_restart_work; struct subsys_tracking track; void *notify; Loading Loading @@ -760,6 +762,16 @@ static void __subsystem_restart_dev(struct subsys_device *dev) spin_unlock_irqrestore(&track->s_lock, flags); } static void device_restart_work_hdlr(struct work_struct *work) { struct subsys_device *dev = container_of(work, struct subsys_device, device_restart_work); notify_each_subsys_device(&dev, 1, SUBSYS_SOC_RESET, NULL); panic("subsys-restart: Resetting the SoC - %s crashed.", dev->desc->name); } int subsystem_restart_dev(struct subsys_device *dev) { const char *name; Loading Loading @@ -794,9 +806,9 @@ int subsystem_restart_dev(struct subsys_device *dev) __subsystem_restart_dev(dev); break; case RESET_SOC: notify_each_subsys_device(&dev, 1, SUBSYS_SOC_RESET, NULL); panic("subsys-restart: Resetting the SoC - %s crashed.", name); break; __pm_stay_awake(&dev->ssr_wlock); schedule_work(&dev->device_restart_work); return 0; default: panic("subsys-restart: Unknown restart level!\n"); break; Loading Loading @@ -1318,6 +1330,7 @@ struct subsys_device *subsys_register(struct subsys_desc *desc) snprintf(subsys->wlname, sizeof(subsys->wlname), "ssr(%s)", desc->name); wakeup_source_init(&subsys->ssr_wlock, subsys->wlname); INIT_WORK(&subsys->work, subsystem_restart_wq_func); INIT_WORK(&subsys->device_restart_work, device_restart_work_hdlr); spin_lock_init(&subsys->track.s_lock); subsys->id = ida_simple_get(&subsys_ida, 0, 0, GFP_KERNEL); Loading Loading
drivers/soc/qcom/subsystem_restart.c +16 −3 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ struct restart_log { * @work: context for subsystem_restart_wq_func() for this device * @ssr_wlock: prevents suspend during subsystem_restart() * @wlname: name of wakeup source * @device_restart_work: work struct for device restart * @track: state tracking and locking * @notify: subsys notify handle * @dev: device Loading @@ -145,6 +146,7 @@ struct subsys_device { struct work_struct work; struct wakeup_source ssr_wlock; char wlname[64]; struct work_struct device_restart_work; struct subsys_tracking track; void *notify; Loading Loading @@ -760,6 +762,16 @@ static void __subsystem_restart_dev(struct subsys_device *dev) spin_unlock_irqrestore(&track->s_lock, flags); } static void device_restart_work_hdlr(struct work_struct *work) { struct subsys_device *dev = container_of(work, struct subsys_device, device_restart_work); notify_each_subsys_device(&dev, 1, SUBSYS_SOC_RESET, NULL); panic("subsys-restart: Resetting the SoC - %s crashed.", dev->desc->name); } int subsystem_restart_dev(struct subsys_device *dev) { const char *name; Loading Loading @@ -794,9 +806,9 @@ int subsystem_restart_dev(struct subsys_device *dev) __subsystem_restart_dev(dev); break; case RESET_SOC: notify_each_subsys_device(&dev, 1, SUBSYS_SOC_RESET, NULL); panic("subsys-restart: Resetting the SoC - %s crashed.", name); break; __pm_stay_awake(&dev->ssr_wlock); schedule_work(&dev->device_restart_work); return 0; default: panic("subsys-restart: Unknown restart level!\n"); break; Loading Loading @@ -1318,6 +1330,7 @@ struct subsys_device *subsys_register(struct subsys_desc *desc) snprintf(subsys->wlname, sizeof(subsys->wlname), "ssr(%s)", desc->name); wakeup_source_init(&subsys->ssr_wlock, subsys->wlname); INIT_WORK(&subsys->work, subsystem_restart_wq_func); INIT_WORK(&subsys->device_restart_work, device_restart_work_hdlr); spin_lock_init(&subsys->track.s_lock); subsys->id = ida_simple_get(&subsys_ida, 0, 0, GFP_KERNEL); Loading