Skip to contentSkip to conversation

watchdog - v4.14-rc1 Merge Window

GIT PULL Wim Van Sebroeck 2 participants 2 messages Sep 13, 2017

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

Hi Linus,

Please pull from 'master' branch of
git://www.linux-watchdog.org/linux-watchdog.git

It contains following changes:
* add support for the watchdog on Meson8 and Meson8m2
* add support for MediaTek MT7623 and MT7622 SoC
* Add support for the r8a77995 wdt
* explicitly request exclusive reset control for asm9260_wdt, zx2967_wdt, rt2880_wdt and mt7621_wdt
* improvements on asm9260_wdt, aspeed_wdt, renesas_wdt and cadence_wdt
* Add support for reading freq via CCF + suspend/resume support for of_xilinx_wdt
* constify watchdog_ops and various device-id structures
* Revert of commit 1fccb73011ea8a5fa0c6d357c33fa29c695139ea = "iTCO_wdt: all versions count down twice" (Bug 196509)

This will update the following files:

 Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt  |   40 +++
 Documentation/devicetree/bindings/watchdog/meson-wdt.txt   |    6 
 Documentation/devicetree/bindings/watchdog/mtk-wdt.txt     |    2 
 Documentation/devicetree/bindings/watchdog/renesas-wdt.txt |    1 
 Documentation/watchdog/watchdog-parameters.txt             |    2 
 drivers/watchdog/asm9260_wdt.c                             |    4 
 drivers/watchdog/aspeed_wdt.c                              |  132 ++++++++++++-
 drivers/watchdog/bcm7038_wdt.c                             |    4 
 drivers/watchdog/cadence_wdt.c                             |    6 
 drivers/watchdog/coh901327_wdt.c                           |    2 
 drivers/watchdog/da9063_wdt.c                              |   67 ++----
 drivers/watchdog/diag288_wdt.c                             |    2 
 drivers/watchdog/iTCO_wdt.c                                |   22 +-
 drivers/watchdog/it87_wdt.c                                |    2 
 drivers/watchdog/max77620_wdt.c                            |    2 
 drivers/watchdog/mei_wdt.c                                 |    2 
 drivers/watchdog/meson_wdt.c                               |    2 
 drivers/watchdog/mt7621_wdt.c                              |    4 
 drivers/watchdog/of_xilinx_wdt.c                           |   83 ++++++--
 drivers/watchdog/pcwd_usb.c                                |    2 
 drivers/watchdog/qcom-wdt.c                                |    2 
 drivers/watchdog/renesas_wdt.c                             |   80 ++++---
 drivers/watchdog/rt2880_wdt.c                              |    4 
 drivers/watchdog/sc1200wdt.c                               |    2 
 drivers/watchdog/sp805_wdt.c                               |    2 
 drivers/watchdog/stm32_iwdg.c                              |    2 
 drivers/watchdog/ts72xx_wdt.c                              |    2 
 drivers/watchdog/w83627hf_wdt.c                            |    2 
 drivers/watchdog/ziirave_wdt.c                             |    2 
 drivers/watchdog/zx2967_wdt.c                              |    2 
 30 files changed, 363 insertions(+), 124 deletions(-)

with these Changes:

commit 4cb30b044a8f06e6e6418ae12c3c00bb02679dac

Author: Arvind Yadav <[email protected]>
Date:   Sat Aug 26 11:41:06 2017 +0530

watchdog: mei_wdt: constify mei_cl_device_id

mei_cl_device_id are not supposed to change at runtime. All functions working with mei_cl_device_id provided by <linux/mei_cl_bus.h> work with const mei_cl_device_id. So mark the non-const structs as const.

commit 05ce42fff3afb2904647f6a88c6dc613b5a2793a

Author: Arvind Yadav <[email protected]>
Date:   Wed Aug 23 22:04:08 2017 +0530

watchdog: sp805: constify amba_id

amba_id are not supposed to change at runtime. All functions working with const amba_id. So mark the non-const structs as const.

commit 68c82befe4023afd75006676c4bd708dbe98d668

Author: Arvind Yadav <[email protected]>
Date:   Mon Aug 21 22:18:38 2017 +0530

watchdog: ziirave: constify i2c_device_id

i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const.

commit 39ad808996dd84f2961e241cb1396b391c6cd039

Author: Arvind Yadav <[email protected]>
Date:   Wed Aug 16 10:27:03 2017 +0530

watchdog: sc1200: constify pnp_device_id

pnp_device_id are not supposed to change at runtime. All functions working with pnp_device_id provided by <linux/pnp.h> work with const pnp_device_id. So mark the non-const structs as const.

commit 82f6817fd6409e2253372e7c7b8c1e573390b579

Author: Geert Uytterhoeven <[email protected]>
Date:   Thu Aug 17 13:14:25 2017 +0200

