Skip to content

Commit

Permalink
Merge tag 'linux-watchdog-5.3-rc1' of git://www.linux-watchdog.org/li…
Browse files Browse the repository at this point in the history
…nux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

 - add Allwinner H6 watchdog

 - drop warning after registering device patches

 - hpwdt improvements

 - gpio: add support for nowayout option

 - introduce CONFIG_WATCHDOG_OPEN_TIMEOUT

 - convert remaining drivers to use SPDX license identifier

 - Fixes and improvements on several watchdog device drivers

* tag 'linux-watchdog-5.3-rc1' of git://www.linux-watchdog.org/linux-watchdog: (74 commits)
  watchdog: digicolor_wdt: Remove unused variable in dc_wdt_probe
  watchdog: ie6xx_wdt: Use spinlock_t instead of struct spinlock
  watchdog: atmel: atmel-sama5d4-wdt: Disable watchdog on system suspend
  watchdog: convert remaining drivers to use SPDX license identifier
  dt-bindings: watchdog: Rename bindings documentation file
  watchdog: mei_wdt: no need to check return value of debugfs_create functions
  watchdog: bcm_kona_wdt: no need to check return value of debugfs_create functions
  docs: watchdog: Fix build error.
  docs: watchdog: convert docs to ReST and rename to *.rst
  watchdog: make the device time out at open_deadline when open_timeout is used
  watchdog: introduce CONFIG_WATCHDOG_OPEN_TIMEOUT
  watchdog: introduce watchdog.open_timeout commandline parameter
  dt-bindings: watchdog: move i.MX system controller watchdog binding to SCU
  watchdog: imx_sc: Add pretimeout support
  watchdog: renesas_wdt: Add a few cycles delay
  watchdog: gpio: add support for nowayout option
  watchdog: renesas_wdt: Use 'dev' instead of dereferencing it repeatedly
  dt-bindings: watchdog: add Allwinner H6 watchdog
  watchdog: jz4740: Avoid starting watchdog in set_timeout
  watchdog: jz4740: Use register names from <linux/mfd/ingenic-tcu.h>
  ...
  • Loading branch information
torvalds committed Jul 18, 2019
2 parents 2ae048e + 7fb832a commit d77e9e4
Show file tree
Hide file tree
Showing 82 changed files with 391 additions and 453 deletions.
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ Optional Child nodes:
- Data cells of ocotp:
Detailed bindings are described in bindings/nvmem/nvmem.txt

Watchdog bindings based on SCU Message Protocol
------------------------------------------------------------

Required properties:
- compatible: should be:
"fsl,imx8qxp-sc-wdt"
followed by "fsl,imx-sc-wdt";
Optional properties:
- timeout-sec: contains the watchdog timeout in seconds.

Example (imx8qxp):
-------------
aliases {
Expand Down Expand Up @@ -207,6 +217,11 @@ firmware {
rtc: rtc {
compatible = "fsl,imx8qxp-sc-rtc";
};

watchdog {
compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
timeout-sec = <60>;
};
};
};

Expand Down
24 changes: 0 additions & 24 deletions Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt

This file was deleted.

1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Required properties:
"allwinner,sun4i-a10-wdt"
"allwinner,sun6i-a31-wdt"
"allwinner,sun50i-a64-wdt","allwinner,sun6i-a31-wdt"
"allwinner,sun50i-h6-wdt","allwinner,sun6i-a31-wdt"
"allwinner,suniv-f1c100s-wdt", "allwinner,sun4i-a10-wdt"
- reg : Specifies base physical address and size of the registers.

Expand Down
4 changes: 4 additions & 0 deletions Documentation/watchdog/hpwdt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Last reviewed: 08/20/2018
Default value is set when compiling the kernel. If it is set
to "Y", then there is no way of disabling the watchdog once
it has been started.
kdumptimeout Minimum timeout in seconds to apply upon receipt of an NMI
before calling panic. (-1) disables the watchdog. When value
is > 0, the timer is reprogrammed with the greater of
value or current timeout value.
============ ================================================================

NOTE:
Expand Down
11 changes: 11 additions & 0 deletions Documentation/watchdog/watchdog-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ modules.

-------------------------------------------------

watchdog core:
open_timeout:
Maximum time, in seconds, for which the watchdog framework will take
care of pinging a running hardware watchdog until userspace opens the
corresponding /dev/watchdogN device. A value of 0 means an infinite
timeout. Setting this to a non-zero value can be useful to ensure that
either userspace comes up properly, or the board gets reset and allows
fallback logic in the bootloader to try something else.

