Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors
@ 2019-04-29 19:28 Guenter Roeck
  2019-04-29 19:28 ` [PATCH 2/5] watchdog: Move pretimeout governor configuration up Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Guenter Roeck @ 2019-04-29 19:28 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Paul Gortmaker, linux-watchdog, linux-kernel, Guenter Roeck

Watchdog pretimeout governors were enabled from the default governor
selection using "select". As a result, the default governor was always
built into the kernel, even if no watchdog driver was loaded. By using
"depends on" instead of "select", we are in better control, and the
governors can all be built as modules. At the same time, set the default
configuration option for pretimeout governors to match WATCHDOG_CORE
(meaning all pretimeout governors are by default enabled if pretimeout
support is enabled).

The practical impact of this change is minimal. Previously, selecting
a default governor automatically enabled that governor. Now, a default
governor can only be selected if that governor has been enabled.
Consequently, the order of governor selection is now reversed: The
governor selection is now first, followed by default governor selection.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 16c30e6aa1ee..accbf75032ef 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -2062,6 +2062,20 @@ config WATCHDOG_PRETIMEOUT_GOV
 
 if WATCHDOG_PRETIMEOUT_GOV
 
+config WATCHDOG_PRETIMEOUT_GOV_NOOP
+	tristate "Noop watchdog pretimeout governor"
+	default WATCHDOG_CORE
+	help
+	  Noop watchdog pretimeout governor, only an informational
+	  message is added to kernel log buffer.
+
+config WATCHDOG_PRETIMEOUT_GOV_PANIC
+	tristate "Panic watchdog pretimeout governor"
+	default WATCHDOG_CORE
+	help
+	  Panic watchdog pretimeout governor, on watchdog pretimeout
+	  event put the kernel into panic.
+
 choice
 	prompt "Default Watchdog Pretimeout Governor"
 	default WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
@@ -2072,7 +2086,7 @@ choice
 
 config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
 	bool "noop"
-	select WATCHDOG_PRETIMEOUT_GOV_NOOP
+	depends on WATCHDOG_PRETIMEOUT_GOV_NOOP
 	help
 	  Use noop watchdog pretimeout governor by default. If noop
 	  governor is selected by a user, write a short message to
@@ -2080,7 +2094,7 @@ config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
 
 config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
 	bool "panic"
-	select WATCHDOG_PRETIMEOUT_GOV_PANIC
+	depends on WATCHDOG_PRETIMEOUT_GOV_PANIC
 	help
 	  Use panic watchdog pretimeout governor by default, if
 	  a watchdog pretimeout event happens, consider that
@@ -2088,18 +2102,6 @@ config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
 
 endchoice
 
-config WATCHDOG_PRETIMEOUT_GOV_NOOP
-	tristate "Noop watchdog pretimeout governor"
-	help
-	  Noop watchdog pretimeout governor, only an informational
-	  message is added to kernel log buffer.
-
-config WATCHDOG_PRETIMEOUT_GOV_PANIC
-	tristate "Panic watchdog pretimeout governor"
-	help
-	  Panic watchdog pretimeout governor, on watchdog pretimeout
-	  event put the kernel into panic.
-
 endif # WATCHDOG_PRETIMEOUT_GOV
 
 endif # WATCHDOG
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/5] watchdog: Move pretimeout governor configuration up
  2019-04-29 19:28 [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors Guenter Roeck
@ 2019-04-29 19:28 ` Guenter Roeck
  2019-04-29 19:28 ` [PATCH 3/5] watchdog: Make watchdog core configurable as module Guenter Roeck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2019-04-29 19:28 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Paul Gortmaker, linux-watchdog, linux-kernel, Guenter Roeck

Watchdog pretimeout configuration was at the end of the Kconfig
file, after individual watchdog drivers, and thus easy to miss.
Move it right after basic watchdog option declarations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 104 +++++++++++++++++++++++------------------------
 1 file changed, 52 insertions(+), 52 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index accbf75032ef..ac37a14439c7 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -63,6 +63,58 @@ config WATCHDOG_SYSFS
 	  Say Y here if you want to enable watchdog device status read through
 	  sysfs attributes.
 
+comment "Watchdog Pretimeout Governors"
+
+config WATCHDOG_PRETIMEOUT_GOV
+	bool "Enable watchdog pretimeout governors"
+	depends on WATCHDOG_CORE
+	help
+	  The option allows to select watchdog pretimeout governors.
+
+if WATCHDOG_PRETIMEOUT_GOV
+
+config WATCHDOG_PRETIMEOUT_GOV_NOOP
+	tristate "Noop watchdog pretimeout governor"
+	default WATCHDOG_CORE
+	help
+	  Noop watchdog pretimeout governor, only an informational
+	  message is added to kernel log buffer.
+
+config WATCHDOG_PRETIMEOUT_GOV_PANIC
+	tristate "Panic watchdog pretimeout governor"
+	default WATCHDOG_CORE
+	help
+	  Panic watchdog pretimeout governor, on watchdog pretimeout
+	  event put the kernel into panic.
+
+choice
+	prompt "Default Watchdog Pretimeout Governor"
+	default WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
+	help
+	  This option selects a default watchdog pretimeout governor.
+	  The governor takes its action, if a watchdog is capable
+	  to report a pretimeout event.
+
+config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
+	bool "noop"
+	depends on WATCHDOG_PRETIMEOUT_GOV_NOOP
+	help
+	  Use noop watchdog pretimeout governor by default. If noop
+	  governor is selected by a user, write a short message to
+	  the kernel log buffer and don't do any system changes.
+
+config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
+	bool "panic"
+	depends on WATCHDOG_PRETIMEOUT_GOV_PANIC
+	help
+	  Use panic watchdog pretimeout governor by default, if
+	  a watchdog pretimeout event happens, consider that
+	  a watchdog feeder is dead and reboot is unavoidable.
+
+endchoice
+
+endif # WATCHDOG_PRETIMEOUT_GOV
+
 #
 # General Watchdog drivers
 #
@@ -2052,56 +2104,4 @@ config USBPCWATCHDOG
 
 	  Most people will say N.
 
-comment "Watchdog Pretimeout Governors"
-
-config WATCHDOG_PRETIMEOUT_GOV
-	bool "Enable watchdog pretimeout governors"
-	depends on WATCHDOG_CORE
-	help
-	  The option allows to select watchdog pretimeout governors.
-
-if WATCHDOG_PRETIMEOUT_GOV
-
-config WATCHDOG_PRETIMEOUT_GOV_NOOP
-	tristate "Noop watchdog pretimeout governor"
-	default WATCHDOG_CORE
-	help
-	  Noop watchdog pretimeout governor, only an informational
-	  message is added to kernel log buffer.
-
-config WATCHDOG_PRETIMEOUT_GOV_PANIC
-	tristate "Panic watchdog pretimeout governor"
-	default WATCHDOG_CORE
-	help
-	  Panic watchdog pretimeout governor, on watchdog pretimeout
-	  event put the kernel into panic.
-
-choice
-	prompt "Default Watchdog Pretimeout Governor"
-	default WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
-	help
-	  This option selects a default watchdog pretimeout governor.
-	  The governor takes its action, if a watchdog is capable
-	  to report a pretimeout event.
-
-config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_NOOP
-	bool "noop"
-	depends on WATCHDOG_PRETIMEOUT_GOV_NOOP
-	help
-	  Use noop watchdog pretimeout governor by default. If noop
-	  governor is selected by a user, write a short message to
-	  the kernel log buffer and don't do any system changes.
-
-config WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC
-	bool "panic"
-	depends on WATCHDOG_PRETIMEOUT_GOV_PANIC
-	help
-	  Use panic watchdog pretimeout governor by default, if
-	  a watchdog pretimeout event happens, consider that
-	  a watchdog feeder is dead and reboot is unavoidable.
-
-endchoice
-
-endif # WATCHDOG_PRETIMEOUT_GOV
-
 endif # WATCHDOG
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/5] watchdog: Make watchdog core configurable as module
  2019-04-29 19:28 [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors Guenter Roeck
  2019-04-29 19:28 ` [PATCH 2/5] watchdog: Move pretimeout governor configuration up Guenter Roeck