dt-bindings: watchdog: renesas-wdt: Add support for the r8a77995 wdt

Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car D3 (r8a77995) SoC.

No driver update is needed.

commit 1f185596e7981ea1e606ae8c47b141be729e95ae

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 26 23:54:39 2017 +0200

watchdog: renesas_wdt: update copyright dates

commit 9c22b6d33605d4b24e2491fdb743a285e8588738

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 26 23:54:38 2017 +0200

watchdog: renesas_wdt: make 'clk' a variable local to probe()

It is not needed outside probe() anymore.

commit 3be42941dd9df9b7c5062fc98c416a15bf4bbc0f

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 26 23:54:37 2017 +0200

watchdog: renesas_wdt: consistently use RuntimePM for clock management

On Renesas R-Car archs, RuntimePM does all the clock handling. So, use it consistently to enable/disable the clocks. Also make sure that clocks are really enabled around clk_get_rate(). clk_summary looks proper now:

clock enable_cnt prepare_cnt rate ...
Before this commit:

At boot: rwdt 1 1 32768 0 0
WDT running: rwdt 2 2 32768 0 0

After this commit:

At boot: rwdt 0 1 32768 0 0
WDT running rwdt 1 1 32768 0 0

commit 012c04601f9dc6a268ebff87a890b339af6d25bf

Author: Andrew Jeffery <[email protected]>
Date:   Wed Aug 2 14:15:29 2017 +0930

watchdog: aspeed: Support configuration of external signal properties

Add support for configuring the drive strength and polarity on the AST2500, and the pulse duration on both the AST2400 and AST2500.

commit e654f19165483adfc30eeabe69a1efc23182bf0e

Author: Andrew Jeffery <[email protected]>
Date:   Wed Aug 2 14:15:28 2017 +0930

dt-bindings: watchdog: aspeed: External reset signal properties

For the AST2500 and compatible watchdog controllers the external reset signal can be configured for push-pull or open-drain drive types, and in the case of push-pull driving, active low or high.

commit ffbb29d62d6bcca3eff88111b58e4865506e95bf

Author: Christopher Bostic <[email protected]>
Date:   Mon Jul 17 14:25:38 2017 -0500

drivers/watchdog: Add optional ASPEED device tree properties

Describe device tree optional properties:

* aspeed,reset-type = "cpu|soc|system|none" One of three different, mutually exclusive, values

"cpu" : ARM CPU reset on signal
"soc" : 'System on chip' reset
"system" : Full system reset

The value can also be set to "none" which indicates that no reset of any kind is to be done via this watchdog. This assumes another watchdog on the chip is to take care of resets.

* aspeed,external-signal - Generate external signal (WDT1 and WDT2 only)
* aspeed,alt-boot - Boot from alternate block on signal

commit b7f0b8ad25f3f19f7830b3ce5b8fa6f7fe7ae5d5

Author: Christopher Bostic <[email protected]>
Date:   Mon Jul 17 14:25:39 2017 -0500

drivers/watchdog: ASPEED reference dev tree properties for config

Reference the system device tree when configuring the watchdog engines. If property 'aspeed,reset_type' is present then set reset behavior based on the specified value. This can be one of three different mutually exclusive values
* cpu - Reset CPU only on watchdog timeout
* soc - Reset System on Chip
* system - Full system reset

No reset can also be specified by indicating:
* none - No reset, assumes another watchdog is responsible for this.

Add optional property 'aspeed,external-signal'. If present then configure to generate external signal on watchdog timeout.

commit a1f2a82072ea298ae91505c213f6d299ddb5e446

Author: [email protected] <[email protected]>
Date:   Tue Jul 25 13:25:58 2017 +0200

watchdog: da9063_wdt: Simplify by removing unneeded struct...

...da9063_watchdog, which contained nothing but struct watchdog_device and a struct da9063 pointer.
Assign the struct da9063 pointer directly to the struct watchdog_device's driver_data field instead of creating struct da9063_watchdog and assigning it's address there.
Spares a pointer's size data memory and an indirection level in the callbacks.

commit dd0a18ca4cbdce00bc2b2e0510793205af27c7c5

Author: Fabio Estevam <[email protected]>
Date:   Sat Jul 22 17:22:59 2017 -0300

watchdog: bcm7038: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error.

commit 15210ad18fcbd7f53f40e26e4391710d271c2daf

Author: Fabio Estevam <[email protected]>
Date:   Sat Jul 22 13:04:33 2017 -0300

watchdog: qcom: Check for platform_get_resource() failure

platform_get_resource() may fail, so we should better check its return value and propagate an error in case it fails.

This avoids a NULL pointer dereference a bit later in the code.

commit 6f671c6b6288fd673e8b8b8acf1070100ba8188a

