Skip to contentSkip to conversation

Watchdog: introduce ARM SBSA watchdog driver

PATCH In review [email protected] 4 participants 11 messages Feb 29, 2016 – Mar 28, 2016

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

v14 cover Watchdog: introduce ARM SBSA watchdog driver

From: Fu Wei <[email protected]>

This patchset:
(1)Introduce Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt for FDT info of SBSA Generic Watchdog, and give two examples of adding SBSA Generic Watchdog device node into the dts files:
foundation-v8.dts and amd-seattle-soc.dtsi.

(2)Introduce ARM SBSA watchdog driver:
a.Use linux kernel watchdog framework;
b.Work with FDT on ARM64;
c.Support getting timeout from parameter and FDT at the driver
init stage.
d.The driver works in two modes:
(1) single stage timeout (ignore WS0 interrupt)
(2) two stages timeout (register WS0 interrupt, do panic in routine)
e.User can config working mode by module parameter "action".

This patchset has been tested with watchdog daemon (ACPI/FDT, module/build-in) on the following platforms:
(1)ARM Foundation v8 model
(2)AMD Seattle platform

This patchset has been tested with kdump successfully.

Changelog:
v14:Fix a bug of registering interrupt routine: do a ping before
registering interrupt routine, in case where is a pending interrupt. Reorder the initialization code to postpone registering interrupt routine. Improve some code style:
(1)add some macro of string
(2)use watchdog_get_drvdata instead of to_sbsa_gwdt,
delete to_sbsa_gwdt.

v13:https://lkml.org/lkml/2016/2/16/713
Fix a dev_warn message typo"signle"-->"single" Add MODULE_ALIAS
Add more *ed-by in commit message.

v12:https://lkml.org/lkml/2016/2/16/154
Fix a dev_warn message typo"fall"--"falling"
Remove unnecessary "status" in dts
Add more *ed-by in commit message.

v11:https://lkml.org/lkml/2016/2/9/577
Merge patch 4 and 5.
Improve some comments.
The driver works in two modes, it's configured by "action"(instead of panic_enabled).
Improve the initialization of the timeout limits.
Feeding dog by writing "0" to WRR.

v10:https://lkml.org/lkml/2016/2/3/817
Delete pretimeout support.
Separate the driver to two parts:
(1) single stage timeout driver(ignore WS0 interrupt);
(2) register WS0 interrupt for the half timeout panic.
timeout == (enable --> WS1).

v9: https://lkml.org/lkml/2015/11/9/57
Rebase to latest kernel version(4.3).
Update the Documentation of sbsa-gwdt device node info of FDT:
(1) move some introduction to pretimeout patch
(2) delete WS1 value from "interrupts" of binding documentation, since WS1 won't be handled by Linux.

v8: https://lkml.org/lkml/2015/10/27/466
Rebase to latest kernel version(4.3-rc7).
Separate the patches of GTDT support and arm_arch_timer. This clocksource relevant patch will upstreamed in a individual patchset. Update all the default timeout and pretimeout to 30s and 60s. Improve documentation and inline comments.
Fix a bug in pretimeout support which makes timeout and pretimeout parameters initialization fail.

v7: https://lkml.org/lkml/2015/8/24/611
Rebase to latest kernel version(4.2-rc7).
Improve FDT support: geting resource by order, instead of name. According to the FDT support, Update the example dts file, gtdt.c and sbsa_gwdt.c.
Pass the sparse test, and fix the warning.
Fix the max_pretimeout and max_timeout value overflow bug. Delete the WCV output value.

v6: https://lkml.org/lkml/2015/6/23/359
Improve the dtb example files: reduce the register frame size to 4K. Improve pretimeout support:
(1) improve watchdog_init_timeouts function
(2) rename watchdog_check_min_max_timeouts back to the original name
(1) improve watchdog_timeout_invalid/watchdog_pretimeout_invalid
Add the new features in the sbsa_gwdt driver:
(1) In the second stage, user can feed the dog without cleaning WS0.
(2) In the second stage, user can trigger WS1 by setting pretimeout = 0.
(3) expand the max value of pretimeout, in case 10 second is not enough for a kdump kernel reboot in panic.

v5: https://lkml.org/lkml/2015/6/10/357
Improve pretimeout support:
(1)fix typo in documentation and comments.
(2)fix the timeout limits validation bug.
Simplify sbsa_gwdt driver:
(1)integrate all the registers access functions into caller.

