Skip to contentSkip to conversation

watchdog - v4.8 Merge Window

GIT PULL Wim Van Sebroeck 1 participant 1 message Jul 31, 2016

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

Hi Linus,

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

This pull request contains
* New driver for the watchdog in Aspeed SoCs
* New driver for the watchdog in Maxim PMIC MAX77620
* New driver for the watchdog in Amlogic Meson GXBB SoC
* Support for the r8a7796 watchdog device
* Support for F81866 watchdog device
* Support for 5th variation of Apollo Lake
* Support for MCP78S chipset
* clean-up of softdog.c watchdog device driver
* pic32-wdt and pic32-dmt fixes
* core: min and max timeout improvements, WDOG_HW_RUNNING improvements, status funtionality
* core: Add a device managed API for watchdog_register_device()
* Documentation/watchdog: watchdog-test improvements
* Several other fixes and improvements

This will update the following files:

 Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt     |   16 
 Documentation/devicetree/bindings/watchdog/meson-gxbb-wdt.txt |   16 
 Documentation/devicetree/bindings/watchdog/qcom-wdt.txt       |    4 
 Documentation/devicetree/bindings/watchdog/renesas-wdt.txt    |    5 
 Documentation/driver-model/devres.txt                         |    3 
 Documentation/watchdog/hpwdt.txt                              |    5 
 Documentation/watchdog/src/watchdog-test.c                    |   39 -
 Documentation/watchdog/watchdog-kernel-api.txt                |    9 
 MAINTAINERS                                                   |    6 
 arch/arm/boot/dts/qcom-apq8064.dtsi                           |    3 
 arch/arm/boot/dts/qcom-ipq4019.dtsi                           |    2 
 arch/arm/boot/dts/qcom-ipq8064.dtsi                           |    3 
 arch/arm/boot/dts/qcom-msm8960.dtsi                           |    3 
 drivers/platform/x86/intel_pmc_ipc.c                          |   10 
 drivers/watchdog/Kconfig                                      |   33 +
 drivers/watchdog/Makefile                                     |    3 
 drivers/watchdog/aspeed_wdt.c                                 |  212 +++++++
 drivers/watchdog/bcm2835_wdt.c                                |   11 
 drivers/watchdog/da9063_wdt.c                                 |    2 
 drivers/watchdog/f71808e_wdt.c                                |   28 -
 drivers/watchdog/gpio_wdt.c                                   |    2 
 drivers/watchdog/iTCO_wdt.c                                   |    2 
 drivers/watchdog/max77620_wdt.c                               |  227 ++++++++
 drivers/watchdog/meson_gxbb_wdt.c                             |  270 ++++++++++
 drivers/watchdog/nv_tco.c                                     |    2 
 drivers/watchdog/pcwd.c                                       |   14 
 drivers/watchdog/pic32-dmt.c                                  |    5 
 drivers/watchdog/pic32-wdt.c                                  |    9 
 drivers/watchdog/qcom-wdt.c                                   |   69 +-
 drivers/watchdog/sbsa_gwdt.c                                  |   16 
 drivers/watchdog/sirfsoc_wdt.c                                |   15 
 drivers/watchdog/softdog.c                                    |   92 ---
 drivers/watchdog/tangox_wdt.c                                 |    4 
 drivers/watchdog/watchdog_core.c                              |   39 +
 drivers/watchdog/watchdog_dev.c                               |   61 +-
 drivers/watchdog/ziirave_wdt.c                                |    2 
 include/linux/watchdog.h                                      |    6 
 37 files changed, 1062 insertions(+), 186 deletions(-)

with these Changes:

commit 1ac06563434e5f3302259608d3589bf7002431fe

Author: Wei Yongjun <[email protected]>
Date:   Tue Jul 26 14:50:14 2016 +0000

watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()

Add missing platform_set_drvdata() in gpio_wdt_probe(), otherwise calling platform_get_drvdata() in remove returns NULL.

This is detected by Coccinelle semantic patch.

commit 3c10bbde10fe4dca52726e246cefa6b0a1dfbd3e

Author: Guenter Roeck <[email protected]>
Date:   Thu Jul 21 14:21:56 2016 -0700

watchdog: core: Clear WDOG_HW_RUNNING before calling the stop function

WDOG_HW_RUNNING indicates that the hardware watchdog is running while the watchdog device is closed. The flag may be set by the driver when it is instantiated to indicate that the watchdog is running, and that the watchdog core needs to send heartbeat requests to the driver until the watchdog device is opened.

When the watchdog device is closed, the flag can be used by the driver's stop function to indicate to the watchdog core that it was unable to stop the watchdog, and that the watchdog core needs to send heartbeat requests. This only works if the flag is actually cleared when the watchdog is stopped. To avoid having to clear the flag in each driver's stop function, clear it in the watchdog core before calling the stop function.

Fixes ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag")

commit 138913cb632be12344982e54ccd12f6f15971bf7

Author: Wei Yongjun <[email protected]>
Date:   Tue Jul 19 11:22:34 2016 +0000

watchdog: core: Fix error handling of watchdog_dev_init()

Fix the error handling paths of watchdog_dev_init().

commit cddd74db8d42b953a0612810f07c99e73deab185

Author: Wei Yongjun <[email protected]>
Date:   Tue Jul 19 11:21:56 2016 +0000

watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()

In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.

commit 919edd5119796f1cc3b47f23e7e15cc0f46942ba

Author: Wei Yongjun <[email protected]>
Date:   Tue Jul 19 11:35:11 2016 +0000

watchdog: pic32-dmt: Remove .owner field for driver

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

commit aa4614d15990fcbe93969dee600361d47d28885f

Author: Wei Yongjun <[email protected]>
Date:   Tue Jul 19 11:35:19 2016 +0000

watchdog: pic32-wdt: Remove .owner field for driver

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

commit c682b5cb7ee0d5430e952956603888d7ffebc27a

Author: Geert Uytterhoeven <[email protected]>
Date:   Tue Jul 19 13:46:54 2016 +0200

watchdog: renesas-wdt: Add support for the r8a7796 wdt

Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car M3-W (r8a7796) SoC.

No driver update is needed.

commit 9dd8d5f870f44597c67d0e5f72753b9d02810308

Author: Arnd Bergmann <[email protected]>
Date:   Tue Jul 19 17:41:22 2016 +0200

Documentation/watchdog: check return value for magic close

A recent commit added a write to the watchdog test code for doing the "magic close", but that caused a compile-time warning:

Documentation/watchdog/src/watchdog-test.c: In function ‘main’:
Documentation/watchdog/src/watchdog-test.c:94:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]

This changes the code to print a runtime warning if the write fails.

Fixes 5a2d3de19602 ("Documentation/watchdog: add support for magic close to watchdog-test")

commit e035d8f787b1de664fcac5eb84643f8c374284c4

Author: Guenter Roeck <[email protected]>
Date:   Sun Jul 17 15:04:12 2016 -0700

watchdog: sbsa: Drop status function

The watchdog status function is supposed to return WDIOF_ flags, not internal status flags. The available WDIOF_ flags are now returned by the watchdog core, so the status function in this driver is unnecessary.

commit 90b826f17a4e1c4ff2b3ef69512a6409e94f4d64

Author: Guenter Roeck <[email protected]>
Date:   Sun Jul 17 15:04:11 2016 -0700

watchdog: Implement status function in watchdog core

Up to now, the watchdog status function called a driver function, which was supposed to return the watchdog status. All but one driver using the watchdog core did not implement this function, and the driver implementing it did not implement it correctly (the function is supposed to return WDIOF_ flags). At the same time, at least some of the status information can be provided by the watchdog core.

