Message ID | 20150518073046.GO17717@twins.programming.kicks-ass.net (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Mon, May 18, 2015 at 09:30:46AM +0200, Peter Zijlstra wrote: > Let me go see if I can reproduce / test this.. as is the below is > entirely untested. I cannot seem to get suspend to fail on my x240 with linus.git. echo mem > /sys/power/state makes it sleep, and pressing the power button brings it back to life. And this is with X loaded and everything up (well, except the wireless, as it turns out I need a newer firmware version). So I'll have to ask someone else to test this :/ -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 2316f50b07a4..56aeedb087e3 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -608,19 +608,25 @@ void watchdog_nmi_enable_all(void) { int cpu; - if (!watchdog_user_enabled) + mutex_lock(&watchdog_proc_mutex); + + if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED)) return; get_online_cpus(); for_each_online_cpu(cpu) watchdog_nmi_enable(cpu); put_online_cpus(); + + mutex_unlock(&watchdog_proc_mutex); } void watchdog_nmi_disable_all(void) { int cpu; + mutex_lock(&watchdog_proc_mutex); + if (!watchdog_running) return; @@ -628,6 +634,8 @@ void watchdog_nmi_disable_all(void) for_each_online_cpu(cpu) watchdog_nmi_disable(cpu); put_online_cpus(); + + mutex_unlock(&watchdog_proc_mutex); } #else static int watchdog_nmi_enable(unsigned int cpu) { return 0; }