Lines Matching refs:watchdog

27 	struct gb_svc_watchdog *watchdog =  in svc_watchdog_pm_notifier()  local
32 gb_svc_watchdog_disable(watchdog->svc); in svc_watchdog_pm_notifier()
35 gb_svc_watchdog_enable(watchdog->svc); in svc_watchdog_pm_notifier()
65 struct gb_svc_watchdog *watchdog; in do_work() local
69 watchdog = container_of(work, struct gb_svc_watchdog, work.work); in do_work()
70 svc = watchdog->svc; in do_work()
98 watchdog->enabled = false; in do_work()
103 if (watchdog->enabled) in do_work()
104 schedule_delayed_work(&watchdog->work, SVC_WATCHDOG_PERIOD); in do_work()
109 struct gb_svc_watchdog *watchdog; in gb_svc_watchdog_create() local
112 if (svc->watchdog) in gb_svc_watchdog_create()
115 watchdog = kmalloc(sizeof(*watchdog), GFP_KERNEL); in gb_svc_watchdog_create()
116 if (!watchdog) in gb_svc_watchdog_create()
119 watchdog->enabled = false; in gb_svc_watchdog_create()
120 watchdog->svc = svc; in gb_svc_watchdog_create()
121 INIT_DELAYED_WORK(&watchdog->work, do_work); in gb_svc_watchdog_create()
122 svc->watchdog = watchdog; in gb_svc_watchdog_create()
124 watchdog->pm_notifier.notifier_call = svc_watchdog_pm_notifier; in gb_svc_watchdog_create()
125 retval = register_pm_notifier(&watchdog->pm_notifier); in gb_svc_watchdog_create()
135 unregister_pm_notifier(&watchdog->pm_notifier); in gb_svc_watchdog_create()
141 svc->watchdog = NULL; in gb_svc_watchdog_create()
142 kfree(watchdog); in gb_svc_watchdog_create()
149 struct gb_svc_watchdog *watchdog = svc->watchdog; in gb_svc_watchdog_destroy() local
151 if (!watchdog) in gb_svc_watchdog_destroy()
154 unregister_pm_notifier(&watchdog->pm_notifier); in gb_svc_watchdog_destroy()
156 svc->watchdog = NULL; in gb_svc_watchdog_destroy()
157 kfree(watchdog); in gb_svc_watchdog_destroy()
162 if (!svc || !svc->watchdog) in gb_svc_watchdog_enabled()
164 return svc->watchdog->enabled; in gb_svc_watchdog_enabled()
169 struct gb_svc_watchdog *watchdog; in gb_svc_watchdog_enable() local
171 if (!svc->watchdog) in gb_svc_watchdog_enable()
174 watchdog = svc->watchdog; in gb_svc_watchdog_enable()
175 if (watchdog->enabled) in gb_svc_watchdog_enable()
178 watchdog->enabled = true; in gb_svc_watchdog_enable()
179 schedule_delayed_work(&watchdog->work, SVC_WATCHDOG_PERIOD); in gb_svc_watchdog_enable()
185 struct gb_svc_watchdog *watchdog; in gb_svc_watchdog_disable() local
187 if (!svc->watchdog) in gb_svc_watchdog_disable()
190 watchdog = svc->watchdog; in gb_svc_watchdog_disable()
191 if (!watchdog->enabled) in gb_svc_watchdog_disable()
194 watchdog->enabled = false; in gb_svc_watchdog_disable()
195 cancel_delayed_work_sync(&watchdog->work); in gb_svc_watchdog_disable()