@ 2019-04-29 19:28 ` Guenter Roeck
  2019-04-29 19:28 ` [PATCH 4/5] watchdog: npcm: Enable modular builds Guenter Roeck
  2019-04-29 19:28 ` [PATCH 5/5] watchdog: Improve Kconfig entry ordering and dependencies Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2019-04-29 19:28 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Paul Gortmaker, linux-watchdog, linux-kernel, Guenter Roeck

Under some circumstances it may be desirable to configure
the watchdog core as module. Enable it.

As part of this change, mark pretimeout governors as depending
on the watchdog core. This is necessary to prevent governors
from being built into the kernel if the watchdog core is built
as module.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ac37a14439c7..c2d6934508ee 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -30,7 +30,7 @@ menuconfig WATCHDOG
 if WATCHDOG
 
 config WATCHDOG_CORE
-	bool "WatchDog Timer Driver Core"
+	tristate "WatchDog Timer Driver Core"
 	---help---
 	  Say Y here if you want to use the new watchdog timer driver core.
 	  This driver provides a framework for all watchdog timer drivers
@@ -75,6 +75,7 @@ if WATCHDOG_PRETIMEOUT_GOV
 
 config WATCHDOG_PRETIMEOUT_GOV_NOOP
 	tristate "Noop watchdog pretimeout governor"
+	depends on WATCHDOG_CORE
 	default WATCHDOG_CORE
 	help
 	  Noop watchdog pretimeout governor, only an informational
@@ -82,6 +83,7 @@ config WATCHDOG_PRETIMEOUT_GOV_NOOP
 
 config WATCHDOG_PRETIMEOUT_GOV_PANIC
 	tristate "Panic watchdog pretimeout governor"
+	depends on WATCHDOG_CORE
 	default WATCHDOG_CORE
 	help
 	  Panic watchdog pretimeout governor, on watchdog pretimeout
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/5] watchdog: npcm: Enable modular builds
  2019-04-29 19:28 [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors Guenter Roeck
  2019-04-29 19:28 ` [PATCH 2/5] watchdog: Move pretimeout governor configuration up Guenter Roeck
  2019-04-29 19:28 ` [PATCH 3/5] watchdog: Make watchdog core configurable as module Guenter Roeck
@ 2019-04-29 19:28 ` Guenter Roeck
  2019-04-29 19:28 ` [PATCH 5/5] watchdog: Improve Kconfig entry ordering and dependencies Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2019-04-29 19:28 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Paul Gortmaker, linux-watchdog, linux-kernel, Guenter Roeck

Most of the NPCM7XX drivers can be built as modules.
The NPCM7XX watchdog driver code supports building it as
module, but its configuration option is set to bool.
Make itr tristate to actually support modular builds.
This improves consistency with other drivers for the
same platform and enables including the driver in multi-
platform configurations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c2d6934508ee..e5b30c4947d7 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -618,7 +618,7 @@ config COH901327_WATCHDOG
 	  compiled as a module.
 
 config NPCM7XX_WATCHDOG
-	bool "Nuvoton NPCM750 watchdog"
+	tristate "Nuvoton NPCM750 watchdog"
 	depends on ARCH_NPCM || COMPILE_TEST
 	default y if ARCH_NPCM7XX
 	select WATCHDOG_CORE
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 5/5] watchdog: Improve Kconfig entry ordering and dependencies
  2019-04-29 19:28 [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors Guenter Roeck
                   ` (2 preceding siblings ...)
  2019-04-29 19:28 ` [PATCH 4/5] watchdog: npcm: Enable modular builds Guenter Roeck
@ 2019-04-29 19:28 ` Guenter Roeck
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2019-04-29 19:28 UTC (permalink / raw)
  To: Wim Van Sebroeck
  Cc: Paul Gortmaker, linux-watchdog, linux-kernel, Guenter Roeck

