Skip to contentSkip to conversation

watchdog: fix watchdog_nmi_enable_all()

RFC PATCH In review Ulrich Obergfell 2 participants 3 messages Apr 17, 2015

lore
Share & tools
lore
#0 lore raw

cover watchdog: fix watchdog_nmi_enable_all()

It appears that this issue has been introduced during the recent merges. It is related to the patch series from https://lkml.org/lkml/2015/2/5/624 and
http://lkml.kernel.org/r/[email protected]

watchdog_nmi_enable_all() needs to check a bit in watchdog_enabled to determine whether the NMI watchdog is running, not the content of watchdog_user_enabled.

The attached [RFC PATCH 1/1] has undergone minimal testing only.

Ulrich Obergfell (1):
watchdog: fix watchdog_nmi_enable_all()

 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.7.11.7
#1 lore raw

RFC PATCH 1/1 watchdog: fix watchdog_nmi_enable_all()

The 'watchdog_user_enabled' variable is only used as an 'interface' to the /proc/sys/kernel/watchdog parameter. The actual state of the watchdog is tracked by bits in the 'watchdog_enabled' variable. So, watchdog_nmi_enable_all() should check the NMI_WATCHDOG_ENABLED bit in 'watchdog_enabled'.

---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/watchdog.c +1 -1
index 2316f50..cba2110 100644
@@ -608,7 +608,7 @@ void watchdog_nmi_enable_all(void)
 {
 	int cpu;
 
-	if (!watchdog_user_enabled)
+	if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED))
 		return;
 
 	get_online_cpus();
Signature · 1 line
1.7.11.7
#2 lore raw
Quoted 5 lines · Ulrich Obergfell

The 'watchdog_user_enabled' variable is only used as an 'interface' to the /proc/sys/kernel/watchdog parameter. The actual state of the watchdog is tracked by bits in the 'watchdog_enabled' variable. So, watchdog_nmi_enable_all() should check the NMI_WATCHDOG_ENABLED bit in 'watchdog_enabled'.

Looks good. I'll respin this and send to Andrew on Monday.

Cheers,
Don

Quoted 22 lines
---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/watchdog.c +1 -1
index 2316f50..cba2110 100644
@@ -608,7 +608,7 @@ void watchdog_nmi_enable_all(void)
 {
 	int cpu;
 
-	if (!watchdog_user_enabled)
+	if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED))
 		return;
 
 	get_online_cpus();
Signature · 1 line
1.7.11.7