Commit graph

1839 commits

Author SHA1 Message Date
Dan Carpenter 4a22fc534f watchdog: tqmx86: Fix a couple IS_ERR() vs NULL bugs
These functions return NULL on error but we accidentally check
for IS_ERR() instead.

Fixes: e3c21e088f ("watchdog: tqmx86: Add watchdog driver for the IO controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-01-07 10:10:35 +01:00
NeilBrown 3aa8b8bbc1 watchdog: mt7621_wdt/rt2880_wdt: Fix compilation problem
These files need
   #include <linux/mod_devicetable.h>
to compile correctly.

Fixes: ac3167257b ("headers: separate linux/mod_devicetable.h from linux/platform_device.h")
Signed-off-by: NeilBrown <neil@brown.name>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2019-01-07 10:10:35 +01:00
Linus Torvalds 115502a6f3 linux-watchdog 4.21-rc1 tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAlwopYUACgkQ+iyteGJfRsqOZwCfXM0u0XQJS6TZFtEOZp5gKq+d
 f/4AnRXcblmb1wJiEVItizB03leOWHqk
 =jry0
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-4.21-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:
 - add TQ-Systems TQMX86 watchdog driver
 - add Qualcomm PM8916 watchdog driver
 - w83627hf_wdt: add quirk for Inves system
 - renesas_wdt: several improvements and document r8a774c0 support
 - mena21_wdt, mtx-1: Convert to use GPIO descriptor
 - bcm281xx, ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE
 - documentation: add PM usage and kernel-api: don't reference removed functions
 - update bindings for MT7629 SoC
 - several small fixes

* tag 'linux-watchdog-4.21-rc1' of git://www.linux-watchdog.org/linux-watchdog: (22 commits)
  watchdog: tqmx86: Add watchdog driver for the IO controller
  dt-bindings: watchdog: renesas-wdt: Document r8a774c0 support
  watchdog: docs: kernel-api: don't reference removed functions
  watchdog: add documentation for PM usage
  watchdog: mtx-1: Convert to use GPIO descriptor
  watchdog: mena21_wdt: Convert to GPIO descriptors
  dt-bindings: watchdog: Add Qualcomm PM8916 watchdog
  watchdog: Add pm8916 watchdog driver
  dt-bindings: watchdog: update bindings for MT7629 SoC
  watchdog: renesas_wdt: don't keep timer value during suspend/resume
  watchdog: ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE
  watchdog: bcm281xx: convert to DEFINE_SHOW_ATTRIBUTE
  watchdog: asm9260_wdt: make array mode_name static, shrinks object size
  watchdog/hpwdt: Update driver version.
  watchdog/hpwdt: Do not claim unsupported hardware
  watchdog/hpwdt: Exclude via blacklist
  Watchdog: remove outdated comment
  watchdog: w83627hf_wdt: Add quirk for Inves system
  watchdog: cpwd: add of_node_put()
  watchdog: renesas_wdt: don't set divider while watchdog is running
  ...
2019-01-01 13:16:45 -08:00
Andrew Lunn e3c21e088f watchdog: tqmx86: Add watchdog driver for the IO controller
Some TQ-Systems ComExpress modules have an IO controller with a
watchdog timer.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-24 13:15:07 +01:00
Linus Walleij d2b911db8b watchdog: mtx-1: Convert to use GPIO descriptor
This converts the MTX-1 driver to grab a GPIO descriptor
associated with the device instead of using a resource with
a global GPIO number. Augment the driver and the boardfile.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Paul Burton <paul.burton@mips.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-24 08:27:56 +01:00
Linus Walleij 22ec9bb1cb watchdog: mena21_wdt: Convert to GPIO descriptors
This drops the old OF API use to look up global GPIO
numbers and replace it with the GPIO descriptor API.

Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Johannes Thumshirn <morbidrsa@gmail.com>
Cc: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:34 +01:00
Loic Poulain 969c0acc03 watchdog: Add pm8916 watchdog driver
The PM816 module is a versatile PMIC with many diverse functions
integrated, including, a watchdog.
This watchdog is subcomponent of the PON (Power On) peripheral,
in the same way as pwrkey/resin buttons.
It works with two timers (2-stages), the first one generates an
IRQ to the main SoC (APQ8016/MSM8916), the second one performs
the reset.

This driver expects the following device hierarchy:
[pm8916]->[pm8916-pon]->[pm8916-wdt]

It uses the pm8916 regmap to access PM8916 registers.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:33 +01:00
Wolfram Sang 9077123c68 watchdog: renesas_wdt: don't keep timer value during suspend/resume
After discussing this mail thread [1] again, we concluded that giving
userspace enough time to prepare is our favourite option. So, do not
keep the time value when suspended but reset it when resuming.

[1] https://patchwork.kernel.org/patch/10252209/

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:32 +01:00
Yangtao Li 248e655b45 watchdog: ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:32 +01:00
Yangtao Li 57808f448b watchdog: bcm281xx: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:32 +01:00
Colin Ian King b1bbb0cb2c watchdog: asm9260_wdt: make array mode_name static, shrinks object size
Don't populate the const array mode_name on the stack but instead
make it static. Makes the object code smaller by 41 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   7699	   1872	      0	   9571	   2563	drivers/watchdog/asm9260_wdt.o

After:
   text	   data	    bss	    dec	    hex	filename
   7594	   1936	      0	   9530	   253a	drivers/watchdog/asm9260_wdt.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:31 +01:00
Jerry Hoemann 437a3f8ea4 watchdog/hpwdt: Update driver version.
Bump version number to reflect recent minor changes.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:31 +01:00
Jerry Hoemann de2cb0cc30 watchdog/hpwdt: Do not claim unsupported hardware
Do not claim when SSID 0x0289 as the watchdog features
are not enabled/validated by the firmware.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:30 +01:00
Jerry Hoemann 94d6b80c45 watchdog/hpwdt: Exclude via blacklist
Instead of having explicit if statments excluding devices,
use a pci_device_id table of devices to blacklist.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-22 12:15:30 +01:00
Jean Delvare 31eb42bd93 watchdog: w83627hf_wdt: Add quirk for Inves system
On some systems, the NCT6791D comes with a companion chip and the
watchdog function is in this companion chip. We must use a different
unlocking sequence to access the companion chip.

Use DMI strings to identify such system and adjust the unlocking
sequence automatically.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-09 15:03:28 +01:00
Yangtao Li 06f8f2ca05 watchdog: cpwd: add of_node_put()
use of_node_put() to release the refcount.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-09 15:03:27 +01:00
Wolfram Sang e990e12741 watchdog: renesas_wdt: don't set divider while watchdog is running
The datasheet says we must stop the timer before changing the clock
divider. This can happen when the restart handler is called while the
watchdog is running.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-12-09 15:03:27 +01:00
Masahiro Yamada 0126be38d9 kbuild: announce removal of SUBDIRS if used
SUBDIRS has been kept as a backward compatibility since
commit ("[PATCH] kbuild: external module support") in 2002.

We do not need multiple ways to do the same thing, so I will remove
SUBDIRS after the Linux 5.3 release. I cleaned up in-tree code, and
updated the document so that nobody would try to use it.

Meanwhile, display the following warning if SUBDIRS is used.

Makefile:189: ================= WARNING ================
Makefile:190: 'SUBDIRS' will be removed after Linux 5.3
Makefile:191: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:192: ==========================================

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com> # for scx200_docflash.c
Acked-by: Guenter Roeck <linux@roeck-us.net> # for scx200_wdt.c
2018-12-01 22:21:56 +09:00
Tomer Maimon 7db706a218 watchdog: npcm: Modify npcm watchdog kconfig arch parameter
Modify Nuvoton watchdog Kconfig default supported architecture
name to ARCH_NPCM7XX because ARCH_NPCM750 architecture name
is not supported.

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-11-17 09:53:26 +01:00
Fabrizio Castro f8cde72673 watchdog: renesas_wdt: Fix typos
Do not use "," but ";" to separate instructions.

Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-11-17 09:53:26 +01:00
Alexey Khoroshilov cd6ba41c19 watchdog: ts4800: release syscon device node in ts4800_wdt_probe()
Put syscon device node when it is not needed anymore.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-22 10:16:28 +02:00
Marek Behún c8ca6e70fb watchdog: armada_37xx_wdt: use do_div for u64 division
When the driver is built on 32 bit architectures during compile test,
the linker complains about "__udivdi3" being undefined. We have to use
do_div macro instead of the division operator when dividing u64 value.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-13 15:19:43 +02:00
Marek Behún 54e3d9b518 watchdog: Add support for Armada 37xx CPU watchdog
This adds support for the CPU watchdog found on Marvell Armada 37xx
SoCs.

There are 4 counters which can be set as CPU watchdog counters.
This driver uses the second counter (ID 1, counting from 0) as watchdog
counter, and first counter (ID 0) to implement pinging on the second
counter without the need to disable it.

Since counters IDs 2 and 3 are enabled already before even U-Boot
starts, this driver does not use them at all, for example by adding a
device tree property for counter selection.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-13 15:19:39 +02:00
Christophe Leroy 38e48b7189 watchdog: mpc8xxx: provide boot status
mpc8xxx watchdog driver supports the following platforms:
- mpc8xx
- mpc83xx
- mpc86xx

Those three platforms have a 32 bits register which provides the
reason of the last boot, including whether it was caused by the
watchdog.

mpc8xx: Register RSR, bit SWRS (bit 3)
mpc83xx: Register RSR, bit SWRS (bit 28)
mpc86xx: Register RSTRSCR, bit WDT_RR (bit 11)

This patch maps the register as defined in the device tree and updates
wdt.bootstatus based on the value of the watchdog related bit. Then
the information can be retrieved via the WDIOC_GETBOOTSTATUS ioctl.

Hereunder is an example of devicetree for mpc8xx,
the Reset Status Register being at offset 0x288:

		WDT: watchdog@0 {
			compatible = "fsl,mpc823-wdt";
			reg = <0x0 0x10 0x288 0x4>;
		};

On the mpc83xx, RSR is at offset 0x910
On the mpc86xx, RSTRSCR is at offset 0xe0094

Suggested-by: Radu Rendec <radu.rendec@gmail.com>
Tested-by: Christophe Leroy <christophe.leroy@c-s.fr> # On mpc885
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-13 15:19:38 +02:00
Chris Brandt 8e89130632 watchdog: rza_wdt: Support longer timeouts
The RZ/A2 watchdog timer extends the clock source options in order to
allow for longer timeouts.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:29 +02:00
Jerry Hoemann 10d790d1fa watchdog: hpwdt: Disable PreTimeout when Timeout is smaller
During module install, disable pretimeout if the requested timeout
value is not greater than the minimal pretimeout value that is
supported by hardware.

This makes the module load handling of pretimeout consistent
with the ioctl handling of pretimeout.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:28 +02:00
Guenter Roeck 57cbf0e3a0 watchdog: w83627hf_wdt: Support NCT6796D, NCT6797D, NCT6798D
The watchdog controller on NCT6796D, NCT6797D, and NCT6798D is compatible
with the wtachdog controller on other Nuvoton chips.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:28 +02:00
Christophe Leroy 79b10e09bb watchdog: mpc8xxx: use dev_xxxx() instead of pr_xxxx()
mpc8xxx watchdog driver is a platform device drivers, it is
therefore possible to use dev_xxx() messaging rather than pr_xxx()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:28 +02:00
Hauke Mehrtens c99d9df1d3 watchdog: lantiq: add get_timeleft callback
This callback will provide the current time left.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:27 +02:00
Hauke Mehrtens dcd7e04e8e watchdog: lantiq: Convert to watchdog_device
Instead of doing the ioctl handling manually just use register a
watchdog_device and let the watchdog framework do the ioctl handling.

This also removes the ltq_wdt_bootstatus_set typedef and replaces it
with a structure providing the chip specific functions pointer.
The watchdog_init_timeout() function is now used and the initial timeout
can be provided in device tree.
If the watchdog was already activated it will not be stopped any more,
but the settings from the driver will be used and the watchdog subsystem
will take care.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:26 +02:00
Hauke Mehrtens 1f59f8aff9 watchdog: lantiq: update register names to better match spec
Some of the names of the bits were confusing to me.
Now the bits share the same prefix as the register they are set on.

The LTQ_WDT_CR_PWL register (bits 26:25) is the pre warning limit and it
does not turn anything on. It has 4 possible divers 1/2, 1/4, 1/8 and
1/16, this drivers only uses 1/16.
The LTQ_WDT_CR_CLKDIV register bits(25:24) is only configuring a clock
divers and do not turn any thing on too, all possible values are valid
dividers.
Using the LTQ_WDT_SR prefix is also wrong these bits are used in the
LTQ_WDT_CR registers, SR is the status register which is read only.

This uses GENMASK where it is a mask and it uses shifts when a value is
written to some bits.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:26 +02:00
Romain Izard 2e0432f8f8 watchdog: sama5d4: fix timeout-sec usage
When using watchdog_init_timeout to update the default timeout value,
an error means that there is no "timeout-sec" in the relevant device
tree node.

This should not prevent binding of the driver to the device.

Fixes: 976932e400 ("watchdog: sama5d4: make use of timeout-secs provided in devicetree")
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:26 +02:00
Robert P. J. Day d08ec7bea2 watchdog: fix a small number of "watchog" typos in comments
All typos in comments, should not affect functionality.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:25 +02:00
Kuninori Morimoto d674ee232b watchdog: rza_wdt: convert to SPDX identifiers
This patch updates license to use SPDX-License-Identifier
instead of verbose license text.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:25 +02:00
Jean Delvare 5a623ce0a5 watchdog: iTCO_wdt: Remove unused hooks
As the only user of iTCO_vendor_pre_keepalive and
iTCO_vendor_pre_set_heartbeat has just been removed, we can delete
these 2 hooks.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Martin Wilck <mwilck@suse.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:25 +02:00
Jean Delvare 2c05318ad5 watchdog: iTCO_wdt: Drop option vendorsupport=2
iTCO_vendor_support's option vendorsupport=2 is a gross hack. It
claims to extend the existing iTCO_wdt driver, but in fact programs
a watchdog on a completely different device (Super-I/O) without
requesting its I/O ports and without checking the device ID. This is
an utterly dangerous thing to do.

It also turns out to be unnecessary, because as far as I can tell, the
code in question is basically duplicating what the clean w83627hf_wdt
driver is doing.

My guess is that on these SuperMicro boards which sparkled the
implementation of vendorsupport=2, the watchdog functionality of the
Intel south bridge is not used, and the watchdog feature of some
W83627HF-like Super-I/O chip is used instead. So we should point the
users to the w83627hf_wdt driver.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Martin Wilck <mwilck@suse.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:24 +02:00
Wolfram Sang 14de99b44b watchdog: renesas_wdt: stop when unregistering
We want to go into a sane state when unregistering. Currently, it
happens that the watchdog stops when unbinding because of RuntimePM
stopping the core clock. When rebinding, the core clock gets reactivated
and the watchdog fires even though it hasn't been opened by userspace
yet. Strange scenario, yes, but sane state is much preferred anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:24 +02:00
Wolfram Sang 953b9dd772 watchdog: core: fix null pointer dereference when releasing cdev
watchdog_stop() calls watchdog_update_worker() which needs a valid
wdd->wd_data pointer. So, when unregistering the cdev, clear the
pointers after we call watchdog_stop(), not before.

Fixes: bb292ac1c6 ("watchdog: Introduce watchdog_stop_on_unregister helper")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:24 +02:00
Wolfram Sang 3bed02a296 watchdog: renesas_wdt: use SPDX identifier for Renesas drivers
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:23 +02:00
Jerry Hoemann e1c7f79ea5 watchdog: hpwdt: Update version number.
Bump version number to reflect recent bug fixes.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:22 +02:00
Jerry Hoemann 397a35d418 watchdog: hpwdt: Module paramerter alias.
Add module parameter "timeout" as an alias to "soft_margin."
This aligns hpwdt usage more closely with other WDT while
retaining backwards compatibility.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:22 +02:00
Jerry Hoemann 923014619e watchdog: hpwdt: Display module parameters.
Print module parameters when the driver is loaded.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:22 +02:00
Jerry Hoemann 093d43858d watchdog: hpwdt: Claim NMI from iLO
The hwpdt driver is overloaded for handling both the iLO
watchdog and the explicit "Generate NMI to System" virutal
button.  Hence NMI handler needs to claim NMI resulting
from the virutal button.

Claim if iLO generated accommodating firmware that might
set wrong bit.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:21 +02:00
Jerry Hoemann 4d9186d01e watchdog: hpwdt: Initialize pretimeout from module parameter.
When the pretimeout is specified as a module parameter, the
value should be reflected in hpwdt_dev.pretimeout.  The default
(on) case is correct.  But, when disabling pretimeout, the value
should be set to zero in hpwdt_dev.

When compiling w/o CONFIG_HPWDT_NMI_DECODING defined, the pretimeout
module parameter is ignored and the value internally will be 0.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-10-02 13:32:21 +02:00
Nick Desaulniers 815f0ddb34 include/linux/compiler*.h: make compiler-*.h mutually exclusive
Commit cafa0010cd ("Raise the minimum required gcc version to 4.6")
recently exposed a brittle part of the build for supporting non-gcc
compilers.

Both Clang and ICC define __GNUC__, __GNUC_MINOR__, and
__GNUC_PATCHLEVEL__ for quick compatibility with code bases that haven't
added compiler specific checks for __clang__ or __INTEL_COMPILER.

This is brittle, as they happened to get compatibility by posing as a
certain version of GCC.  This broke when upgrading the minimal version
of GCC required to build the kernel, to a version above what ICC and
Clang claim to be.

Rather than always including compiler-gcc.h then undefining or
redefining macros in compiler-intel.h or compiler-clang.h, let's
separate out the compiler specific macro definitions into mutually
exclusive headers, do more proper compiler detection, and keep shared
definitions in compiler_types.h.

Fixes: cafa0010cd ("Raise the minimum required gcc version to 4.6")
Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Suggested-by: Eli Friedman <efriedma@codeaurora.org>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-22 17:31:34 -07:00
Linus Torvalds 6eaac34ff3 linux-watchdog 4.19-rc1 tag
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iEYEABECAAYFAlt2pvIACgkQ+iyteGJfRspSxgCggHiSqO+sb1F+h4QyWlh45o9S
 laAAoJL0ZAXSrlA/rAt5FCKCeSZiNZG2
 =hCTY
 -----END PGP SIGNATURE-----

Merge tag 'linux-watchdog-4.19-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - add MEN 16z069 IP-Core driver

 - renesas-wdt: add support for the R8A77990 wdt

 - stm32_iwdg: Add stm32mp1 support and pclk feature

 - sp805_wdt, orion_wdt, sprd_wdt: several improvements

 - imx2_wdt, stmp3xxx: switch to SPDX identifier

* tag 'linux-watchdog-4.19-rc1' of git://www.linux-watchdog.org/linux-watchdog:
  watchdog: fix dependencies of menz69_wdt.o
  watchdog: sp805: Add clock-frequency property
  watchdog: add driver for the MEN 16z069 IP-Core
  watchdog: sprd_wdt: Remove redundant dev_err call in sprd_wdt_probe()
  watchdog: stmp3xxx: Switch to SPDX identifier
  watchdog: imx2_wdt: Switch to SPDX identifier
  watchdog: sp805: set WDOG_HW_RUNNING when appropriate
  watchdog: sp805: add 'timeout-sec' DT property support
  dt-bindings: watchdog: Add optional 'timeout-sec' property for sp805
  dt-bindings: watchdog: Consolidate SP805 binding docs
  watchdog: orion_wdt: Mark watchdog as active when running at probe
  watchdog: stm32: add pclk feature for stm32mp1
  dt-bindings: watchdog: add stm32mp1 support
  dt-bindings: watchdog: renesas-wdt: Add support for the R8A77990 wdt
2018-08-18 16:16:57 -07:00
Johannes Thumshirn 12aea518a2 watchdog: fix dependencies of menz69_wdt.o
Currently menz69_wdt.ko has a dependency on MCB or COMPILE_TEST. But
it actually needs symbols exported by MCB so the || COMPILE_TEST is
wrong.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-08-06 17:12:42 +02:00
Srinath Mannam dc0e4a3bb7 watchdog: sp805: Add clock-frequency property
Use clock-frequency property given in _DSD object
of ACPI device to calculate Watchdog rate as binding
clock devices are not available as device tree.

Note: There is no formal review process for _DSD
properties

Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-08-06 17:12:41 +02:00
Johannes Thumshirn 81ceed41d0 watchdog: add driver for the MEN 16z069 IP-Core
Add a driver for the MEN 16z069 Watchdog and Reset Controller IP-Core.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Michael Moese <mmoese@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-08-02 15:57:12 +02:00
Wei Yongjun 28e65edd73 watchdog: sprd_wdt: Remove redundant dev_err call in sprd_wdt_probe()
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
2018-08-02 15:57:12 +02:00