v4: https://lkml.org/lkml/2015/6/2/4

    Refactor GTDT support code: remove it from arch/arm64/kernel/acpi.c,
    put it into drivers/acpi/gtdt.c file.
    Integrate the GTDT code of drivers/clocksource/arm_arch_timer.c into
    drivers/acpi/gtdt.c.
    Improve pretimeout support, fix "pretimeout == 0" problem.
    Simplify sbsa_gwdt driver:
        (1)timeout/pretimeout limits setup;
        (2)keepalive function;
        (3)delete "clk == 0" check;
        (4)delete WS0 status bit check in interrupt routine;
        (5)sbsa_gwdt_set_wcv function.

v3: https://lkml.org/lkml/2015/5/25/111
Delete "export arch_timer_get_rate" patch.
Driver back to use arch_timer_get_cntfrq.
Improve watchdog_init_timeouts function and update relevant documentation. Improve watchdog_timeout_invalid and watchdog_pretimeout_invalid. Improve foundation-v8.dts: delete the unnecessary tag of device node. Remove "ARM64 || COMPILE_TEST" from Kconfig.
Add comments in arch/arm64/kernel/acpi.c
Fix typoes and incorrect comments.

v2: https://lkml.org/lkml/2015/5/21/172
Improve watchdog-kernel-api.txt documentation for pretimeout support. Export "arch_timer_get_rate" in arm_arch_timer.c.
Add watchdog_init_timeouts API for pretimeout support in framework. Improve suspend and resume foundation in driver
Improve timeout/pretimeout values init code in driver. Delete unnecessary items of the sbsa_gwdt struct and #define. Delete all unnecessary debug info in driver.
Fix 64bit division bug.
Use the arch_timer interface to get watchdog clock rate. Add MODULE_DEVICE_TABLE for platform device id.
Fix typoes.

v1: https://lkml.org/lkml/2015/5/15/279
The first version upstream patchset to linux mailing list.

Fu Wei (4):
Documentation: add sbsa-gwdt driver documentation
ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts
ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi
Watchdog: introduce ARM SBSA watchdog driver

 .../devicetree/bindings/watchdog/sbsa-gwdt.txt     |  31 ++
 Documentation/watchdog/watchdog-parameters.txt     |   7 +
 arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi       |   8 +
 arch/arm64/boot/dts/arm/foundation-v8.dts          |   7 +
 drivers/watchdog/Kconfig                           |  20 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/sbsa_gwdt.c                       | 408 +++++++++++++++++++++
 7 files changed, 482 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
 create mode 100644 drivers/watchdog/sbsa_gwdt.c
Signature · 1 line
2.5.0
#1 lore raw

PATCH v14 1/4 Documentation: add sbsa-gwdt driver documentation

From: Fu Wei <[email protected]>

The sbsa-gwdt.txt documentation in devicetree/bindings/watchdog is for introducing SBSA(Server Base System Architecture) Generic Watchdog device node info into FDT.

Also add sbsa-gwdt introduction in watchdog-parameters.txt

---
 .../devicetree/bindings/watchdog/sbsa-gwdt.txt     | 31 ++++++++++++++++++++++
 Documentation/watchdog/watchdog-parameters.txt     |  7 +++++
 2 files changed, 38 insertions(+)
Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt new file +31 -0
new file mode 100644
index 0000000..6f2d5f9
@@ -0,0 +1,31 @@
+* SBSA (Server Base System Architecture) Generic Watchdog
+
+The SBSA Generic Watchdog Timer is used to force a reset of the system
+after two stages of timeout have elapsed.  A detailed definition of the
+watchdog timer can be found in the ARM document: ARM-DEN-0029 - Server
+Base System Architecture (SBSA)
+
+Required properties:
+- compatible: Should at least contain "arm,sbsa-gwdt".
+
+- reg: Each entry specifies the base physical address of a register frame
+  and the length of that frame; currently, two frames must be defined,
+  in this order:
+  1: Watchdog control frame;
+  2: Refresh frame.
+
+- interrupts: Should contain the Watchdog Signal 0 (WS0) SPI (Shared
+  Peripheral Interrupt) number of SBSA Generic Watchdog.
+
+Optional properties
+- timeout-sec: Watchdog timeout values (in seconds).
+
+Example for FVP Foundation Model v8:
+
+watchdog at 2a440000 {
+	compatible = "arm,sbsa-gwdt";
+	reg = <0x0 0x2a440000 0 0x1000>,
+	      <0x0 0x2a450000 0 0x1000>;
+	interrupts = <0 27 4>;
+	timeout-sec = <30>;
+};
Documentation/watchdog/watchdog-parameters.txt +7 -0
index 9f9ec9f..ce7ae4e 100644
@@ -284,6 +284,13 @@ sbc_fitpc2_wdt:
 margin: Watchdog margin in seconds (default 60s)
 nowayout: Watchdog cannot be stopped once started
 -------------------------------------------------