-------------------------------------------------

acquirewdt:
wdt_stop:
Acquire WDT 'stop' io port (default 0x43)
Expand Down
10 changes: 10 additions & 0 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ config WATCHDOG_HANDLE_BOOT_ENABLED
the watchdog on its own. Thus if your userspace does not start fast
enough your device will reboot.

config WATCHDOG_OPEN_TIMEOUT
int "Timeout value for opening watchdog device"
default 0
help
The maximum time, in seconds, for which the watchdog framework takes
care of pinging a hardware watchdog. A value of 0 means infinite. The
value set here can be overridden by the commandline parameter
"watchdog.open_timeout".

config WATCHDOG_SYSFS
bool "Read different watchdog information through sysfs"
help
Expand Down Expand Up @@ -717,6 +726,7 @@ config IMX2_WDT
config IMX_SC_WDT
tristate "IMX SC Watchdog"
depends on HAVE_ARM_SMCCC
depends on IMX_SCU
select WATCHDOG_CORE
help
This is the driver for the system controller watchdog
Expand Down
6 changes: 1 addition & 5 deletions drivers/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Acquire Single Board Computer Watchdog Timer driver
*
Expand All @@ -6,11 +7,6 @@
* (c) Copyright 1996 Alan Cox <[email protected]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
Expand Down
6 changes: 1 addition & 5 deletions drivers/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Advantech Single Board Computer WDT driver
*
Expand All @@ -9,11 +10,6 @@
* (c) Copyright 1996 Alan Cox <[email protected]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
Expand Down
8 changes: 1 addition & 7 deletions drivers/watchdog/aspeed_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY)
wdt->wdd.bootstatus = WDIOF_CARDRESET;

ret = devm_watchdog_register_device(dev, &wdt->wdd);
if (ret) {
dev_err(dev, "failed to register\n");
return ret;
}

return 0;
return devm_watchdog_register_device(dev, &wdt->wdd);
}

static struct platform_driver aspeed_watchdog_driver = {
Expand Down
5 changes: 2 additions & 3 deletions drivers/watchdog/bcm2835_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,8 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)

watchdog_stop_on_reboot(&bcm2835_wdt_wdd);
err = devm_watchdog_register_device(dev, &bcm2835_wdt_wdd);
if (err) {
dev_err(dev, "Failed to register watchdog device");
if (err)
return err;
}

if (pm_power_off == NULL) {
pm_power_off = bcm2835_power_off;
Expand Down Expand Up @@ -240,6 +238,7 @@ module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

MODULE_ALIAS("platform:bcm2835-wdt");
MODULE_AUTHOR("Lubomir Rintel <[email protected]>");
MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer");
MODULE_LICENSE("GPL");
4 changes: 1 addition & 3 deletions drivers/watchdog/bcm7038_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,8 @@ static int bcm7038_wdt_probe(struct platform_device *pdev)
watchdog_stop_on_reboot(&wdt->wdd);
watchdog_stop_on_unregister(&wdt->wdd);
err = devm_watchdog_register_device(dev, &wdt->wdd);
if (err) {
dev_err(dev, "Failed to register watchdog device\n");
if (err)
return err;
}

dev_info(dev, "Registered BCM7038 Watchdog\n");

Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/bcm_kona_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,8 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
watchdog_stop_on_reboot(&bcm_kona_wdt_wdd);
watchdog_stop_on_unregister(&bcm_kona_wdt_wdd);
ret = devm_watchdog_register_device(dev, &bcm_kona_wdt_wdd);
if (ret) {
dev_err(dev, "Failed to register watchdog device");
if (ret)
return ret;
}

bcm_kona_wdt_debug_init(pdev);
dev_dbg(dev, "Broadcom Kona Watchdog Timer");
Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/cadence_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,8 @@ static int cdns_wdt_probe(struct platform_device *pdev)
watchdog_stop_on_reboot(cdns_wdt_device);
watchdog_stop_on_unregister(cdns_wdt_device);
ret = devm_watchdog_register_device(dev, cdns_wdt_device);
if (ret) {
dev_err(dev, "Failed to register wdt device\n");
if (ret)
return ret;
}
platform_set_drvdata(pdev, wdt);

dev_info(dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
Expand Down
9 changes: 1 addition & 8 deletions drivers/watchdog/da9052_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,7 @@ static int da9052_wdt_probe(struct platform_device *pdev)
return ret;
}

ret = devm_watchdog_register_device(dev, &driver_data->wdt);
if (ret != 0) {
dev_err(da9052->dev, "watchdog_register_device() failed: %d\n",
ret);
return ret;
}

return ret;
return devm_watchdog_register_device(dev, &driver_data->wdt);
}