Author: Michal Simek <[email protected]>
Date:   Mon Aug 7 13:24:23 2017 +0200

watchdog: of_xilinx_wdt: Add suspend/resume support

Add suspend/resume support to driver.

commit b6bc41645547f4e1a1bd882db7fa2b8596197d88

Author: Maulik Jodhani <[email protected]>
Date:   Mon Aug 7 13:24:22 2017 +0200

watchdog: of_xilinx_wdt: Add support for reading freq via CCF

Improve CLK handling in the code to read freq via CCF. Also disable CLK asap and add clk handling code to start and stop.

commit e8a7fc711c9aa801cf0e733109e40548b16875a3

Author: Sean Wang <[email protected]>
Date:   Tue Aug 15 00:41:38 2017 +0800

dt-bindings: watchdog: mediatek: add support for MediaTek MT7623 and MT7622 SoC

This updates dt-binding documentation for MediaTek MT7622 and MT7623 SoC. For the both SoCs supported all rely on the fallback binding of the case with "mediatek,mt6589-wdt".

commit e8c7ebfdb4308d26efda8214da8bfbbd9cc31414

Author: Arvind Yadav <[email protected]>
Date:   Sun Aug 13 16:58:28 2017 +0530

watchdog: max77620_wdt: constify platform_device_id

platform_device_id are not supposed to change at runtime. All functions working with platform_device_id provided by <linux/platform_device.h> work with const platform_device_id. So mark the non-const structs as const.

commit cc53e1c2bba50563da8fae057e75a6377b9db696

Author: Arvind Yadav <[email protected]>
Date:   Sat Aug 12 14:09:45 2017 +0530

watchdog: pcwd_usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by <linux/usb.h> work with const usb_device_id. So mark the non-const structs as const.

commit f3a7f6f67fc7ec5bb47a6ad6b947d66759e6d9e4

Author: Michal Simek <[email protected]>
Date:   Fri Aug 4 09:39:17 2017 +0200

watchdog: cadence_wdt: Show information when driver is probed

Showing message that driver is loaded is common across drivers. This change also fixes checkpatch (--strict) warning "Alignment should match open parenthesis".

commit db202f4d5c24c0ed44501c1d382e4e971c6d67c7

Author: Michal Simek <[email protected]>
Date:   Fri Aug 4 09:39:16 2017 +0200

watchdog: cadence_wdt: Enable access to module parameters

Give read access to module parameters to all and write access to root. This change also improves driver error path testing.

commit 323edb2e27e8e02b0ce25e7caa8288a90a438b99

Author: Julia Lawall <[email protected]>
Date:   Thu Aug 3 23:21:31 2017 +0200
    watchdog: constify watchdog_ops and watchdog_info structures
    
    These watchdog_ops and watchdog_info structures are only stored
    in the ops and info fields of a watchdog_device structure,
    respectively, which are const.  Thus make the watchdog_ops and
    watchdog_info structures const as well.
    
    Done with the help of Coccinelle.  The rules for the watchdog_ops case are
    as follows:
    
    // <smpl>
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };
    
    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
     struct watchdog_ops i = { ... };
    // </smpl>
    
    Signed-off-by: Julia Lawall <[email protected]>
    Acked-by: Linus Walleij <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>

commit d94fa4655ed79784388cb49c17c5e9967ddfb4b9

Author: Wolfram Sang <[email protected]>
Date:   Mon Jul 17 19:12:24 2017 +0200

watchdog: asm9260_wdt: don't round closest with get_timeleft

We should never return more time left than there actually is. So, switch to a plain divider instead of DIV_ROUND_CLOSEST.

commit 03a196f25f5652a3deffc1b8eade8a3c1c39282c

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 19 10:27:55 2017 +0200

watchdog: renesas_wdt: add another divider option

If we set RWTCSRB to 0, we can gain 4096 as another divider value. This is supported by all R-Car Gen2 and Gen3 devices which we aim to support.

commit 82f64cd20848511f516bd28147a6432497dfb080

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 19 10:27:54 2017 +0200

watchdog: renesas_wdt: apply better precision

The error margin of the clks_per_second variable was too large and caused offsets when used with clock frequencies which left a remainder after applying the dividers. Now we always calculate directly using the clock rate and the divider using some helper macros. That also means that DIV_ROUND_UP moves from probe to the multiplication macro. In probe, we don't need to ensure anymore that 'clks_per_sec' would go too fast but rather ensure that the lower limit is really at least 1 to certainly get a full cycle.

commit 1c1b2434017206b612764fad1820b6dd48cb9e92

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 19 10:27:53 2017 +0200

watchdog: renesas_wdt: don't round closest with get_timeleft

We should never return more time left than there actually is. So, switch to a plain divider instead of DIV_ROUND_CLOSEST.