+sbsa_gwdt:
+timeout: Watchdog timeout in seconds. (default 10s)
+action: Watchdog action at the first stage timeout,
+	set to 0 to ignore, 1 to panic. (default=0)
+nowayout: Watchdog cannot be stopped once started
+	(default=kernel config parameter)
+-------------------------------------------------
 sc1200wdt:
 isapnp: When set to 0 driver ISA PnP support will be disabled (default=1)
 io: io port
Signature · 1 line
2.5.0
#2 lore raw

PATCH v14 2/4 ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts

In reply to [email protected]

From: Fu Wei <[email protected]>

This can be a example of adding SBSA Generic Watchdog device node into some dts files for the Soc which contains SBSA Generic Watchdog.

---
 arch/arm64/boot/dts/arm/foundation-v8.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/arm/foundation-v8.dts +7 -0
index 4eac8dc..66cb9aa 100644
@@ -237,4 +237,11 @@
 			};
 		};
 	};
+	watchdog at 2a440000 {
+		compatible = "arm,sbsa-gwdt";
+		reg = <0x0 0x2a440000 0 0x1000>,
+			<0x0 0x2a450000 0 0x1000>;
+		interrupts = <0 27 4>;
+		timeout-sec = <30>;
+	};
 };
Signature · 1 line
2.5.0
#3 lore raw

PATCH v14 3/4 ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi

In reply to [email protected]

From: Fu Wei <[email protected]>

This can be a example of adding SBSA Generic Watchdog device node into some dts files for the Soc which contains SBSA Generic Watchdog.

---
 arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi +8 -0
index 2874d92..0a8ca1d 100644
@@ -84,6 +84,14 @@
 			clock-names = "uartclk", "apb_pclk";
 		};
 
+		watchdog0: watchdog at e0bb0000 {
+			compatible = "arm,sbsa-gwdt";
+			reg = <0x0 0xe0bc0000 0 0x1000>,
+				<0x0 0xe0bb0000 0 0x1000>;
+			interrupts = <0 337 4>;
+			timeout-sec = <15>;
+		};
+
 		spi0: ssp at e1020000 {
 			status = "disabled";
 			compatible = "arm,pl022", "arm,primecell";
Signature · 1 line
2.5.0
author
#4 lore raw

Re: [PATCH v14 3/4] ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi

Hi Wim, Guenter:

Great thanks for reviewing and applying this patchset :-) Now I can see almost all the patches of this patchset have been merged into the master branch of mainline kernel.
But only this one is still out of any branch or repo. It seems that it's applied on linux-watchdog for a while, then disappeared.

So any thing I can do for this patch? Do I need to resubmit it? Maybe I miss it in some repo? Could you help me ? Great thanks ! :-)

Quoted 35 lines · On 29 February 2016 at 16:46, <[email protected]> wrote:

From: Fu Wei <[email protected]>

This can be a example of adding SBSA Generic Watchdog device node into some dts files for the Soc which contains SBSA Generic Watchdog.

---
 arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi +8 -1
index 2874d92..0a8ca1d 100644
@@ -84,6 +84,14 @@
                        clock-names = "uartclk", "apb_pclk";
                };
 
+               watchdog0: watchdog at e0bb0000 {
+                       compatible = "arm,sbsa-gwdt";
+                       reg = <0x0 0xe0bc0000 0 0x1000>,
+                               <0x0 0xe0bb0000 0 0x1000>;
+                       interrupts = <0 337 4>;
+                       timeout-sec = <15>;
+               };
+
                spi0: ssp at e1020000 {
                        status = "disabled";
                        compatible = "arm,pl022", "arm,primecell";
--

2.5.0

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
maintainer
#5 lore raw

Re: [PATCH v14 3/4] ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi

Quoted 9 lines · Fu Wei

Hi Wim, Guenter:

Great thanks for reviewing and applying this patchset :-) Now I can see almost all the patches of this patchset have been merged into the master branch of mainline kernel.
But only this one is still out of any branch or repo. It seems that it's applied on linux-watchdog for a while, then disappeared.

Quoted 4 lines

So any thing I can do for this patch? Do I need to resubmit it? Maybe I miss it in some repo? Could you help me ? Great thanks ! :-)

If I recall correctly, it was supposed to go in through some other tree (arm-soc ?)

Guenter

Quoted 39 lines · On 29 February 2016 at 16:46, <[email protected]> wrote:
Quoted 35 lines

From: Fu Wei <[email protected]>

This can be a example of adding SBSA Generic Watchdog device node into some dts files for the Soc which contains SBSA Generic Watchdog.

---
  arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 8 ++++++++
  1 file changed, 8 insertions(+)
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi +8 -1
index 2874d92..0a8ca1d 100644
@@ -84,6 +84,14 @@
                         clock-names = "uartclk", "apb_pclk";
                 };
 
+               watchdog0: watchdog at e0bb0000 {
+                       compatible = "arm,sbsa-gwdt";
+                       reg = <0x0 0xe0bc0000 0 0x1000>,
+                               <0x0 0xe0bb0000 0 0x1000>;
+                       interrupts = <0 337 4>;
+                       timeout-sec = <15>;
+               };
+
                 spi0: ssp at e1020000 {
                         status = "disabled";
                         compatible = "arm,pl022", "arm,primecell";
--

2.5.0

#6 lore raw

Re: [PATCH v14 3/4] ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi

Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Fu Wei

Hi Wim, Guenter:

Great thanks for reviewing and applying this patchset :-) Now I can see almost all the patches of this patchset have been merged into the master branch of mainline kernel.
But only this one is still out of any branch or repo. It seems that it's applied on linux-watchdog for a while, then disappeared.

Quoted 6 lines
Quoted 4 lines

So any thing I can do for this patch? Do I need to resubmit it? Maybe I miss it in some repo? Could you help me ? Great thanks ! :-)

If I recall correctly, it was supposed to go in through some other tree (arm-soc ?)

Yes, it should have gone through arm-soc tree. But, it seems it got missed. The other dt patch for foundation-v8 is there in v4.6 pull request
[https://lkml.org/lkml/2016/3/20/244].

~Pratyush

author
#7 lore raw

Re: [PATCH v14 3/4] ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi

Hi Pratyush, Guenter,

Quoted 16 lines · Pratyush Anand
Quoted 15 lines · Guenter Roeck
Quoted 13 lines · Fu Wei

Hi Wim, Guenter:

Great thanks for reviewing and applying this patchset :-) Now I can see almost all the patches of this patchset have been merged into the master branch of mainline kernel.
But only this one is still out of any branch or repo. It seems that it's applied on linux-watchdog for a while, then disappeared.

So any thing I can do for this patch? Do I need to resubmit it? Maybe I miss it in some repo? Could you help me ? Great thanks ! :-)

Quoted 5 lines
Quoted 1 line

If I recall correctly, it was supposed to go in through some other tree (arm-soc ?)

Yes, it should have gone through arm-soc tree. But, it seems it got missed. The other dt patch for foundation-v8 is there in v4.6 pull request
[https://lkml.org/lkml/2016/3/20/244].

Yes, I thought it should be in arm-soc, but I have checked several branches in arm-soc repo, I can't find this patch.
So can someone help to apply it. I have applied it on the master branch of latest mainline kernel locally, I don't see any conflict.

Great thanks :-)

Quoted 2 lines

~Pratyush

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021
#8 lore raw

PATCH v14 4/4 Watchdog: introduce ARM SBSA watchdog driver

In reply to [email protected]

From: Fu Wei <[email protected]>

According to Server Base System Architecture (SBSA) specification, the SBSA Generic Watchdog has two stage timeouts: the first signal (WS0) is for alerting the system by interrupt, the second one (WS1) is a real hardware reset.
More details about the hardware specification of this device:
ARM DEN0029B - Server Base System Architecture (SBSA)