HPWDT_NMI_DECODING depends on HP_WATCHDOG and should be next to it.
This helps menuconfig identify HPWDT_NMI_DECODING as depending on
HP_WATCHDOG.

BCM_KONA_WDT_DEBUG depends on BCM_KONA_WDT which depends on COMPILE_TEST.
Enabling BCM_KONA_WDT_DEBUG without BCM_KONA_WDT does not make sense,
so drop the COMPILE_TEST dependency from it. This also improves
menuconfig, which now properly associates BCM_KONA_WDT_DEBUG with
BCM_KONA_WDT.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/Kconfig | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index e5b30c4947d7..f457992487ea 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1261,6 +1261,15 @@ config HP_WATCHDOG
 	  To compile this driver as a module, choose M here: the module will be
 	  called hpwdt.
 
+config HPWDT_NMI_DECODING
+	bool "NMI support for the HP ProLiant iLO2+ Hardware Watchdog Timer"
+	depends on HP_WATCHDOG
+	default y
+	help
+	  Enables the NMI handler for the watchdog pretimeout NMI and the iLO
+	  "Generate NMI to System" virtual button.  When an NMI is claimed
+	  by the driver, panic is called.
+
 config KEMPLD_WDT
 	tristate "Kontron COM Watchdog Timer"
 	depends on MFD_KEMPLD
@@ -1272,15 +1281,6 @@ config KEMPLD_WDT
 	  This driver can also be built as a module. If so, the module will be
 	  called kempld_wdt.
 
-config HPWDT_NMI_DECODING
-	bool "NMI support for the HP ProLiant iLO2+ Hardware Watchdog Timer"
-	depends on HP_WATCHDOG
-	default y
-	help
-	  Enables the NMI handler for the watchdog pretimeout NMI and the iLO
-	  "Generate NMI to System" virtual button.  When an NMI is claimed
-	  by the driver, panic is called.
-
 config SC1200_WDT
 	tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog"
 	depends on X86
@@ -1729,7 +1729,7 @@ config BCM_KONA_WDT
 
 config BCM_KONA_WDT_DEBUG
 	bool "DEBUGFS support for BCM Kona Watchdog"
-	depends on BCM_KONA_WDT || COMPILE_TEST
+	depends on BCM_KONA_WDT
 	help
 	  If enabled, adds /sys/kernel/debug/bcm_kona_wdt/info which provides
 	  access to the driver's internal data structures as well as watchdog
-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 19:28 [PATCH 1/5] watchdog: Use depends instead of select for pretimeout governors Guenter Roeck
2019-04-29 19:28 ` [PATCH 2/5] watchdog: Move pretimeout governor configuration up Guenter Roeck
2019-04-29 19:28 ` [PATCH 3/5] watchdog: Make watchdog core configurable as module Guenter Roeck
2019-04-29 19:28 ` [PATCH 4/5] watchdog: npcm: Enable modular builds Guenter Roeck
2019-04-29 19:28 ` [PATCH 5/5] watchdog: Improve Kconfig entry ordering and dependencies Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox