Skip to contentSkip to conversation

Forcing non-ACPI watchdog driver

DISCUSSION Jean Delvare 4 participants 9 messages Feb 5, 2020 – Feb 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

Is there a way to prevent the ACPI WDAT watchdog interface from being used and force the use of a native watchdog driver instead?

I have a customer who reports a regression on kernel upgrade. Old kernel (v4.4) uses iTCO_wdt and watchdog works, new kernel (v4.12) uses wdat_wdt and watchdog doesn't work (instant reboot when opening the device). While I'm going to look for fixes to backport, I think it would be pretty convenient to have a way to just revert to the working driver until the new driver is fixed somehow. But I can't see any way to do that at the moment, short of disabling ACPI completely, which is definitely too extreme to be considered.

Am I missing something?

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#1 lore raw
Quoted 1 line · Jean Delvare

Hi all,

Hi,

Quoted 12 lines

Is there a way to prevent the ACPI WDAT watchdog interface from being used and force the use of a native watchdog driver instead?

I have a customer who reports a regression on kernel upgrade. Old kernel (v4.4) uses iTCO_wdt and watchdog works, new kernel (v4.12) uses wdat_wdt and watchdog doesn't work (instant reboot when opening the device). While I'm going to look for fixes to backport, I think it would be pretty convenient to have a way to just revert to the working driver until the new driver is fixed somehow. But I can't see any way to do that at the moment, short of disabling ACPI completely, which is definitely too extreme to be considered.

Quoted 1 line

Am I missing something?

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

maintainer
#2 lore raw
Quoted 17 lines · Mika Westerberg
Quoted 1 line · Jean Delvare

Hi all,

Hi,

Quoted 12 lines

Is there a way to prevent the ACPI WDAT watchdog interface from being used and force the use of a native watchdog driver instead?

I have a customer who reports a regression on kernel upgrade. Old kernel (v4.4) uses iTCO_wdt and watchdog works, new kernel (v4.12) uses wdat_wdt and watchdog doesn't work (instant reboot when opening the device). While I'm going to look for fixes to backport, I think it would be pretty convenient to have a way to just revert to the working driver until the new driver is fixed somehow. But I can't see any way to do that at the moment, short of disabling ACPI completely, which is definitely too extreme to be considered.

Quoted 5 lines
Quoted 1 line

Am I missing something?

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

That may not be possible in a generic distribution.

Guenter

#3 lore raw
Quoted 18 lines · Guenter Roeck
Quoted 17 lines · Mika Westerberg
Quoted 1 line · Jean Delvare

Hi all,

Hi,

Quoted 12 lines

Is there a way to prevent the ACPI WDAT watchdog interface from being used and force the use of a native watchdog driver instead?

I have a customer who reports a regression on kernel upgrade. Old kernel (v4.4) uses iTCO_wdt and watchdog works, new kernel (v4.12) uses wdat_wdt and watchdog doesn't work (instant reboot when opening the device). While I'm going to look for fixes to backport, I think it would be pretty convenient to have a way to just revert to the working driver until the new driver is fixed somehow. But I can't see any way to do that at the moment, short of disabling ACPI completely, which is definitely too extreme to be considered.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Am I missing something?

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

That may not be possible in a generic distribution.

Right, they would need to build their own kernel. Currently there is no way to do that without changing .config.

#4 lore raw

Hi Mika,

Quoted 10 lines · Mika Westerberg
Quoted 6 lines · Guenter Roeck
Quoted 3 lines · Mika Westerberg

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

That may not be possible in a generic distribution.

Right, they would need to build their own kernel. Currently there is no way to do that without changing .config.

OK, that's pretty much what I was compl^Wworried about ;-) Would you consider applying something like the following patch?

From: Jean Delvare <[email protected]>
Subject: ACPI / watchdog: Allow disabling WDAT at boot

In case the WDAT interface is broken, give the user the option to ignore it to let a native driver bind to the watchdog device instead.

Cc Guenter Roeck <[email protected]>
Cc Mika Westerberg <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt |    4 ++++
 drivers/acpi/acpi_watchdog.c                    |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/acpi/acpi_watchdog.c +11 -1
@@ -55,12 +55,14 @@ static bool acpi_watchdog_uses_rtc(const
 }
 #endif
 
+static bool acpi_no_watchdog;
+
 static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
 {
 	const struct acpi_table_wdat *wdat = NULL;
 	acpi_status status;
 
-	if (acpi_disabled)
+	if (acpi_disabled || acpi_no_watchdog)
 		return NULL;
 
 	status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -88,6 +90,14 @@ bool acpi_has_watchdog(void)
 }
 EXPORT_SYMBOL_GPL(acpi_has_watchdog);
 