This driver can operate ARM SBSA Generic Watchdog as a single stage watchdog or a two stages watchdog, it's set up by the module parameter "action". In the single stage mode, when the timeout is reached, your system will be reset by WS1. The first signal (WS0) is ignored.
In the two stages mode, when the timeout is reached, the first signal (WS0) will trigger panic. If the system is getting into trouble and cannot be reset by panic or restart properly by the kdump kernel(if supported), then the second stage (as long as the first stage) will be reached, system will be reset by WS1. This function can help administrator to backup the system context info by panic console output or kdump.

This driver bases on linux kernel watchdog framework, so it can get timeout from module parameter and FDT at the driver init stage.

---
 drivers/watchdog/Kconfig     |  20 +++
 drivers/watchdog/Makefile    |   1 +
 drivers/watchdog/sbsa_gwdt.c | 408 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 429 insertions(+)
drivers/watchdog/Kconfig +20 -0
index 0f6d851..38a7f5c 100644
@@ -202,6 +202,26 @@ config ARM_SP805_WATCHDOG
 	  ARM Primecell SP805 Watchdog timer. This will reboot your system when
 	  the timeout is reached.
 
+config ARM_SBSA_WATCHDOG
+	tristate "ARM SBSA Generic Watchdog"
+	depends on ARM64
+	depends on ARM_ARCH_TIMER
+	select WATCHDOG_CORE
+	help
+	  ARM SBSA Generic Watchdog has two stage timeouts:
+	  the first signal (WS0) is for alerting the system by interrupt,
+	  the second one (WS1) is a real hardware reset.
+	  More details: ARM DEN0029B - Server Base System Architecture (SBSA)
+
+	  This driver can operate ARM SBSA Generic Watchdog as a single stage
+	  or a two stages watchdog, it depends on the module parameter "action".
+
+	  Note: the maximum timeout in the two stages mode is half of that in
+	  the single stage mode.
+
+	  To compile this driver as module, choose M here: The module
+	  will be called sbsa_gwdt.
+
 config ASM9260_WATCHDOG
 	tristate "Alphascale ASM9260 watchdog"
 	depends on MACH_ASM9260
drivers/watchdog/Makefile +1 -0
index f566753..f9826d4 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
 
 # ARM Architecture
 obj-$(CONFIG_ARM_SP805_WATCHDOG) += sp805_wdt.o
+obj-$(CONFIG_ARM_SBSA_WATCHDOG) += sbsa_gwdt.o
 obj-$(CONFIG_ASM9260_WATCHDOG) += asm9260_wdt.o
 obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o
 obj-$(CONFIG_AT91SAM9X_WATCHDOG) += at91sam9_wdt.o
drivers/watchdog/sbsa_gwdt.c new file +408 -0

408 lines not on this page · raw message

Signature · 1 line
2.5.0
#9 lore raw
In reply to [email protected]

Hi Fu,

Quoted 149 lines

From: Fu Wei <[email protected]>

This patchset:
(1)Introduce Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt for FDT info of SBSA Generic Watchdog, and give two examples of adding SBSA Generic Watchdog device node into the dts files:
foundation-v8.dts and amd-seattle-soc.dtsi.

(2)Introduce ARM SBSA watchdog driver:
a.Use linux kernel watchdog framework;
b.Work with FDT on ARM64;
c.Support getting timeout from parameter and FDT at the driver
init stage.
d.The driver works in two modes:
(1) single stage timeout (ignore WS0 interrupt)
(2) two stages timeout (register WS0 interrupt, do panic in routine)
e.User can config working mode by module parameter "action".

This patchset has been tested with watchdog daemon (ACPI/FDT, module/build-in) on the following platforms:
(1)ARM Foundation v8 model
(2)AMD Seattle platform

This patchset has been tested with kdump successfully.

Changelog:
v14:Fix a bug of registering interrupt routine: do a ping before
registering interrupt routine, in case where is a pending interrupt. Reorder the initialization code to postpone registering interrupt routine. Improve some code style:
(1)add some macro of string
(2)use watchdog_get_drvdata instead of to_sbsa_gwdt,
delete to_sbsa_gwdt.