Provide the available status bits directly from the watchdog driver core. Call the driver status function if it exists to get the boot status, but always provide WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING internally. This patch makes the 'status' sysfs attribute always available. This attribute is now displayed as hex number with 0x prepended to be easier to decode.

commit c7ef68c32265a396a4d977f896a11a4cebb0ace4

Author: Guenter Roeck <[email protected]>
Date:   Sun Jul 17 13:47:47 2016 -0700

watchdog: tangox: Set max_hw_heartbeat_ms instead of max_timeout

Setting max_hw_heartbeat_ms lets the watchdog core provide a virtual timeout if the timeout requested by user space is larger than the maximum hardware timeout. Also, it helps the watchdog core to provide heartbeats if the hardware watchdog is running while closed.

Fixes a3e376d26ace ("watchdog: tangox: Mark running watchdog correctly")

commit 3fbfe9264756d3fd99a9210345016c94ec4ada73

Author: Rasmus Villemoes <[email protected]>
Date:   Thu Jul 14 11:16:26 2016 +0200

watchdog: change watchdog_need_worker logic

If the driver indicates that the watchdog is running, the framework should feed it until userspace opens the device, regardless of whether the driver has set max_hw_heartbeat_ms.

This patch only affects the case where wdd->max_hw_heartbeat_ms is zero, wdd->timeout is non-zero, the watchdog is not active and the hardware device is running (*):

- If wdd->timeout is zero, watchdog_need_worker() returns false both before and after this patch, and watchdog_next_keepalive() is not called.

- If watchdog_active(wdd), the return value from watchdog_need_worker is also the same as before (namely, hm && t > hm). Hence in that case, watchdog_next_keepalive() is only called if hm == max_hw_heartbeat_ms is non-zero, so the change to min_not_zero there is a no-op.

- If the watchdog is not active and the device is not running, we return false from watchdog_need_worker just as before.

That leaves the watchdog_hw_running(wdd) && !watchdog_active(wdd) && wdd->timeout case. Again, it's easy to see that if wdd->max_hw_heartbeat_ms is non-zero, we return true from watchdog_need_worker with and without this patch, and the logic in watchdog_next_keepalive is unchanged. Finally, if wdd->max_hw_heartbeat_ms is 0, we used to end up in the cancel_delayed_work branch, whereas with this patch we end up scheduling a ping timeout_ms/2 from now.

(*) This should imply that no current kernel drivers are affected, since the only drivers which explicitly set WDOG_HW_RUNNING are imx2_wdt.c and dw_wdt.c, both of which also provide a non-zero value for max_hw_heartbeat_ms. The watchdog core also sets WDOG_HW_RUNNING, but only when the driver doesn't provide ->stop, in which case it must, according to Documentation/watchdog/watchdog-kernel-api.txt, set max_hw_heartbeat_ms.

commit 65b5b5e6480718e8cb5b6a1d32a7cb4efb9d93a9

Author: Alexey Kunitskiy <[email protected]>
Date:   Sun Jul 17 19:34:24 2016 +0300

watchdog: add support for MCP78S chipset in nv_tco

Add support for MCP78S chipset in nv_tco watchdog driver

commit 960ae4ea776e160b3c47dc4b461e6f42ef2f659a

Author: Rasmus Villemoes <[email protected]>
Date:   Fri Jul 15 10:15:22 2016 +0200

watchdog: bcm2835_wdt: remove redundant ->set_timeout callback

bcm2835_wdt_set_timeout does exactly what the watchdog framework does in the absence of a ->set_timeout callback (see watchdog_set_timeout in watchdog_dev.c), so remove it.

commit aea4b477b96a1e098bdd39a7503eb4163cf65dbb

Author: Rasmus Villemoes <[email protected]>
Date:   Fri Jul 15 10:15:21 2016 +0200

watchdog: bcm2835_wdt: constify _ops and _info structures

These are never modified, so might as well be const.

commit 80cdd91d3faf8d25977bcbf74613761eef912aab

Author: Neil Armstrong <[email protected]>
Date:   Sun Jul 10 11:11:05 2016 +0200

dt-bindings: watchdog: Add Meson GXBB Watchdog bindings

commit 683fa50f0e18cb12da41a7df41cc1fa8b002e071

Author: Neil Armstrong <[email protected]>
Date:   Sun Jul 10 11:11:04 2016 +0200

watchdog: Add Meson GXBB Watchdog Driver

Add watchdog specific driver for Amlogic Meson GXBB SoC.

commit 10073a205df269abcbd9c3fbc690a813827107ef

Author: Matthew McClintock <[email protected]>
Date:   Tue Jun 28 11:35:21 2016 -0700

watchdog: qcom: configure BARK time in addition to BITE time

For certain parts and some versions of TZ, TZ will reset the chip when a BARK is triggered even though it was not configured here. So by default let's configure this BARK time as well.

commit f0d9d0f4b44ae5503ea368e7f066b20f12ca1d37

Author: Matthew McClintock <[email protected]>
Date:   Wed Jun 29 10:50:01 2016 -0700

watchdog: qcom: add option for standalone watchdog not in timer block

Commit 0dfd582e026a ("watchdog: qcom: use timer devicetree binding") moved to use the watchdog as a subset timer register block. Some devices have the watchdog completely standalone with slightly different register offsets as well so let's account for the differences here.

The existing "kpss-standalone" compatible string doesn't make it entirely clear exactly what the device is so rename to "kpss-wdt" to reflect watchdog timer functionality. Also update ipq4019 DTS with an SoC specific compatible.

commit 6e062696d7ffa4e574f74514906e04508917c876

Author: Matthew McClintock <[email protected]>
Date:   Wed Jun 29 10:50:00 2016 -0700

watchdog: qcom: update device tree bindings

Update the compatible string to align with driver and also add SoC specific string to DTS.

commit a74cab40b5dc51b5ed042add1c5d2f5e9a1964bc

Author: Stefan Christ <[email protected]>
Date:   Wed Jul 6 10:40:11 2016 +0200

watchdog: da9063_wdt: don't trigger watchdog too fast

Triggering the watchdog faster than T_WDMIN=256ms leads to resets of the DA9063 chip. The datasheet says that the watchdog must only be triggered in the timeframe T_WDMIN to T_WDMAX. The T_WDMAX is configured in the driver.

commit 5a2d3de1960260f34da84ac27bdc1345b541f2e8

Author: Timur Tabi <[email protected]>
Date:   Tue Jun 21 18:00:15 2016 -0500

Documentation/watchdog: add support for magic close to watchdog-test

Some drivers have the WDIOF_MAGICCLOSE set, which means that applications need to write 'V' to the watchdog device before closing, otherwise the driver won't stop the watchdog timer.

commit ee279c2734b07fb74031b1626b0f097cee9de5c8

Author: Timur Tabi <[email protected]>
Date:   Tue Jun 21 18:00:14 2016 -0500

Documentation/watchdog: use stdout instead of stderr in watchdog-test

The watchdog-test utility outputs all messages to stderr, even those that are not error messages. Output to stdout instead.

Instead of flushing the output after every write, just disabled the output buffer.

Also display a dot for every ping of the watchdog, so that the user knows that it's working.

commit 334da2d6753ba548851c6329c4b6e74eb731368a

Author: Yong, Jonathan <[email protected]>
Date:   Fri Jun 17 00:33:32 2016 +0000

x86: Fix Apollo Lake Watchdog address in PMC driver

The TCO I/O base is 40h rather than the usual 30h, and the re_reboot bit is at ACPIBASE+8.

commit 3b3a1c8fbb36f8e077b6ac09bcac03024d5bfa5c

Author: Yong, Jonathan <[email protected]>
Date:   Fri Jun 17 00:33:31 2016 +0000

watchdog: iTCO-wdt: handle 5th variation for Apollo Lake