static struct platform_driver da9052_wdt_driver = {
Expand Down
5 changes: 1 addition & 4 deletions drivers/watchdog/da9062_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,8 @@ static int da9062_wdt_probe(struct platform_device *pdev)
watchdog_set_drvdata(&wdt->wdtdev, wdt);

ret = devm_watchdog_register_device(dev, &wdt->wdtdev);
if (ret < 0) {
dev_err(wdt->hw->dev,
"watchdog registration failed (%d)\n", ret);
if (ret < 0)
return ret;
}

return da9062_wdt_ping(&wdt->wdtdev);
}
Expand Down
14 changes: 3 additions & 11 deletions drivers/watchdog/davinci_wdt.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: GPL-2.0
/*
* drivers/char/watchdog/davinci_wdt.c
*
* Watchdog driver for DaVinci DM644x/DM646x processors
*
* Copyright (C) 2006-2013 Texas Instruments.
*
* 2007 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
* 2007 (c) MontaVista Software, Inc.
*/

#include <linux/module.h>
Expand Down Expand Up @@ -247,13 +245,7 @@ static int davinci_wdt_probe(struct platform_device *pdev)
if (IS_ERR(davinci_wdt->base))
return PTR_ERR(davinci_wdt->base);

ret = devm_watchdog_register_device(dev, wdd);
if (ret) {
dev_err(dev, "cannot register watchdog device\n");
return ret;
}

return 0;
return devm_watchdog_register_device(dev, wdd);
}

static const struct of_device_id davinci_wdt_of_match[] = {
Expand Down
9 changes: 1 addition & 8 deletions drivers/watchdog/digicolor_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static int dc_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct dc_wdt *wdt;
int ret;

wdt = devm_kzalloc(dev, sizeof(struct dc_wdt), GFP_KERNEL);
if (!wdt)
Expand All @@ -141,13 +140,7 @@ static int dc_wdt_probe(struct platform_device *pdev)
watchdog_set_restart_priority(&dc_wdt_wdd, 128);
watchdog_init_timeout(&dc_wdt_wdd, timeout, dev);
watchdog_stop_on_reboot(&dc_wdt_wdd);
ret = devm_watchdog_register_device(dev, &dc_wdt_wdd);
if (ret) {
dev_err(dev, "Failed to register watchdog device");
return ret;
}

return 0;
return devm_watchdog_register_device(dev, &dc_wdt_wdd);
}

static const struct of_device_id dc_wdt_of_match[] = {
Expand Down
9 changes: 0 additions & 9 deletions drivers/watchdog/ebc-c384_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
/*
* Watchdog timer driver for the WinSystems EBC-C384
* Copyright (C) 2016 William Breathitt Gray
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#include <linux/device.h>
#include <linux/dmi.h>
Expand Down
6 changes: 1 addition & 5 deletions drivers/watchdog/eurotechwdt.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Eurotech CPU-1220/1410/1420 on board WDT driver
*
Expand All @@ -11,11 +12,6 @@
* (c) Copyright 1996-1997 Alan Cox <[email protected]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
Expand Down
4 changes: 1 addition & 3 deletions drivers/watchdog/ftwdt010_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev)
}

ret = devm_watchdog_register_device(dev, &gwdt->wdd);
if (ret) {
dev_err(dev, "failed to register watchdog\n");
if (ret)
return ret;
}

/* Set up platform driver data */
platform_set_drvdata(pdev, gwdt);
Expand Down
7 changes: 7 additions & 0 deletions drivers/watchdog/gpio_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#include <linux/platform_device.h>
#include <linux/watchdog.h>

static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

#define SOFT_TIMEOUT_MIN 1
#define SOFT_TIMEOUT_DEF 60

Expand Down Expand Up @@ -151,6 +157,7 @@ static int gpio_wdt_probe(struct platform_device *pdev)
priv->wdd.timeout = SOFT_TIMEOUT_DEF;

watchdog_init_timeout(&priv->wdd, 0, dev);
watchdog_set_nowayout(&priv->wdd, nowayout);

watchdog_stop_on_reboot(&priv->wdd);

Expand Down
Loading

0 comments on commit d77e9e4

Please sign in to comment.