commit b51247c8029660a9c49ad48bf38f364479c96215

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 19 10:27:52 2017 +0200

watchdog: renesas_wdt: check rate also for upper limit

When checking the clock rate, ensure also that counting all 16 bits takes at least one second to match the granularity of the framework.

commit f6159dd4b085ad839ab02c1ba230535c53ef60d4

Author: Wolfram Sang <[email protected]>
Date:   Wed Jul 19 10:27:51 2017 +0200

watchdog: renesas_wdt: avoid (theoretical) type overflow

Because the smallest clock divider we can select is 1, 'clks_per_sec' must be the same type as 'rate'.

commit 0bade0215ca4337caa00cd72e88bd71a45396b00

Author: Philipp Zabel <[email protected]>
Date:   Wed Jul 19 17:26:38 2017 +0200

watchdog: mt7621: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed.

No functional changes.

commit a248e5e9a7c511ff95c53cc2085920c8f29206aa

Author: Philipp Zabel <[email protected]>
Date:   Wed Jul 19 17:26:39 2017 +0200

watchdog: rt2880: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed.

No functional changes.

commit 39055bbb446d6858017a1f454327c2b0d432261b

Author: Philipp Zabel <[email protected]>
Date:   Wed Jul 19 17:26:40 2017 +0200

watchdog: zx2967: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed.

No functional changes.

commit fcc6da076a38f53d6df374fe5c9f1325eea25a00

Author: Philipp Zabel <[email protected]>
Date:   Wed Jul 19 17:26:37 2017 +0200

watchdog: asm9260: explicitly request exclusive reset control

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed.

No functional changes.

commit 43a64e81b2ac449938ba52a202e3edd23f57ec49

Author: Martin Blumenstingl <[email protected]>
Date:   Wed Jul 12 00:14:38 2017 +0200

watchdog: meson-wdt: add support for the watchdog on Meson8 and Meson8m2

The watchdog IP block on Meson8 and Meson8m2 is already supported by the existing meson-wdt driver. Meson8 uses the same register bits as Meson6, while the newer Meson8m2 SoC uses the same register bits as Meson8b.

Currently watchdog support on Meson8 SoC already works because meson8.dtsi simply uses the "amlogic,meson6-wdt" compatible. Adding a separate compatible for Meson8 makes this more explicit though.

commit 08b10b57d69bb37d6e70a8db71844527a9f1f41c

Author: Colin Ian King <[email protected]>
Date:   Tue Jul 11 16:23:34 2017 +0100

watchdog: w83627hf: make const array chip_name static

Don't populate array chip_name on the stack but instead make it static. Makes the object code smaller by 40 bytes:

Before:
text data bss dec hex filename
5641 2840 384 8865 22a1 drivers/watchdog/w83627hf_wdt.o

After:
text data bss dec hex filename
5545 2896 384 8825 2279 drivers/watchdog/w83627hf_wdt.o

commit 9215fc79521a05debba3ba67668caeb65d204cc7

Author: Gustavo A. R. Silva <[email protected]>
Date:   Fri Jul 7 19:33:30 2017 -0500
    watchdog: coh901327_wdt: constify watchdog_ops structure
    
    Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.
    
    This issue was detected using Coccinelle and the following semantic patch:
    
    @r
    disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };
    
    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
     struct watchdog_ops i = { ... };
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>

commit d7b16e75d40e579a58e31f751ac5bb44d2dfbeed

Author: Gustavo A. R. Silva <[email protected]>
Date:   Fri Jul 7 19:28:57 2017 -0500
    watchdog: stm32_iwdg: constify watchdog_ops structure
    
    Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.
    
    This issue was detected using Coccinelle and the following semantic patch:
    
    @r
    disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };
    
    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
     struct watchdog_ops i = { ... };
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>

commit 2211a8dce791f49a783959e8e81503e6ad67c70a

Author: Gustavo A. R. Silva <[email protected]>
Date:   Fri Jul 7 19:23:21 2017 -0500
    watchdog: it87_wdt: constify watchdog_ops structure
    
    Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.
    
    This issue was detected using Coccinelle and the following semantic patch:
    
    @r
    disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };
    
    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
     struct watchdog_ops i = { ... };
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>

commit 5870ac753bce54ad0550851c65ebba1d7da890ef

Author: Gustavo A. R. Silva <[email protected]>
Date:   Fri Jul 7 19:18:40 2017 -0500
    watchdog: ts72xx_wdt: constify watchdog_ops structure
    
    Check for watchdog_ops structures that are only stored in the ops field of
    a watchdog_device structure. This field is declared const, so watchdog_ops
    structures that have this property can be declared as const also.
    
    This issue was detected using Coccinelle and the following semantic patch:
    
    @r
    disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct watchdog_ops i@p = { ... };
    
    @ok@
    identifier r.i;
    struct watchdog_device e;
    position p;
    @@
    e.ops = &i@p;
    
    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct watchdog_ops e;
    @@
    e@i@p
    
    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
     struct watchdog_ops i = { ... };
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>