The Apollo Lake Watchdog has the no_reboot flag in the 4th bit.

commit fafdbabaf5c6a949168b384e159152f6e37427ba

Author: Wei Yongjun <[email protected]>
Date:   Fri Jun 17 17:12:05 2016 +0000

watchdog: pic32-dmt: Fix return value check in pic32_dmt_probe()

In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.

commit db6d2d0e6d24176f524359bff2f209f0c8425496

Author: Wei Yongjun <[email protected]>
Date:   Fri Jun 17 17:11:35 2016 +0000

watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()

In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test.

commit 22daf7a71683185db6bcb089e006be5f99dddf9c

Author: Enric Balletbo i Serra <[email protected]>
Date:   Sat Jul 9 11:43:19 2016 +0200

watchdog: ziirave_wdt: Correct I2C device id to fix module autoloading.

The I2C core removes the manufacturer prefix from the compatible field so it reports to user-space the uevent i2c:rave-wdt, but this doesn't match with the i2c_device_id (i2c:ziirave-wdt) array so the module is not autoloaded. Correct the I2C device id to match with the reported uevent and fix the module autoloading functionality.

commit ff9cc8384a3efba7e3daedf66dfd58b0a0fff069

Author: Vladimir Zapolskiy <[email protected]>
Date:   Wed Jun 8 18:16:15 2016 +0300

watchdog: drop redundant 'default n' option for WATCHDOG_SYSFS

The option 'default n' and its absence are equal for kbuild, which makes explicit 'default n' redundant.

commit ff3bb2f5c3cd70f4dd642525916f300bffaff0ae

Author: Laxman Dewangan <[email protected]>
Date:   Thu Jun 9 18:59:05 2016 +0530

watchdog: max77620: Add support for watchdog timer

Maxim PMIC MAX77620 is Power management IC which have multiple sub blocks like regulators (DCDC/LDOs), GPIO, RTC, Clock, Watchdog timer etc.

Add the driver for watchdog timer under watchdog framework. The driver implements the watchdog callbacks to start, stop, ping and set timeout for watchodg framework.

commit 14b24a88a36602c2c4e3bbb955be1aa9378c3be2

Author: Ji-Ze Hong (Peter Hong) <[email protected]>
Date:   Wed Jun 8 14:57:50 2016 +0800

watchdog: f71808e_wdt: Add F81866 support

Adds watchdog enable support for Fintek F81866 Super-IO chip to Fintek wdt driver (f71808e_wdt)

Tested and verified on iBASE MI802 Industrial PC

Datasheet references:
http://www.alldatasheet.com/datasheet-pdf/pdf/459085/FINTEK/F81866AD-I.html

commit b99c87740541f04cec056978452d7913da6ac9a5

Author: Ben Dooks <[email protected]>
Date:   Tue Jun 7 12:53:07 2016 +0100

watchdog: sirf: fix __iomem * warnings

Fix the following warnings from sparse due to casting to/from an __iomem annotated variable:

drivers/watchdog/sirfsoc_wdt.c:48:18: warning: incorrect type in assignment (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:48:18: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:48:18: got void *
drivers/watchdog/sirfsoc_wdt.c:64:18: warning: incorrect type in assignment (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:64:18: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:64:18: got void *
drivers/watchdog/sirfsoc_wdt.c:82:54: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:82:54: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:82:54: got void *
drivers/watchdog/sirfsoc_wdt.c:99:54: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:99:54: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:99:54: got void *
drivers/watchdog/sirfsoc_wdt.c:153:44: warning: incorrect type in argument 2 (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:153:44: expected void *data
drivers/watchdog/sirfsoc_wdt.c:153:44: got void [noderef] <asn:2>*[assigned] base

commit a3e376d26ace6d823f7aa4c63476e7089a6196df

Author: Guenter Roeck <[email protected]>
Date:   Fri May 27 15:28:00 2016 -0700

watchdog: tangox: Mark running watchdog correctly

A running watchdog is marked with WDOG_HW_RUNNING, not with WDOG_ACTIVE. WDOG_ACTIVE indicates that the watchdog device has been opened from user space.

commit f9f535c1b76128f94dae7a4bb41464aacd4c10ec

Author: Guenter Roeck <[email protected]>
Date:   Fri May 27 14:19:06 2016 -0700

watchdog: Improve description of min_hw_heartbeat_ms

The description of min_hw_heartbeat_ms is misleading and needs some improvements.

commit c3c1e29c8ad11dec67d01203759272da0d0df3aa

Author: Pratyush Anand <[email protected]>
Date:   Tue May 31 14:08:10 2016 +0800

watchdog: sbsa: Set WDOG_HW_RUNNING, when watchdog is already running.

This patch uses the new flag WDOG_HW_RUNNING in driver. According to the definition of this flag, it should be set, if watchdog is running after booting, before it's opened.

commit e05e80eb58cc9679d0ff8de5af095a66ba855e10

Author: Pratyush Anand <[email protected]>
Date:   Tue May 31 14:08:09 2016 +0800

watchdog: sbsa: Use max_hw_heartbeat_ms instead of max_timeout

Using max_hw_heartbeat_ms instead of max_timeout gives the flexibility to achieve higher user "timeout". Therefore, use this new infrastructure.

commit 1894cad9bf2c10359b2b7a0c00e564698f712751

Author: Pratyush Anand <[email protected]>
Date:   Tue May 31 14:08:08 2016 +0800

watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms is defined

When max_hw_heartbeat_ms has a none zero value, max_timeout is not used. So it's value can be 0. In such case if a driver uses min_timeout functionality, then check will always fail.

This patch fixes above issue.

commit b7a8c420f31eaf521f66f093a1a00e92718dd193

Author: William Breathitt Gray <[email protected]>
Date:   Wed Jun 1 09:05:48 2016 -0400

watchdog: pcwd: Utilize the module_isa_driver macro

This driver does not do anything special in module init/exit. This patch eliminates the module init/exit boilerplate code by utilizing the module_isa_driver macro.

commit efa859f7d7860f73396c1ff28017e55b5b403e82

Author: Joel Stanley <[email protected]>
Date:   Wed May 18 17:51:00 2016 +0930

watchdog: Add Aspeed watchdog driver

Provides generic watchdog features as well as reboot support for the Aspeed SoCs.

commit 0c9444cc9e031541694268e58d4b999a6ee258e3

Author: Joel Stanley <[email protected]>
Date:   Wed May 18 17:50:59 2016 +0930

dt-bindings: watchdog: Add Aspeed watchdog timer bindings

commit 4a23e2bf032fdceecef1ab314c7f84d9c2050490

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:49 2016 +0200

watchdog: softdog: improve coding style

commit 61a21274c9eee5a3adb85441a91a071de4260863

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:48 2016 +0200

watchdog: softdog: drop superfluous set_timeout callback

If we leave set_timeout empty, the core will do exactly what is implemented here anyway.

commit e65c5825c6ef850a26cd449157024bad6e2eec9c

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:47 2016 +0200

watchdog: softdog: sort includes to avoid duplicates

commit 44ba0f04af44d7f3a157ee655bdfc53660d8faf9

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:46 2016 +0200

watchdog: softdog: remove forward declaration

commit 0efc70b8238dc6d26289b501f126798b9d0da601

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:45 2016 +0200

watchdog: softdog: consistently use softdog_ prefix

And move module_init/exit to the proper place while here.

commit e8cf96abba977b6d66bfc2bbc5248a924c9edaec

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:44 2016 +0200

watchdog: softdog: use watchdog core to init timeout value

Error string and comment say we fall back to a default, but in reality we bailed out. Refactor the code to use the core helper which then matches the described behaviour. While updating the init message anyhow, shorten it while we are here; no need for versioning there as well and the name is already given via pr_fmt.

commit 9c963ba0e0bacfb13c41d3334630ff67044ac159

Author: Wolfram Sang <[email protected]>
Date:   Wed May 25 08:37:43 2016 +0200

watchdog: softdog: remove obsolete comments

The history is obsolete, especially since we switched to watchdog framework. The section markers also don't make sense anymore given the small size of the driver.

commit 214de83ec2be9309667baf181b14c603aeb962be

Author: Brian Boylston <[email protected]>
Date:   Wed May 25 11:19:54 2016 -0500

MAINTAINERS: add entry for HPE watchdog driver

Add a maintainer for the HPE watchdog driver

commit 0215efc02e32d0a806ad13be7e43c6784428b334

Author: Brian Boylston <[email protected]>
Date:   Wed May 25 11:20:15 2016 -0500

watchdog: hpwdt: remove email address from doc

Remove Tom's email address from the documentation

commit 83fbae5a148cc1cd53e5be1a28edb3b6701b7af2

Author: Neil Armstrong <[email protected]>
Date:   Fri May 27 17:33:54 2016 +0200

watchdog: Add a device managed API for watchdog_register_device()

This helps in reducing code in .remove callbacks and sometimes dropping .remove callbacks entirely.

For completeness, I added the overal diff below.

Greetings,
Wim.

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

Documentation/devicetree/bindings/watchdog/aspeed-wdt.txt new file +16 -0
new file mode 100644
index 0000000..c5e74d7
@@ -0,0 +1,16 @@
+Aspeed Watchdog Timer
+
+Required properties:
+ - compatible: must be one of:
+	- "aspeed,ast2400-wdt"
+	- "aspeed,ast2500-wdt"
+
+ - reg: physical base address of the controller and length of memory mapped
+   region
+
+Example:
+
+	wdt1: watchdog@1e785000 {
+		compatible = "aspeed,ast2400-wdt";
+		reg = <0x1e785000 0x1c>;
+	};
Documentation/devicetree/bindings/watchdog/meson-gxbb-wdt.txt new file +16 -0
new file mode 100644
index 0000000..c7fe36f
@@ -0,0 +1,16 @@
+Meson GXBB SoCs Watchdog timer
+
+Required properties:
+
+- compatible : should be "amlogic,meson-gxbb-wdt"
+- reg : Specifies base physical address and size of the registers.
+- clocks : Should be a phandle to the Watchdog clock source, for GXBB the xtal
+	   is the default clock source.
+
+Example:
+
+wdt: watchdog@98d0 {
+	compatible = "amlogic,meson-gxbb-wdt";
+	reg = <0 0x98d0 0x0 0x10>;
+	clocks = <&xtal>;
+};
Documentation/devicetree/bindings/watchdog/qcom-wdt.txt +4 -0
index 4726924..41aeaa2 100644
@@ -7,6 +7,10 @@ Required properties :
 			"qcom,kpss-wdt-msm8960"
 			"qcom,kpss-wdt-apq8064"
 			"qcom,kpss-wdt-ipq8064"
+			"qcom,kpss-wdt-ipq4019"
+			"qcom,kpss-timer"
+			"qcom,scss-timer"
+			"qcom,kpss-wdt"
 
 - reg : shall contain base register location and length
 - clocks : shall contain the input clock
Documentation/devicetree/bindings/watchdog/renesas-wdt.txt +5 -1
index b9512f1..da24e31 100644
@@ -1,7 +1,11 @@
 Renesas Watchdog Timer (WDT) Controller
 
 Required properties:
-- compatible : Should be "renesas,r8a7795-wdt", or "renesas,rcar-gen3-wdt"
+- compatible : Should be "renesas,<soctype>-wdt", and
+	       "renesas,rcar-gen3-wdt" as fallback.
+	       Examples with soctypes are:
+	         - "renesas,r8a7795-wdt" (R-Car H3)
+	         - "renesas,r8a7796-wdt" (R-Car M3-W)
 
   When compatible with the generic version, nodes must list the SoC-specific
   version corresponding to the platform first, followed by the generic
Documentation/driver-model/devres.txt +3 -0
index c63eea0..589296b 100644
@@ -357,3 +357,6 @@ SLAVE DMA ENGINE
 
 SPI
   devm_spi_register_master()
+
+WATCHDOG
+  devm_watchdog_register_device()
Documentation/watchdog/hpwdt.txt +2 -3
index a40398c..7a9f635 100644
@@ -1,9 +1,9 @@
-Last reviewed: 04/04/2016
+Last reviewed: 05/20/2016
 
                      HPE iLO NMI Watchdog Driver
               NMI sourcing for iLO based ProLiant Servers
                      Documentation and Driver by
-              Thomas Mingarelli <[email protected]>
+                         Thomas Mingarelli
 
  The HPE iLO NMI Watchdog driver is a kernel module that provides basic
  watchdog functionality and the added benefit of NMI sourcing. Both the
@@ -95,4 +95,3 @@ Last reviewed: 04/04/2016
 
 
  -- Tom Mingarelli
-    ([email protected])
Documentation/watchdog/src/watchdog-test.c +23 -16
index fcdde8f..6983d05 100644
@@ -2,6 +2,7 @@
  * Watchdog Driver Test Program
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -13,6 +14,7 @@
 #include <linux/watchdog.h>
 
 int fd;
+const char v = 'V';
 
 /*
  * This function simply sends an IOCTL to the driver, which in turn ticks
@@ -23,6 +25,7 @@ static void keep_alive(void)
 {
     int dummy;
 
+    printf(".");
     ioctl(fd, WDIOC_KEEPALIVE, &dummy);
 }
 
@@ -33,8 +36,13 @@ static void keep_alive(void)
 
 static void term(int sig)
 {
+    int ret = write(fd, &v, 1);
+
     close(fd);
-    fprintf(stderr, "Stopping watchdog ticks...\n");
+    if (ret < 0)
+	printf("\nStopping watchdog ticks failed (%d)...\n", errno);
+    else
+	printf("\nStopping watchdog ticks...\n");
     exit(0);
 }
 
@@ -42,12 +50,14 @@ int main(int argc, char *argv[])
 {
     int flags;
     unsigned int ping_rate = 1;
+    int ret;
+
+    setbuf(stdout, NULL);
 
     fd = open("/dev/watchdog", O_WRONLY);
 
     if (fd == -1) {
-	fprintf(stderr, "Watchdog device not enabled.\n");
-	fflush(stderr);
+	printf("Watchdog device not enabled.\n");
 	exit(-1);
     }
 
@@ -55,36 +65,30 @@ int main(int argc, char *argv[])
 	if (!strncasecmp(argv[1], "-d", 2)) {
 	    flags = WDIOS_DISABLECARD;
 	    ioctl(fd, WDIOC_SETOPTIONS, &flags);
-	    fprintf(stderr, "Watchdog card disabled.\n");
-	    fflush(stderr);
+	    printf("Watchdog card disabled.\n");
 	    goto end;
 	} else if (!strncasecmp(argv[1], "-e", 2)) {
 	    flags = WDIOS_ENABLECARD;
 	    ioctl(fd, WDIOC_SETOPTIONS, &flags);
-	    fprintf(stderr, "Watchdog card enabled.\n");
-	    fflush(stderr);
+	    printf("Watchdog card enabled.\n");
 	    goto end;
 	} else if (!strncasecmp(argv[1], "-t", 2) && argv[2]) {
 	    flags = atoi(argv[2]);
 	    ioctl(fd, WDIOC_SETTIMEOUT, &flags);
-	    fprintf(stderr, "Watchdog timeout set to %u seconds.\n", flags);
-	    fflush(stderr);
+	    printf("Watchdog timeout set to %u seconds.\n", flags);
 	    goto end;
 	} else if (!strncasecmp(argv[1], "-p", 2) && argv[2]) {
 	    ping_rate = strtoul(argv[2], NULL, 0);
-	    fprintf(stderr, "Watchdog ping rate set to %u seconds.\n", ping_rate);
-	    fflush(stderr);
+	    printf("Watchdog ping rate set to %u seconds.\n", ping_rate);
 	} else {
-	    fprintf(stderr, "-d to disable, -e to enable, -t <n> to set " \
+	    printf("-d to disable, -e to enable, -t <n> to set " \
 		"the timeout,\n-p <n> to set the ping rate, and \n");
-	    fprintf(stderr, "run by itself to tick the card.\n");
-	    fflush(stderr);
+	    printf("run by itself to tick the card.\n");
 	    goto end;
 	}
     }
 
-    fprintf(stderr, "Watchdog Ticking Away!\n");
-    fflush(stderr);
+    printf("Watchdog Ticking Away!\n");
 
     signal(SIGINT, term);
 
@@ -93,6 +97,9 @@ int main(int argc, char *argv[])
 	sleep(ping_rate);
     }
 end:
+    ret = write(fd, &v, 1);
+    if (ret < 0)
+	printf("Stopping watchdog ticks failed (%d)...\n", errno);
     close(fd);
     return 0;
 }
Documentation/watchdog/watchdog-kernel-api.txt +7 -2
index 917eeea..7f31125 100644
@@ -82,8 +82,9 @@ It contains following fields:
 * max_timeout: the watchdog timer's maximum timeout value (in seconds),
   as seen from userspace. If set, the maximum configurable value for
   'timeout'. Not used if max_hw_heartbeat_ms is non-zero.
-* min_hw_heartbeat_ms: Minimum time between heartbeats sent to the chip,
-  in milli-seconds.
+* min_hw_heartbeat_ms: Hardware limit for minimum time between heartbeats,
+  in milli-seconds. This value is normally 0; it should only be provided
+  if the hardware can not tolerate lower intervals between heartbeats.
 * max_hw_heartbeat_ms: Maximum hardware heartbeat, in milli-seconds.
   If set, the infrastructure will send heartbeats to the watchdog driver
   if 'timeout' is larger than max_hw_heartbeat_ms, unless WDOG_ACTIVE
@@ -166,6 +167,10 @@ they are supported. These optional routines/operations are:
   info structure).
 * status: this routine checks the status of the watchdog timer device. The
   status of the device is reported with watchdog WDIOF_* status flags/bits.
+  WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING are reported by the watchdog core;
+  it is not necessary to report those bits from the driver. Also, if no status
+  function is provided by the driver, the watchdog core reports the status bits
+  provided in the bootstatus variable of struct watchdog_device.
 * set_timeout: this routine checks and changes the timeout of the watchdog
   timer device. It returns 0 on success, -EINVAL for "parameter out of range"
   and -EIO for "could not write value to the watchdog". On success this
MAINTAINERS +6 -0
index 1d74837..139a532 100644
@@ -5304,6 +5304,12 @@ T:	git git://linuxtv.org/anttip/media_tree.git
 S:	Maintained
 F:	drivers/media/dvb-frontends/hd29l2*
 
+HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
+M:	Brian Boylston <[email protected]>
+S:	Supported
+F:	Documentation/watchdog/hpwdt.txt
+F:	drivers/watchdog/hpwdt.c
+
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
 M:	Don Brace <[email protected]>
 L:	[email protected]
arch/arm/boot/dts/qcom-apq8064.dtsi +2 -1
index df96ccd..e318d04 100644
@@ -247,7 +247,8 @@
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer", "qcom,msm-timer";
+			compatible = "qcom,kpss-timer",
+				     "qcom,kpss-wdt-apq8064", "qcom,msm-timer";
 			interrupts = <1 1 0x301>,
 				     <1 2 0x301>,
 				     <1 3 0x301>;
arch/arm/boot/dts/qcom-ipq4019.dtsi +1 -1
index 5c08d19..e625656 100644
@@ -252,7 +252,7 @@
 		};
 
 		watchdog@b017000 {
-			compatible = "qcom,kpss-standalone";
+			compatible = "qcom,kpss-wdt", "qcom,kpss-wdt-ipq4019";
 			reg = <0xb017000 0x40>;
 			clocks = <&sleep_clk>;
 			timeout-sec = <10>;
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -1
index 2601a90..2e37557 100644
@@ -122,7 +122,8 @@
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer", "qcom,msm-timer";
+			compatible = "qcom,kpss-timer",
+				     "qcom,kpss-wdt-ipq8064", "qcom,msm-timer";
 			interrupts = <1 1 0x301>,
 				     <1 2 0x301>,
 				     <1 3 0x301>,
arch/arm/boot/dts/qcom-msm8960.dtsi +2 -1
index da05e28..288f56e 100644
@@ -87,7 +87,8 @@
 		};
 
 		timer@200a000 {
-			compatible = "qcom,kpss-timer", "qcom,msm-timer";
+			compatible = "qcom,kpss-timer",
+				     "qcom,kpss-wdt-msm8960", "qcom,msm-timer";
 			interrupts = <1 1 0x301>,
 				     <1 2 0x301>,
 				     <1 3 0x301>;
drivers/platform/x86/intel_pmc_ipc.c +6 -4
index 6f497e8..b86e1bc 100644
@@ -85,7 +85,7 @@
  * platform device and to export resources for those functions.
  */
 #define TCO_DEVICE_NAME			"iTCO_wdt"
-#define SMI_EN_OFFSET			0x30
+#define SMI_EN_OFFSET			0x40
 #define SMI_EN_SIZE			4
 #define TCO_BASE_OFFSET			0x60
 #define TCO_REGS_SIZE			16
@@ -94,6 +94,8 @@
 #define TELEM_SSRAM_SIZE		240
 #define TELEM_PMC_SSRAM_OFFSET		0x1B00
 #define TELEM_PUNIT_SSRAM_OFFSET	0x1A00
+#define TCO_PMC_OFFSET			0x8
+#define TCO_PMC_SIZE			0x4
 
 static const int iTCO_version = 3;
 
@@ -502,7 +504,7 @@ static struct resource tco_res[] = {
 
 static struct itco_wdt_platform_data tco_info = {
 	.name = "Apollo Lake SoC",
-	.version = 3,
+	.version = 5,
 };
 
 #define TELEMETRY_RESOURCE_PUNIT_SSRAM	0
@@ -572,8 +574,8 @@ static int ipc_create_tco_device(void)
 	res->end = res->start + SMI_EN_SIZE - 1;
 
 	res = tco_res + TCO_RESOURCE_GCR_MEM;
-	res->start = ipcdev.gcr_base;
-	res->end = res->start + ipcdev.gcr_size - 1;
+	res->start = ipcdev.gcr_base + TCO_PMC_OFFSET;
+	res->end = res->start + TCO_PMC_SIZE - 1;
 
 	ret = platform_device_add_resources(pdev, tco_res, ARRAY_SIZE(tco_res));
 	if (ret) {
drivers/watchdog/Kconfig +32 -1
index b4b3e25..1bffe00 100644
@@ -48,7 +48,6 @@ config WATCHDOG_NOWAYOUT
 
 config WATCHDOG_SYSFS
 	bool "Read different watchdog information through sysfs"
-	default n
 	help
 	  Say Y here if you want to enable watchdog device status read through
 	  sysfs attributes.
@@ -516,6 +515,15 @@ config MAX63XX_WATCHDOG
 	help
 	  Support for memory mapped max63{69,70,71,72,73,74} watchdog timer.
 
+config MAX77620_WATCHDOG
+	tristate "Maxim Max77620 Watchdog Timer"
+	depends on MFD_MAX77620
+	help
+	 This is the driver for the Max77620 watchdog timer.
+	 Say 'Y' here to enable the watchdog timer support for
+	 MAX77620 chips. To compile this driver as a module,
+	 choose M here: the module will be called max77620_wdt.
+
 config IMX2_WDT
 	tristate "IMX2+ Watchdog"
 	depends on ARCH_MXC || ARCH_LAYERSCAPE
@@ -609,6 +617,16 @@ config QCOM_WDT
 	  To compile this driver as a module, choose M here: the
 	  module will be called qcom_wdt.
 
+config MESON_GXBB_WATCHDOG
+	tristate "Amlogic Meson GXBB SoCs watchdog support"
+	depends on ARCH_MESON
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the watchdog timer
+	  in Amlogic Meson GXBB SoCs.
+	  To compile this driver as a module, choose M here: the
+	  module will be called meson_gxbb_wdt.
+
 config MESON_WATCHDOG
 	tristate "Amlogic Meson SoCs watchdog support"
 	depends on ARCH_MESON
@@ -669,6 +687,19 @@ config RENESAS_WDT
 	  This driver adds watchdog support for the integrated watchdogs in the
 	  Renesas R-Car and other SH-Mobile SoCs (usually named RWDT or SWDT).
 
+config ASPEED_WATCHDOG
+	tristate "Aspeed 2400 watchdog support"
+	depends on ARCH_ASPEED || COMPILE_TEST
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the watchdog timer
+	  in Apseed BMC SoCs.
+
+	  This driver is required to reboot the SoC.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called aspeed_wdt.
+
 # AVR32 Architecture
 
 config AT32AP700X_WDT
drivers/watchdog/Makefile +3 -0
index a46e7c1..c22ad3e 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
 obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
 obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
 obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
+obj-$(CONFIG_MESON_GXBB_WATCHDOG) += meson_gxbb_wdt.o
 obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
 obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
 obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
 obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
 obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
+obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
@@ -203,6 +205,7 @@ obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
 obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
 obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
+obj-$(CONFIG_MAX77620_WATCHDOG) += max77620_wdt.o
 obj-$(CONFIG_ZIIRAVE_WATCHDOG) += ziirave_wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
 obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
drivers/watchdog/aspeed_wdt.c new file +212 -0

212 lines not on this page · raw message

drivers/watchdog/bcm2835_wdt.c +2 -9
index 2e6164c..4dddd82 100644
@@ -82,12 +82,6 @@ static int bcm2835_wdt_stop(struct watchdog_device *wdog)
 	return 0;
 }
 
-static int bcm2835_wdt_set_timeout(struct watchdog_device *wdog, unsigned int t)
-{
-	wdog->timeout = t;
-	return 0;
-}
-
 static unsigned int bcm2835_wdt_get_timeleft(struct watchdog_device *wdog)
 {
 	struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog);
@@ -96,15 +90,14 @@ static unsigned int bcm2835_wdt_get_timeleft(struct watchdog_device *wdog)
 	return WDOG_TICKS_TO_SECS(ret & PM_WDOG_TIME_SET);
 }
 
-static struct watchdog_ops bcm2835_wdt_ops = {
+static const struct watchdog_ops bcm2835_wdt_ops = {
 	.owner =	THIS_MODULE,
 	.start =	bcm2835_wdt_start,
 	.stop =		bcm2835_wdt_stop,
-	.set_timeout =	bcm2835_wdt_set_timeout,
 	.get_timeleft =	bcm2835_wdt_get_timeleft,
 };
 
-static struct watchdog_info bcm2835_wdt_info = {
+static const struct watchdog_info bcm2835_wdt_info = {
 	.options =	WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE |
 			WDIOF_KEEPALIVEPING,
 	.identity =	"Broadcom BCM2835 Watchdog timer",
drivers/watchdog/da9063_wdt.c +2 -0
index a100f64..5d6b4e5 100644
@@ -34,6 +34,7 @@ static const unsigned int wdt_timeout[] = { 0, 2, 4, 8, 16, 32, 65, 131 };
 #define DA9063_WDT_MIN_TIMEOUT		wdt_timeout[DA9063_TWDSCALE_MIN]
 #define DA9063_WDT_MAX_TIMEOUT		wdt_timeout[DA9063_TWDSCALE_MAX]
 #define DA9063_WDG_TIMEOUT		wdt_timeout[3]
+#define DA9063_RESET_PROTECTION_MS	256
 
 struct da9063_watchdog {
 	struct da9063 *da9063;
@@ -171,6 +172,7 @@ static int da9063_wdt_probe(struct platform_device *pdev)
 	wdt->wdtdev.ops = &da9063_watchdog_ops;
 	wdt->wdtdev.min_timeout = DA9063_WDT_MIN_TIMEOUT;
 	wdt->wdtdev.max_timeout = DA9063_WDT_MAX_TIMEOUT;
+	wdt->wdtdev.min_hw_heartbeat_ms = DA9063_RESET_PROTECTION_MS;
 	wdt->wdtdev.timeout = DA9063_WDG_TIMEOUT;
 	wdt->wdtdev.parent = &pdev->dev;
 
drivers/watchdog/f71808e_wdt.c +26 -2
index d4ba262..1b7e916 100644
@@ -45,9 +45,11 @@
 #define SIO_REG_DEVREV		0x22	/* Device revision */
 #define SIO_REG_MANID		0x23	/* Fintek ID (2 bytes) */
 #define SIO_REG_ROM_ADDR_SEL	0x27	/* ROM address select */
+#define SIO_F81866_REG_PORT_SEL	0x27	/* F81866 Multi-Function Register */
 #define SIO_REG_MFUNCT1		0x29	/* Multi function select 1 */
 #define SIO_REG_MFUNCT2		0x2a	/* Multi function select 2 */
 #define SIO_REG_MFUNCT3		0x2b	/* Multi function select 3 */
+#define SIO_F81866_REG_GPIO1	0x2c	/* F81866 GPIO1 Enable Register */
 #define SIO_REG_ENABLE		0x30	/* Logical device enable */
 #define SIO_REG_ADDR		0x60	/* Logical device address (2 bytes) */
 
@@ -60,6 +62,7 @@
 #define SIO_F71882_ID		0x0541	/* Chipset ID */
 #define SIO_F71889_ID		0x0723	/* Chipset ID */
 #define SIO_F81865_ID		0x0704	/* Chipset ID */
+#define SIO_F81866_ID		0x1010	/* Chipset ID */
 
 #define F71808FG_REG_WDO_CONF		0xf0
 #define F71808FG_REG_WDT_CONF		0xf5
@@ -116,7 +119,8 @@ module_param(start_withtimeout, uint, 0);
 MODULE_PARM_DESC(start_withtimeout, "Start watchdog timer on module load with"
 	" given initial timeout. Zero (default) disables this feature.");
 
-enum chips { f71808fg, f71858fg, f71862fg, f71869, f71882fg, f71889fg, f81865 };
+enum chips { f71808fg, f71858fg, f71862fg, f71869, f71882fg, f71889fg, f81865,
+	     f81866};
 
 static const char *f71808e_names[] = {
 	"f71808fg",
@@ -126,6 +130,7 @@ static const char *f71808e_names[] = {
 	"f71882fg",
 	"f71889fg",
 	"f81865",
+	"f81866",
 };
 
 /* Super-I/O Function prototypes */
@@ -370,6 +375,22 @@ static int watchdog_start(void)
 		superio_clear_bit(watchdog.sioaddr, SIO_REG_MFUNCT3, 5);
 		break;
 
+	case f81866:
+		/* Set pin 70 to WDTRST# */
+		superio_clear_bit(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL,
+				  BIT(3) | BIT(0));
+		superio_set_bit(watchdog.sioaddr, SIO_F81866_REG_PORT_SEL,
+				BIT(2));
+		/*
+		 * GPIO1 Control Register when 27h BIT3:2 = 01 & BIT0 = 0.
+		 * The PIN 70(GPIO15/WDTRST) is controlled by 2Ch:
+		 *     BIT5: 0 -> WDTRST#
+		 *           1 -> GPIO15
+		 */
+		superio_clear_bit(watchdog.sioaddr, SIO_F81866_REG_GPIO1,
+				  BIT(5));
+		break;
+
 	default:
 		/*
 		 * 'default' label to shut up the compiler and catch
@@ -382,7 +403,7 @@ static int watchdog_start(void)
 	superio_select(watchdog.sioaddr, SIO_F71808FG_LD_WDT);
 	superio_set_bit(watchdog.sioaddr, SIO_REG_ENABLE, 0);
 
-	if (watchdog.type == f81865)
+	if (watchdog.type == f81865 || watchdog.type == f81866)
 		superio_set_bit(watchdog.sioaddr, F81865_REG_WDO_CONF,
 				F81865_FLAG_WDOUT_EN);
 	else
@@ -788,6 +809,9 @@ static int __init f71808e_find(int sioaddr)
 	case SIO_F81865_ID:
 		watchdog.type = f81865;
 		break;
+	case SIO_F81866_ID:
+		watchdog.type = f81866;
+		break;
 	default:
 		pr_info("Unrecognized Fintek device: %04x\n",
 			(unsigned int)devid);
drivers/watchdog/gpio_wdt.c +2 -0
index ba066e4..93457ca 100644
@@ -151,6 +151,8 @@ static int gpio_wdt_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
+	platform_set_drvdata(pdev, priv);
+
 	priv->gpio = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
 	if (!gpio_is_valid(priv->gpio))
 		return priv->gpio;
drivers/watchdog/iTCO_wdt.c +2 -0
index 0acc6c5..54cab18 100644
@@ -150,6 +150,7 @@ static inline u32 no_reboot_bit(void)
 	u32 enable_bit;
 
 	switch (iTCO_wdt_private.iTCO_version) {
+	case 5:
 	case 3:
 		enable_bit = 0x00000010;
 		break;
@@ -512,6 +513,7 @@ static int iTCO_wdt_probe(struct platform_device *dev)
 
 	/* Clear out the (probably old) status */
 	switch (iTCO_wdt_private.iTCO_version) {
+	case 5:
 	case 4:
 		outw(0x0008, TCO1_STS);	/* Clear the Time Out Status bit */
 		outw(0x0002, TCO2_STS);	/* Clear SECOND_TO_STS bit */
drivers/watchdog/max77620_wdt.c new file +227 -0

227 lines not on this page · raw message

drivers/watchdog/meson_gxbb_wdt.c new file +270 -0

270 lines not on this page · raw message

drivers/watchdog/nv_tco.c +2 -0
index bd917bb..a0fabf6 100644
@@ -294,6 +294,8 @@ static const struct pci_device_id tco_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS,
 	  PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP78S_SMBUS,
+	  PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS,
 	  PCI_ANY_ID, PCI_ANY_ID, },
 	{ 0, },			/* End of list */
drivers/watchdog/pcwd.c +1 -13
index e936f15..3ad5206 100644
@@ -992,19 +992,7 @@ static struct isa_driver pcwd_isa_driver = {
 	},
 };
 
-static int __init pcwd_init_module(void)
-{
-	return isa_register_driver(&pcwd_isa_driver, PCWD_ISA_NR_CARDS);
-}
-
-static void __exit pcwd_cleanup_module(void)
-{
-	isa_unregister_driver(&pcwd_isa_driver);
-	pr_info("Watchdog Module Unloaded\n");
-}
-
-module_init(pcwd_init_module);
-module_exit(pcwd_cleanup_module);
+module_isa_driver(pcwd_isa_driver, PCWD_ISA_NR_CARDS);
 
 MODULE_AUTHOR("Ken Hollis <[email protected]>, "
 		"Wim Van Sebroeck <[email protected]>");
drivers/watchdog/pic32-dmt.c +2 -3
index 962f58c..c797305 100644
@@ -176,8 +176,8 @@ static int pic32_dmt_probe(struct platform_device *pdev)
 	struct watchdog_device *wdd = &pic32_dmt_wdd;
 
 	dmt = devm_kzalloc(&pdev->dev, sizeof(*dmt), GFP_KERNEL);
-	if (IS_ERR(dmt))
-		return PTR_ERR(dmt);
+	if (!dmt)
+		return -ENOMEM;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmt->regs = devm_ioremap_resource(&pdev->dev, mem);
@@ -245,7 +245,6 @@ static struct platform_driver pic32_dmt_driver = {
 	.remove		= pic32_dmt_remove,
 	.driver		= {
 		.name		= "pic32-dmt",
-		.owner		= THIS_MODULE,
 		.of_match_table = of_match_ptr(pic32_dmt_of_ids),
 	}
 };
drivers/watchdog/pic32-wdt.c +4 -5
index 6047aa8..e276106 100644
@@ -174,8 +174,8 @@ static int pic32_wdt_drv_probe(struct platform_device *pdev)
 	struct resource *mem;
 
 	wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
-	if (IS_ERR(wdt))
-		return PTR_ERR(wdt);
+	if (!wdt)
+		return -ENOMEM;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	wdt->regs = devm_ioremap_resource(&pdev->dev, mem);
@@ -183,8 +183,8 @@ static int pic32_wdt_drv_probe(struct platform_device *pdev)
 		return PTR_ERR(wdt->regs);
 
 	wdt->rst_base = devm_ioremap(&pdev->dev, PIC32_BASE_RESET, 0x10);
-	if (IS_ERR(wdt->rst_base))
-		return PTR_ERR(wdt->rst_base);
+	if (!wdt->rst_base)
+		return -ENOMEM;
 
 	wdt->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(wdt->clk)) {
@@ -251,7 +251,6 @@ static struct platform_driver pic32_wdt_driver = {
 	.remove		= pic32_wdt_drv_remove,
 	.driver		= {
 		.name		= "pic32-wdt",
-		.owner		= THIS_MODULE,
 		.of_match_table = of_match_ptr(pic32_wdt_dt_ids),
 	}
 };
drivers/watchdog/qcom-wdt.c +53 -16

129 lines not on this page · raw message

drivers/watchdog/sbsa_gwdt.c +4 -12
index ad383f6..ce0c38b 100644
@@ -180,15 +180,6 @@ static int sbsa_gwdt_keepalive(struct watchdog_device *wdd)
 	return 0;
 }
 
-static unsigned int sbsa_gwdt_status(struct watchdog_device *wdd)
-{
-	struct sbsa_gwdt *gwdt = watchdog_get_drvdata(wdd);
-	u32 status = readl(gwdt->control_base + SBSA_GWDT_WCS);
-
-	/* is the watchdog timer running? */
-	return (status & SBSA_GWDT_WCS_EN) << WDOG_ACTIVE;
-}
-
 static int sbsa_gwdt_start(struct watchdog_device *wdd)
 {
 	struct sbsa_gwdt *gwdt = watchdog_get_drvdata(wdd);
@@ -228,7 +219,6 @@ static struct watchdog_ops sbsa_gwdt_ops = {
 	.owner		= THIS_MODULE,
 	.start		= sbsa_gwdt_start,
 	.stop		= sbsa_gwdt_stop,
-	.status		= sbsa_gwdt_status,
 	.ping		= sbsa_gwdt_keepalive,
 	.set_timeout	= sbsa_gwdt_set_timeout,
 	.get_timeleft	= sbsa_gwdt_get_timeleft,
@@ -273,7 +263,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
 	wdd->info = &sbsa_gwdt_info;
 	wdd->ops = &sbsa_gwdt_ops;
 	wdd->min_timeout = 1;
-	wdd->max_timeout = U32_MAX / gwdt->clk;
+	wdd->max_hw_heartbeat_ms = U32_MAX / gwdt->clk * 1000;
 	wdd->timeout = DEFAULT_TIMEOUT;
 	watchdog_set_drvdata(wdd, gwdt);
 	watchdog_set_nowayout(wdd, nowayout);
@@ -283,6 +273,8 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
 		dev_warn(dev, "System reset by WDT.\n");
 		wdd->bootstatus |= WDIOF_CARDRESET;
 	}
+	if (status & SBSA_GWDT_WCS_EN)
+		set_bit(WDOG_HW_RUNNING, &wdd->status);
 
 	if (action) {
 		irq = platform_get_irq(pdev, 0);
@@ -310,7 +302,7 @@ static int sbsa_gwdt_probe(struct platform_device *pdev)
 	 * the timeout is (WOR * 2), so the maximum timeout should be doubled.
 	 */
 	if (!action)
-		wdd->max_timeout *= 2;
+		wdd->max_hw_heartbeat_ms *= 2;
 
 	watchdog_init_timeout(wdd, timeout, dev);
 	/*
drivers/watchdog/sirfsoc_wdt.c +10 -5
index d0578ab..3050a00 100644
@@ -39,13 +39,18 @@ MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
 			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
 
+static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
+{
+	return (void __iomem __force *)watchdog_get_drvdata(wdd);
+}
+
 static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
 {
 	u32 counter, match;
 	void __iomem *wdt_base;
 	int time_left;
 
-	wdt_base = watchdog_get_drvdata(wdd);
+	wdt_base = sirfsoc_wdt_base(wdd);
 	counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
 	match = readl(wdt_base +
 		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
@@ -61,7 +66,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
 	void __iomem *wdt_base;
 
 	timeout_ticks = wdd->timeout * CLOCK_FREQ;
-	wdt_base = watchdog_get_drvdata(wdd);
+	wdt_base = sirfsoc_wdt_base(wdd);
 
 	/* Enable the latch before reading the LATCH_LO register */
 	writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
@@ -79,7 +84,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
 
 static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
 {
-	void __iomem *wdt_base = watchdog_get_drvdata(wdd);
+	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
 	sirfsoc_wdt_updatetimeout(wdd);
 
 	/*
@@ -96,7 +101,7 @@ static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
 
 static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
 {
-	void __iomem *wdt_base = watchdog_get_drvdata(wdd);
+	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
 
 	writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
 	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
@@ -150,7 +155,7 @@ static int sirfsoc_wdt_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	watchdog_set_drvdata(&sirfsoc_wdd, base);
+	watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
 
 	watchdog_init_timeout(&sirfsoc_wdd, timeout, &pdev->dev);
 	watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
drivers/watchdog/softdog.c +21 -71

165 lines not on this page · raw message

drivers/watchdog/tangox_wdt.c +2 -2
index cfbed7e..202c4b9 100644
@@ -149,7 +149,7 @@ static int tangox_wdt_probe(struct platform_device *pdev)
 	dev->wdt.ops = &tangox_wdt_ops;
 	dev->wdt.timeout = DEFAULT_TIMEOUT;
 	dev->wdt.min_timeout = 1;
-	dev->wdt.max_timeout = (U32_MAX - 1) / dev->clk_rate;
+	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
 
 	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
 	watchdog_set_nowayout(&dev->wdt, nowayout);
@@ -170,7 +170,7 @@ static int tangox_wdt_probe(struct platform_device *pdev)
 	 * already running.
 	 */
 	if (readl(dev->base + WD_COUNTER)) {
-		set_bit(WDOG_ACTIVE, &dev->wdt.status);
+		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
 		tangox_wdt_start(&dev->wdt);
 	}
 
drivers/watchdog/watchdog_core.c +38 -1
index 7c3ba58..6abb83c 100644
@@ -88,7 +88,7 @@ static void watchdog_check_min_max_timeout(struct watchdog_device *wdd)
 	 * Check that we have valid min and max timeout values, if
 	 * not reset them both to 0 (=not used or unknown)
 	 */
-	if (wdd->min_timeout > wdd->max_timeout) {
+	if (!wdd->max_hw_heartbeat_ms && wdd->min_timeout > wdd->max_timeout) {
 		pr_info("Invalid min and max timeout values, resetting to 0!\n");
 		wdd->min_timeout = 0;
 		wdd->max_timeout = 0;
@@ -329,6 +329,43 @@ void watchdog_unregister_device(struct watchdog_device *wdd)
 
 EXPORT_SYMBOL_GPL(watchdog_unregister_device);
 
+static void devm_watchdog_unregister_device(struct device *dev, void *res)
+{
+	watchdog_unregister_device(*(struct watchdog_device **)res);
+}
+
+/**
+ * devm_watchdog_register_device() - resource managed watchdog_register_device()
+ * @dev: device that is registering this watchdog device
+ * @wdd: watchdog device
+ *
+ * Managed watchdog_register_device(). For watchdog device registered by this
+ * function,  watchdog_unregister_device() is automatically called on driver
+ * detach. See watchdog_register_device() for more information.
+ */
+int devm_watchdog_register_device(struct device *dev,
+				struct watchdog_device *wdd)
+{
+	struct watchdog_device **rcwdd;
+	int ret;
+
+	rcwdd = devres_alloc(devm_watchdog_unregister_device, sizeof(*wdd),
+			     GFP_KERNEL);
+	if (!rcwdd)
+		return -ENOMEM;
+
+	ret = watchdog_register_device(wdd);
+	if (!ret) {
+		*rcwdd = wdd;
+		devres_add(dev, rcwdd);
+	} else {
+		devres_free(rcwdd);
+	}
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(devm_watchdog_register_device);
+
 static int __init watchdog_deferred_registration(void)
 {
 	mutex_lock(&wtd_deferred_reg_mutex);
drivers/watchdog/watchdog_dev.c +46 -15

133 lines not on this page · raw message

drivers/watchdog/ziirave_wdt.c +1 -1
index cbe373d..fa1efef 100644
@@ -339,7 +339,7 @@ static int ziirave_wdt_remove(struct i2c_client *client)
 }
 
 static struct i2c_device_id ziirave_wdt_id[] = {
-	{ "ziirave-wdt", 0 },
+	{ "rave-wdt", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ziirave_wdt_id);
include/linux/watchdog.h +5 -1
index 51732d6..7047bc7 100644
@@ -66,7 +66,8 @@ struct watchdog_ops {
  *		as configurable from user space. Only relevant if
  *		max_hw_heartbeat_ms is not provided.
  * @min_hw_heartbeat_ms:
- *		Minimum time between heartbeats, in milli-seconds.
+ *		Hardware limit for minimum time between heartbeats,
+ *		in milli-seconds.
  * @max_hw_heartbeat_ms:
  *		Hardware limit for maximum timeout, in milli-seconds.
  *		Replaces max_timeout if specified.
@@ -180,4 +181,7 @@ extern int watchdog_init_timeout(struct watchdog_device *wdd,
 extern int watchdog_register_device(struct watchdog_device *);
 extern void watchdog_unregister_device(struct watchdog_device *);
 
+/* devres register variant */
+int devm_watchdog_register_device(struct device *dev, struct watchdog_device *);
+
 #endif  /* ifndef _LINUX_WATCHDOG_H */