v13:https://lkml.org/lkml/2016/2/16/713
Fix a dev_warn message typo"signle"-->"single" Add MODULE_ALIAS
Add more *ed-by in commit message.

v12:https://lkml.org/lkml/2016/2/16/154
Fix a dev_warn message typo"fall"--"falling"
Remove unnecessary "status" in dts
Add more *ed-by in commit message.

v11:https://lkml.org/lkml/2016/2/9/577
Merge patch 4 and 5.
Improve some comments.
The driver works in two modes, it's configured by "action"(instead of panic_enabled).
Improve the initialization of the timeout limits.
Feeding dog by writing "0" to WRR.

v10:https://lkml.org/lkml/2016/2/3/817
Delete pretimeout support.
Separate the driver to two parts:
(1) single stage timeout driver(ignore WS0 interrupt);
(2) register WS0 interrupt for the half timeout panic.
timeout == (enable --> WS1).

v9: https://lkml.org/lkml/2015/11/9/57
Rebase to latest kernel version(4.3).
Update the Documentation of sbsa-gwdt device node info of FDT:
(1) move some introduction to pretimeout patch
(2) delete WS1 value from "interrupts" of binding documentation, since WS1 won't be handled by Linux.

v8: https://lkml.org/lkml/2015/10/27/466
Rebase to latest kernel version(4.3-rc7).
Separate the patches of GTDT support and arm_arch_timer. This clocksource relevant patch will upstreamed in a individual patchset. Update all the default timeout and pretimeout to 30s and 60s. Improve documentation and inline comments.
Fix a bug in pretimeout support which makes timeout and pretimeout parameters initialization fail.

v7: https://lkml.org/lkml/2015/8/24/611
Rebase to latest kernel version(4.2-rc7).
Improve FDT support: geting resource by order, instead of name. According to the FDT support, Update the example dts file, gtdt.c and sbsa_gwdt.c.
Pass the sparse test, and fix the warning.
Fix the max_pretimeout and max_timeout value overflow bug. Delete the WCV output value.

v6: https://lkml.org/lkml/2015/6/23/359
Improve the dtb example files: reduce the register frame size to 4K. Improve pretimeout support:
(1) improve watchdog_init_timeouts function
(2) rename watchdog_check_min_max_timeouts back to the original name
(1) improve watchdog_timeout_invalid/watchdog_pretimeout_invalid
Add the new features in the sbsa_gwdt driver:
(1) In the second stage, user can feed the dog without cleaning WS0.
(2) In the second stage, user can trigger WS1 by setting pretimeout = 0.
(3) expand the max value of pretimeout, in case 10 second is not enough for a kdump kernel reboot in panic.

v5: https://lkml.org/lkml/2015/6/10/357
Improve pretimeout support:
(1)fix typo in documentation and comments.
(2)fix the timeout limits validation bug.
Simplify sbsa_gwdt driver:
(1)integrate all the registers access functions into caller.

v4: https://lkml.org/lkml/2015/6/2/4

    Refactor GTDT support code: remove it from arch/arm64/kernel/acpi.c,
    put it into drivers/acpi/gtdt.c file.
    Integrate the GTDT code of drivers/clocksource/arm_arch_timer.c into
    drivers/acpi/gtdt.c.
    Improve pretimeout support, fix "pretimeout == 0" problem.
    Simplify sbsa_gwdt driver:
        (1)timeout/pretimeout limits setup;
        (2)keepalive function;
        (3)delete "clk == 0" check;
        (4)delete WS0 status bit check in interrupt routine;
        (5)sbsa_gwdt_set_wcv function.

v3: https://lkml.org/lkml/2015/5/25/111
Delete "export arch_timer_get_rate" patch.
Driver back to use arch_timer_get_cntfrq.
Improve watchdog_init_timeouts function and update relevant documentation. Improve watchdog_timeout_invalid and watchdog_pretimeout_invalid. Improve foundation-v8.dts: delete the unnecessary tag of device node. Remove "ARM64 || COMPILE_TEST" from Kconfig.
Add comments in arch/arm64/kernel/acpi.c
Fix typoes and incorrect comments.