commit fc61e83a29308601e6e8a0759e24fc8fe2122692

Author: Wim Van Sebroeck <[email protected]>
Date:   Sat Sep 9 17:41:24 2017 +0200

watchdog: Revert "iTCO_wdt: all versions count down twice"

This reverts commit 1fccb73011ea8a5fa0c6d357c33fa29c695139ea. Reported as Bug 196509 - iTCO_wdt regression reboot before timeout expire

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt +40 -0
index c5e74d7..c5077a1 100644
@@ -8,9 +8,49 @@ Required properties:
  - reg: physical base address of the controller and length of memory mapped
    region
 
+Optional properties:
+
+ - aspeed,reset-type = "cpu|soc|system|none"
+
+   Reset behavior - Whenever a timeout occurs the watchdog can be programmed
+   to generate one of three different, mutually exclusive, types of resets.
+
+   Type "none" can be specified to indicate that no resets are to be done.
+   This is useful in situations where another watchdog engine on chip is
+   to perform the reset.
+
+   If 'aspeed,reset-type=' is not specfied the default is to enable system
+   reset.
+
+   Reset types:
+
+        - cpu: Reset CPU on watchdog timeout
+
+        - soc: Reset 'System on Chip' on watchdog timeout
+
+        - system: Reset system on watchdog timeout
+
+        - none: No reset is performed on timeout. Assumes another watchdog
+                engine is responsible for this.
+
+ - aspeed,alt-boot:    If property is present then boot from alternate block.
+ - aspeed,external-signal: If property is present then signal is sent to
+			external reset counter (only WDT1 and WDT2). If not
+			specified no external signal is sent.
+ - aspeed,ext-pulse-duration: External signal pulse duration in microseconds
+
+Optional properties for AST2500-compatible watchdogs:
+ - aspeed,ext-push-pull: If aspeed,external-signal is present, set the pin's
+			 drive type to push-pull. The default is open-drain.
+ - aspeed,ext-active-high: If aspeed,external-signal is present and and the pin
+			   is configured as push-pull, then set the pulse
+			   polarity to active-high. The default is active-low.
+
 Example:
 
 	wdt1: watchdog@1e785000 {
 		compatible = "aspeed,ast2400-wdt";
 		reg = <0x1e785000 0x1c>;
+		aspeed,reset-type = "system";
+		aspeed,external-signal;
 	};
Documentation/devicetree/bindings/watchdog/meson-wdt.txt +5 -1
index ae70185..8a6d84c 100644
@@ -2,7 +2,11 @@ Meson SoCs Watchdog timer
 
 Required properties:
 
-- compatible : should be "amlogic,meson6-wdt" or "amlogic,meson8b-wdt"
+- compatible : depending on the SoC this should be one of:
+	"amlogic,meson6-wdt" on Meson6 SoCs
+	"amlogic,meson8-wdt" and "amlogic,meson6-wdt" on Meson8 SoCs
+	"amlogic,meson8b-wdt" on Meson8b SoCs
+	"amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs
 - reg : Specifies base physical address and size of the registers.
 
 Example:
Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +2 -0
index 6a00939..096bbfb 100644
@@ -4,6 +4,8 @@ Required properties:
 
 - compatible should contain:
 	* "mediatek,mt2701-wdt" for MT2701 compatible watchdog timers
+	* "mediatek,mt7622-wdt", "mediatek,mt6589-wdt": for MT7622
+	* "mediatek,mt7623-wdt", "mediatek,mt6589-wdt": for MT7623
 	* "mediatek,mt6589-wdt" for all compatible watchdog timers (MT2701,
 		MT6589)
 
Documentation/devicetree/bindings/watchdog/renesas-wdt.txt +1 -0
index 9e306af..bf6d1ca 100644
@@ -6,6 +6,7 @@ Required properties:
 	       Examples with soctypes are:
 	         - "renesas,r8a7795-wdt" (R-Car H3)
 	         - "renesas,r8a7796-wdt" (R-Car M3-W)
+	         - "renesas,r8a77995-wdt" (R-Car D3)
 	         - "renesas,r7s72100-wdt" (RZ/A1)
 
   When compatible with the generic version, nodes must list the SoC-specific
Documentation/watchdog/watchdog-parameters.txt +1 -1
index b352636..6f9d7b4 100644
@@ -117,7 +117,7 @@ nowayout: Watchdog cannot be stopped once started
 -------------------------------------------------
 iTCO_wdt:
 heartbeat: Watchdog heartbeat in seconds.