+/* ACPI watchdog can be disabled on boot command line */
+static int __init disable_acpi_watchdog(char *str)
+{
+	acpi_no_watchdog = true;
+	return 1;
+}
+__setup("acpi_no_watchdog", disable_acpi_watchdog);
+
 void __init acpi_watchdog_init(void)
 {
 	const struct acpi_wdat_entry *entries;
Documentation/admin-guide/kernel-parameters.txt +4 -0
@@ -136,6 +136,10 @@
 			dynamic table installation which will install SSDT
 			tables to /sys/firmware/acpi/tables/dynamic.
 
+	acpi_no_watchdog	[HW,ACPI,WDT]
+			Ignore the ACPI-based watchdog interface (WDAT) and let
+			a native driver control the watchdog device instead.
+
 	acpi_rsdp=	[ACPI,EFI,KEXEC]
 			Pass the RSDP address to the kernel, mostly used
 			on machines running EFI runtime service to boot the

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#5 lore raw
Quoted 9 lines · Jean Delvare

Hi Mika,

Quoted 6 lines · Mika Westerberg
Quoted 5 lines · Guenter Roeck
Quoted 3 lines · Mika Westerberg

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

That may not be possible in a generic distribution.

Right, they would need to build their own kernel. Currently there is no way to do that without changing .config.

OK, that's pretty much what I was compl^Wworried about ;-) Would you consider applying something like the following patch?

Yes, I think the patch makes sense.

Rafael, I guess you will take this since it is touching ACPI?

Quoted 9 lines

From: Jean Delvare <[email protected]>
Subject: ACPI / watchdog: Allow disabling WDAT at boot

In case the WDAT interface is broken, give the user the option to ignore it to let a native driver bind to the watchdog device instead.

Cc Guenter Roeck <[email protected]>
Cc Mika Westerberg <[email protected]>
Quoted 57 lines
Cc Rafael J. Wysocki <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt |    4 ++++
 drivers/acpi/acpi_watchdog.c                    |   12 +++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/acpi/acpi_watchdog.c +11 -1
@@ -55,12 +55,14 @@ static bool acpi_watchdog_uses_rtc(const
 }
 #endif
 
+static bool acpi_no_watchdog;
+
 static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
 {
 	const struct acpi_table_wdat *wdat = NULL;
 	acpi_status status;
 
-	if (acpi_disabled)
+	if (acpi_disabled || acpi_no_watchdog)
 		return NULL;
 
 	status = acpi_get_table(ACPI_SIG_WDAT, 0,
@@ -88,6 +90,14 @@ bool acpi_has_watchdog(void)
 }
 EXPORT_SYMBOL_GPL(acpi_has_watchdog);
 
+/* ACPI watchdog can be disabled on boot command line */
+static int __init disable_acpi_watchdog(char *str)
+{
+	acpi_no_watchdog = true;
+	return 1;
+}
+__setup("acpi_no_watchdog", disable_acpi_watchdog);
+
 void __init acpi_watchdog_init(void)
 {
 	const struct acpi_wdat_entry *entries;
Documentation/admin-guide/kernel-parameters.txt +4 -0
@@ -136,6 +136,10 @@
 			dynamic table installation which will install SSDT
 			tables to /sys/firmware/acpi/tables/dynamic.
 
+	acpi_no_watchdog	[HW,ACPI,WDT]
+			Ignore the ACPI-based watchdog interface (WDAT) and let
+			a native driver control the watchdog device instead.
+
 	acpi_rsdp=	[ACPI,EFI,KEXEC]
 			Pass the RSDP address to the kernel, mostly used
 			on machines running EFI runtime service to boot the

Thanks,

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#6 lore raw
Quoted 16 lines · Mika Westerberg
Quoted 14 lines · Jean Delvare

Hi Mika,

Quoted 10 lines · Mika Westerberg
Quoted 6 lines · Guenter Roeck
Quoted 3 lines · Mika Westerberg

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

That may not be possible in a generic distribution.

Right, they would need to build their own kernel. Currently there is no way to do that without changing .config.

Quoted 6 lines
Quoted 2 lines

OK, that's pretty much what I was compl^Wworried about ;-) Would you consider applying something like the following patch?

Yes, I think the patch makes sense.

Rafael, I guess you will take this since it is touching ACPI?

Yes, I will.

Quoted 11 lines
Quoted 9 lines

From: Jean Delvare <[email protected]>
Subject: ACPI / watchdog: Allow disabling WDAT at boot

In case the WDAT interface is broken, give the user the option to ignore it to let a native driver bind to the watchdog device instead.

Cc Guenter Roeck <[email protected]>
Cc Mika Westerberg <[email protected]>

Thanks!

#7 lore raw
Quoted 19 lines · Rafael J. Wysocki
Quoted 16 lines · Mika Westerberg
Quoted 14 lines · Jean Delvare

Hi Mika,

Quoted 10 lines · Mika Westerberg
Quoted 6 lines · Guenter Roeck
Quoted 3 lines · Mika Westerberg

You should be able to revert to iTCO_wdt by simply disabling CONFIG_WDAT_WDT from .config. Then acpi_has_watchdog() returns false which means that iTCO_wdt is used instead.

That may not be possible in a generic distribution.

Right, they would need to build their own kernel. Currently there is no way to do that without changing .config.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

OK, that's pretty much what I was compl^Wworried about ;-) Would you consider applying something like the following patch?

Yes, I think the patch makes sense.

Rafael, I guess you will take this since it is touching ACPI?

Yes, I will.

So queued up now (with very minor changes in the subject and changelog), but I will rebase it on top of -rc1 when it is out.

#8 lore raw
Quoted 2 lines · Rafael J. Wysocki

So queued up now (with very minor changes in the subject and changelog), but I will rebase it on top of -rc1 when it is out.

Thanks!