v2: https://lkml.org/lkml/2015/5/21/172
Improve watchdog-kernel-api.txt documentation for pretimeout support. Export "arch_timer_get_rate" in arm_arch_timer.c.
Add watchdog_init_timeouts API for pretimeout support in framework. Improve suspend and resume foundation in driver
Improve timeout/pretimeout values init code in driver. Delete unnecessary items of the sbsa_gwdt struct and #define. Delete all unnecessary debug info in driver.
Fix 64bit division bug.
Use the arch_timer interface to get watchdog clock rate. Add MODULE_DEVICE_TABLE for platform device id.
Fix typoes.

v1: https://lkml.org/lkml/2015/5/15/279
The first version upstream patchset to linux mailing list.

Fu Wei (4):
Documentation: add sbsa-gwdt driver documentation
ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts
ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi
Watchdog: introduce ARM SBSA watchdog driver

Quoted 14 lines
 .../devicetree/bindings/watchdog/sbsa-gwdt.txt     |  31 ++
 Documentation/watchdog/watchdog-parameters.txt     |   7 +
 arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi       |   8 +
 arch/arm64/boot/dts/arm/foundation-v8.dts          |   7 +
 drivers/watchdog/Kconfig                           |  20 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/sbsa_gwdt.c                       | 408 +++++++++++++++++++++
 7 files changed, 482 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
 create mode 100644 drivers/watchdog/sbsa_gwdt.c
Signature · 1 line
2.5.0

Patchset added to linux-watchdog-next.

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#10 lore raw
Quoted 162 lines · Wim Van Sebroeck

Hi Fu,

Quoted 160 lines

From: Fu Wei <[email protected]>

This patchset:
(1)Introduce Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt for FDT info of SBSA Generic Watchdog, and give two examples of adding SBSA Generic Watchdog device node into the dts files:
foundation-v8.dts and amd-seattle-soc.dtsi.

(2)Introduce ARM SBSA watchdog driver:
a.Use linux kernel watchdog framework;
b.Work with FDT on ARM64;
c.Support getting timeout from parameter and FDT at the driver
init stage.
d.The driver works in two modes:
(1) single stage timeout (ignore WS0 interrupt)
(2) two stages timeout (register WS0 interrupt, do panic in routine)
e.User can config working mode by module parameter "action".

This patchset has been tested with watchdog daemon (ACPI/FDT, module/build-in) on the following platforms:
(1)ARM Foundation v8 model
(2)AMD Seattle platform

This patchset has been tested with kdump successfully.

Changelog:
v14:Fix a bug of registering interrupt routine: do a ping before
registering interrupt routine, in case where is a pending interrupt. Reorder the initialization code to postpone registering interrupt routine. Improve some code style:
(1)add some macro of string
(2)use watchdog_get_drvdata instead of to_sbsa_gwdt,
delete to_sbsa_gwdt.

v13:https://lkml.org/lkml/2016/2/16/713
Fix a dev_warn message typo"signle"-->"single" Add MODULE_ALIAS
Add more *ed-by in commit message.

v12:https://lkml.org/lkml/2016/2/16/154
Fix a dev_warn message typo"fall"--"falling"
Remove unnecessary "status" in dts
Add more *ed-by in commit message.

v11:https://lkml.org/lkml/2016/2/9/577
Merge patch 4 and 5.
Improve some comments.
The driver works in two modes, it's configured by "action"(instead of panic_enabled).
Improve the initialization of the timeout limits.
Feeding dog by writing "0" to WRR.

v10:https://lkml.org/lkml/2016/2/3/817
Delete pretimeout support.
Separate the driver to two parts:
(1) single stage timeout driver(ignore WS0 interrupt);
(2) register WS0 interrupt for the half timeout panic.
timeout == (enable --> WS1).

v9: https://lkml.org/lkml/2015/11/9/57
Rebase to latest kernel version(4.3).
Update the Documentation of sbsa-gwdt device node info of FDT:
(1) move some introduction to pretimeout patch
(2) delete WS1 value from "interrupts" of binding documentation, since WS1 won't be handled by Linux.

v8: https://lkml.org/lkml/2015/10/27/466
Rebase to latest kernel version(4.3-rc7).
Separate the patches of GTDT support and arm_arch_timer. This clocksource relevant patch will upstreamed in a individual patchset. Update all the default timeout and pretimeout to 30s and 60s. Improve documentation and inline comments.
Fix a bug in pretimeout support which makes timeout and pretimeout parameters initialization fail.