-	(5<=heartbeat<=74 (TCO v1) or 1226 (TCO v2), default=30)
+	(2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30)
 nowayout: Watchdog cannot be stopped once started
 	(default=kernel config parameter)
 -------------------------------------------------
drivers/watchdog/asm9260_wdt.c +2 -2
index 53da001..7dd0da6 100644
@@ -82,7 +82,7 @@ static unsigned int asm9260_wdt_gettimeleft(struct watchdog_device *wdd)
 
 	counter = ioread32(priv->iobase + HW_WDTV);
 
-	return DIV_ROUND_CLOSEST(counter, priv->wdt_freq);
+	return counter / priv->wdt_freq;
 }
 
 static int asm9260_wdt_updatetimeout(struct watchdog_device *wdd)
@@ -296,7 +296,7 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	priv->rst = devm_reset_control_get(&pdev->dev, "wdt_rst");
+	priv->rst = devm_reset_control_get_exclusive(&pdev->dev, "wdt_rst");
 	if (IS_ERR(priv->rst))
 		return PTR_ERR(priv->rst);
 
drivers/watchdog/aspeed_wdt.c +125 -7

174 lines not on this page · raw message

drivers/watchdog/bcm7038_wdt.c +3 -1
index c1b8e53..f88f546 100644
@@ -136,7 +136,9 @@ static int bcm7038_wdt_probe(struct platform_device *pdev)
 	wdt->clk = devm_clk_get(dev, NULL);
 	/* If unable to get clock, use default frequency */
 	if (!IS_ERR(wdt->clk)) {
-		clk_prepare_enable(wdt->clk);
+		err = clk_prepare_enable(wdt->clk);
+		if (err)
+			return err;
 		wdt->rate = clk_get_rate(wdt->clk);
 		/* Prevent divide-by-zero exception */
 		if (!wdt->rate)
drivers/watchdog/cadence_wdt.c +3 -3
index 05c0000..064cf7b 100644
@@ -52,12 +52,12 @@
 static int wdt_timeout;
 static int nowayout = WATCHDOG_NOWAYOUT;
 
-module_param(wdt_timeout, int, 0);
+module_param(wdt_timeout, int, 0644);
 MODULE_PARM_DESC(wdt_timeout,
 		 "Watchdog time in seconds. (default="
 		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
 
-module_param(nowayout, int, 0);
+module_param(nowayout, int, 0644);
 MODULE_PARM_DESC(nowayout,
 		 "Watchdog cannot be stopped once started (default="
 		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
@@ -368,7 +368,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
 	}
 	platform_set_drvdata(pdev, wdt);
 
-	dev_dbg(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
+	dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
 		 wdt->regs, cdns_wdt_device->timeout,
 		 nowayout ? ", nowayout" : "");
 
drivers/watchdog/coh901327_wdt.c +1 -1
index 38dd60f..4410337 100644
@@ -218,7 +218,7 @@ static const struct watchdog_info coh901327_ident = {
 	.identity = DRV_NAME,
 };
 
-static struct watchdog_ops coh901327_ops = {
+static const struct watchdog_ops coh901327_ops = {
 	.owner = THIS_MODULE,
 	.start = coh901327_start,
 	.stop = coh901327_stop,
drivers/watchdog/da9063_wdt.c +30 -37

142 lines not on this page · raw message

drivers/watchdog/diag288_wdt.c +1 -1
index 6f59108..806a04a 100644
@@ -213,7 +213,7 @@ static const struct watchdog_ops wdt_ops = {
 	.set_timeout = wdt_set_timeout,
 };
 
-static struct watchdog_info wdt_info = {
+static const struct watchdog_info wdt_info = {
 	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
 	.firmware_version = 0,
 	.identity = "z Watchdog",
drivers/watchdog/iTCO_wdt.c +12 -10
index c4f6587..347f038 100644
@@ -306,15 +306,16 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev)
 
 	iTCO_vendor_pre_keepalive(p->smi_res, wd_dev->timeout);
 
-	/* Reset the timeout status bit so that the timer
-	 * needs to count down twice again before rebooting */
-	outw(0x0008, TCO1_STS(p));	/* write 1 to clear bit */
-
 	/* Reload the timer by writing to the TCO Timer Counter register */
-	if (p->iTCO_version >= 2)
+	if (p->iTCO_version >= 2) {
 		outw(0x01, TCO_RLD(p));
-	else if (p->iTCO_version == 1)
+	} else if (p->iTCO_version == 1) {
+		/* Reset the timeout status bit so that the timer
+		 * needs to count down twice again before rebooting */
+		outw(0x0008, TCO1_STS(p));	/* write 1 to clear bit */
+
 		outb(0x01, TCO_RLD(p));
+	}
 
 	spin_unlock(&p->io_lock);
 	return 0;
@@ -327,8 +328,11 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t)
 	unsigned char val8;
 	unsigned int tmrval;
 
-	/* The timer counts down twice before rebooting */
-	tmrval = seconds_to_ticks(p, t) / 2;
+	tmrval = seconds_to_ticks(p, t);
+
+	/* For TCO v1 the timer counts down twice before rebooting */
+	if (p->iTCO_version == 1)
+		tmrval /= 2;
 
 	/* from the specs: */
 	/* "Values of 0h-3h are ignored and should not be attempted" */
@@ -381,8 +385,6 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)
 		spin_lock(&p->io_lock);
 		val16 = inw(TCO_RLD(p));
 		val16 &= 0x3ff;
-		if (!(inw(TCO1_STS(p)) & 0x0008))
-			val16 += (inw(TCOv2_TMR(p)) & 0x3ff);
 		spin_unlock(&p->io_lock);
 
 		time_left = ticks_to_seconds(p, val16);
drivers/watchdog/it87_wdt.c +1 -1
index dd1e7ea..e96faea 100644
@@ -253,7 +253,7 @@ static const struct watchdog_info ident = {
 	.identity = WATCHDOG_NAME,
 };
 
-static struct watchdog_ops wdt_ops = {
+static const struct watchdog_ops wdt_ops = {
 	.owner = THIS_MODULE,
 	.start = wdt_start,
 	.stop = wdt_stop,
drivers/watchdog/max77620_wdt.c +1 -1
index 68c41fa..2c9f53e 100644
@@ -201,7 +201,7 @@ static int max77620_wdt_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_device_id max77620_wdt_devtype[] = {
+static const struct platform_device_id max77620_wdt_devtype[] = {
 	{ .name = "max77620-watchdog", },
 	{ },
 };
drivers/watchdog/mei_wdt.c +1 -1
index b29c6fd..ea60b29 100644
@@ -670,7 +670,7 @@ static int mei_wdt_remove(struct mei_cl_device *cldev)
 #define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \
 			    0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB)
 
-static struct mei_cl_device_id mei_wdt_tbl[] = {
+static const struct mei_cl_device_id mei_wdt_tbl[] = {
 	{ .uuid = MEI_UUID_WD, .version = MEI_CL_VERSION_ANY },
 	/* required last entry */
 	{ }
drivers/watchdog/meson_wdt.c +2 -0
index 491b9bf..304274c 100644
@@ -155,7 +155,9 @@ static const struct watchdog_ops meson_wdt_ops = {
 
 static const struct of_device_id meson_wdt_dt_ids[] = {
 	{ .compatible = "amlogic,meson6-wdt", .data = &meson6_wdt_data },
+	{ .compatible = "amlogic,meson8-wdt", .data = &meson6_wdt_data },
 	{ .compatible = "amlogic,meson8b-wdt", .data = &meson8b_wdt_data },
+	{ .compatible = "amlogic,meson8m2-wdt", .data = &meson8b_wdt_data },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, meson_wdt_dt_ids);
drivers/watchdog/mt7621_wdt.c +2 -2
index 48a0606..db38f80 100644
@@ -105,7 +105,7 @@ static int mt7621_wdt_bootcause(void)
 	return 0;
 }
 
-static struct watchdog_info mt7621_wdt_info = {
+static const struct watchdog_info mt7621_wdt_info = {
 	.identity = "Mediatek Watchdog",
 	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
 };
@@ -135,7 +135,7 @@ static int mt7621_wdt_probe(struct platform_device *pdev)
 	if (IS_ERR(mt7621_wdt_base))
 		return PTR_ERR(mt7621_wdt_base);
 
-	mt7621_wdt_reset = devm_reset_control_get(&pdev->dev, NULL);
+	mt7621_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
 	if (!IS_ERR(mt7621_wdt_reset))
 		reset_control_deassert(mt7621_wdt_reset);
 
drivers/watchdog/of_xilinx_wdt.c +70 -13

134 lines not on this page · raw message

drivers/watchdog/pcwd_usb.c +1 -1
index 5615f40..b9e376c 100644
@@ -74,7 +74,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
 #define USB_PCWD_PRODUCT_ID	0x1140
 
 /* table of devices that work with this driver */
-static struct usb_device_id usb_pcwd_table[] = {
+static const struct usb_device_id usb_pcwd_table[] = {
 	{ USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
drivers/watchdog/qcom-wdt.c +2 -0
index 4f47b5e..7809713 100644
@@ -162,6 +162,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -ENOMEM;
 
 	/* We use CPU0's DGT for the watchdog */
 	if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
drivers/watchdog/renesas_wdt.c +48 -32

167 lines not on this page · raw message

drivers/watchdog/rt2880_wdt.c +2 -2
index 05524ba..98967f0 100644
@@ -119,7 +119,7 @@ static int rt288x_wdt_bootcause(void)
 	return 0;
 }
 
-static struct watchdog_info rt288x_wdt_info = {
+static const struct watchdog_info rt288x_wdt_info = {
 	.identity = "Ralink Watchdog",
 	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
 };
@@ -152,7 +152,7 @@ static int rt288x_wdt_probe(struct platform_device *pdev)
 	if (IS_ERR(rt288x_wdt_clk))
 		return PTR_ERR(rt288x_wdt_clk);
 
-	rt288x_wdt_reset = devm_reset_control_get(&pdev->dev, NULL);
+	rt288x_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
 	if (!IS_ERR(rt288x_wdt_reset))
 		reset_control_deassert(rt288x_wdt_reset);
 
drivers/watchdog/sc1200wdt.c +1 -1
index b34d3d5..8e4e2fc 100644
@@ -342,7 +342,7 @@ static int __init sc1200wdt_probe(void)
 
 #if defined CONFIG_PNP
 
-static struct pnp_device_id scl200wdt_pnp_devices[] = {
+static const struct pnp_device_id scl200wdt_pnp_devices[] = {
 	/* National Semiconductor PC87307/PC97307 watchdog component */
 	{.id = "NSC0800", .driver_data = 0},
 	{.id = ""},
drivers/watchdog/sp805_wdt.c +1 -1
index e7a715e..03805bc 100644
@@ -281,7 +281,7 @@ static int __maybe_unused sp805_wdt_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend,
 		sp805_wdt_resume);
 
-static struct amba_id sp805_wdt_ids[] = {
+static const struct amba_id sp805_wdt_ids[] = {
 	{
 		.id	= 0x00141805,
 		.mask	= 0x00ffffff,
drivers/watchdog/stm32_iwdg.c +1 -1
index 6c501b7..be64a86 100644
@@ -140,7 +140,7 @@ static const struct watchdog_info stm32_iwdg_info = {
 	.identity	= "STM32 Independent Watchdog",
 };
 
-static struct watchdog_ops stm32_iwdg_ops = {
+static const struct watchdog_ops stm32_iwdg_ops = {
 	.owner		= THIS_MODULE,
 	.start		= stm32_iwdg_start,
 	.ping		= stm32_iwdg_ping,
drivers/watchdog/ts72xx_wdt.c +1 -1
index 17c25da..811e43c 100644
@@ -112,7 +112,7 @@ static const struct watchdog_info ts72xx_wdt_ident = {
 	.identity		= "TS-72XX WDT",
 };
 
-static struct watchdog_ops ts72xx_wdt_ops = {
+static const struct watchdog_ops ts72xx_wdt_ops = {
 	.owner		= THIS_MODULE,
 	.start		= ts72xx_wdt_start,
 	.stop		= ts72xx_wdt_stop,
drivers/watchdog/w83627hf_wdt.c +1 -1
index d9ba049..7817836 100644
@@ -429,7 +429,7 @@ static int __init wdt_init(void)
 {
 	int ret;
 	int chip;
-	const char * const chip_name[] = {
+	static const char * const chip_name[] = {
 		"W83627HF",
 		"W83627S",
 		"W83697HF",
drivers/watchdog/ziirave_wdt.c +1 -1
index b4e0cea..d3594aa 100644
@@ -737,7 +737,7 @@ static int ziirave_wdt_remove(struct i2c_client *client)
 	return 0;
 }
 
-static struct i2c_device_id ziirave_wdt_id[] = {
+static const struct i2c_device_id ziirave_wdt_id[] = {
 	{ "rave-wdt", 0 },
 	{ }
 };
drivers/watchdog/zx2967_wdt.c +1 -1
index 69ec585..9261f7c 100644
@@ -229,7 +229,7 @@ static int zx2967_wdt_probe(struct platform_device *pdev)
 	}
 	clk_set_rate(wdt->clock, ZX2967_WDT_CLK_FREQ);
 
-	rstc = devm_reset_control_get(dev, NULL);
+	rstc = devm_reset_control_get_exclusive(dev, NULL);
 	if (IS_ERR(rstc)) {
 		dev_err(dev, "failed to get rstc");
 		ret = PTR_ERR(rstc);
#1 lore raw

Wim,
your emails continue to be marked as spam.

gmail says:

"We've found that lots of messages from iguana.be are spam"

I'm guessing there's a mailing list or something there?

Also, _please_ start using git request-pull or change your script to have the proper shortlog too.

Linus

Quoted 5 lines · Wim Van Sebroeck

Hi Linus,

Please pull from 'master' branch of
git://www.linux-watchdog.org/linux-watchdog.git