v7: https://lkml.org/lkml/2015/8/24/611
Rebase to latest kernel version(4.2-rc7).
Improve FDT support: geting resource by order, instead of name. According to the FDT support, Update the example dts file, gtdt.c and sbsa_gwdt.c.
Pass the sparse test, and fix the warning.
Fix the max_pretimeout and max_timeout value overflow bug. Delete the WCV output value.

v6: https://lkml.org/lkml/2015/6/23/359
Improve the dtb example files: reduce the register frame size to 4K. Improve pretimeout support:
(1) improve watchdog_init_timeouts function
(2) rename watchdog_check_min_max_timeouts back to the original name
(1) improve watchdog_timeout_invalid/watchdog_pretimeout_invalid
Add the new features in the sbsa_gwdt driver:
(1) In the second stage, user can feed the dog without cleaning WS0.
(2) In the second stage, user can trigger WS1 by setting pretimeout = 0.
(3) expand the max value of pretimeout, in case 10 second is not enough for a kdump kernel reboot in panic.

v5: https://lkml.org/lkml/2015/6/10/357
Improve pretimeout support:
(1)fix typo in documentation and comments.
(2)fix the timeout limits validation bug.
Simplify sbsa_gwdt driver:
(1)integrate all the registers access functions into caller.

v4: https://lkml.org/lkml/2015/6/2/4

    Refactor GTDT support code: remove it from arch/arm64/kernel/acpi.c,
    put it into drivers/acpi/gtdt.c file.
    Integrate the GTDT code of drivers/clocksource/arm_arch_timer.c into
    drivers/acpi/gtdt.c.
    Improve pretimeout support, fix "pretimeout == 0" problem.
    Simplify sbsa_gwdt driver:
        (1)timeout/pretimeout limits setup;
        (2)keepalive function;
        (3)delete "clk == 0" check;
        (4)delete WS0 status bit check in interrupt routine;
        (5)sbsa_gwdt_set_wcv function.

v3: https://lkml.org/lkml/2015/5/25/111
Delete "export arch_timer_get_rate" patch.
Driver back to use arch_timer_get_cntfrq.
Improve watchdog_init_timeouts function and update relevant documentation. Improve watchdog_timeout_invalid and watchdog_pretimeout_invalid. Improve foundation-v8.dts: delete the unnecessary tag of device node. Remove "ARM64 || COMPILE_TEST" from Kconfig.
Add comments in arch/arm64/kernel/acpi.c
Fix typoes and incorrect comments.

v2: https://lkml.org/lkml/2015/5/21/172
Improve watchdog-kernel-api.txt documentation for pretimeout support. Export "arch_timer_get_rate" in arm_arch_timer.c.
Add watchdog_init_timeouts API for pretimeout support in framework. Improve suspend and resume foundation in driver
Improve timeout/pretimeout values init code in driver. Delete unnecessary items of the sbsa_gwdt struct and #define. Delete all unnecessary debug info in driver.
Fix 64bit division bug.
Use the arch_timer interface to get watchdog clock rate. Add MODULE_DEVICE_TABLE for platform device id.
Fix typoes.

v1: https://lkml.org/lkml/2015/5/15/279
The first version upstream patchset to linux mailing list.

Fu Wei (4):
Documentation: add sbsa-gwdt driver documentation
ARM64: add SBSA Generic Watchdog device node in foundation-v8.dts
ARM64: add SBSA Generic Watchdog device node in amd-seattle-soc.dtsi
Watchdog: introduce ARM SBSA watchdog driver

 .../devicetree/bindings/watchdog/sbsa-gwdt.txt     |  31 ++
 Documentation/watchdog/watchdog-parameters.txt     |   7 +
 arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi       |   8 +
 arch/arm64/boot/dts/arm/foundation-v8.dts          |   7 +
 drivers/watchdog/Kconfig                           |  20 +
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/sbsa_gwdt.c                       | 408 +++++++++++++++++++++
 7 files changed, 482 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/sbsa-gwdt.txt
 create mode 100644 drivers/watchdog/sbsa_gwdt.c
Quoted 5 lines
Quoted 3 lines

--
2.5.0

Patchset added to linux-watchdog-next.

Hi Wim,
It is really a awesome news, Great thanks! :-)

Great thanks to everyone who helps me on this patchset!

Quoted 4 lines

Kind regards,
Wim.

Signature · 10 lines
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021