Skip to content

Commit

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

Pull watchdog updates from Wim Van Sebroeck:

 - Removal of the pnx83xx driver

 - Add a binding for A100's watchdog controller

 - Add Rockchip compatibles to snps,dw-wdt.yaml

 - hpwdt: Disable NMI in Crash Kernel

 - Fix potential dereferencing of null pointer in watchdog_core

 - Several other small fixes and improvements

* tag 'linux-watchdog-5.11-rc1' of git://www.linux-watchdog.org/linux-watchdog: (23 commits)
  watchdog: convert comma to semicolon
  watchdog: iTCO_wdt: use dev_*() instead of pr_*() for logging
  dt-binding: watchdog: add Rockchip compatibles to snps,dw-wdt.yaml
  watchdog: coh901327: add COMMON_CLK dependency
  dt-bindings: watchdog: sun4i: Add A100 compatible
  watchdog: qcom: Avoid context switch in restart handler
  watchdog: iTCO_wdt: use module_platform_device() macro
  watchdog: Fix potential dereferencing of null pointer
  watchdog: wdat_wdt: Fix missing kerneldoc reported by W=1
  watchdog/hpwdt: Reflect changes
  watchdog/hpwdt: Disable NMI in Crash Kernel
  wdt: sp805: add watchdog_stop on reboot
  watchdog: sbc_fitpc2_wdt: add __user annotations
  watchdog: geodewdt: remove unneeded break
  watchdog: rti-wdt: fix reference leak in rti_wdt_probe
  watchdog: qcom_wdt: set WDOG_HW_RUNNING bit when appropriate
  watchdog: remove pnx83xx driver
  watchdog: stm32_iwdg: don't print an error on probe deferral
  watchdog: sprd: change to use usleep_range() instead of busy loop
  watchdog: sprd: check busy bit before new loading rather than after that
  ...
  • Loading branch information
torvalds committed Dec 23, 2020
2 parents 614cb58 + 0b9491b commit 6755f45
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 370 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ properties:
- items:
- const: allwinner,sun50i-a64-wdt
- const: allwinner,sun6i-a31-wdt
- items:
- const: allwinner,sun50i-a100-wdt
- const: allwinner,sun6i-a31-wdt
- items:
- const: allwinner,sun50i-h6-wdt
- const: allwinner,sun6i-a31-wdt
Expand Down
10 changes: 9 additions & 1 deletion Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ maintainers:

properties:
compatible:
const: snps,dw-wdt
oneOf:
- const: snps,dw-wdt
- items:
- enum:
- rockchip,rk3066-wdt
- rockchip,rk3188-wdt
- rockchip,rk3288-wdt
- rockchip,rk3368-wdt
- const: snps,dw-wdt

reg:
maxItems: 1
Expand Down
14 changes: 3 additions & 11 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ config ARM_SBSA_WATCHDOG
config ARMADA_37XX_WATCHDOG
tristate "Armada 37xx watchdog"
depends on ARCH_MVEBU || COMPILE_TEST
depends on HAS_IOMEM
select MFD_SYSCON
select WATCHDOG_CORE
help
Expand Down Expand Up @@ -631,7 +632,7 @@ config SUNXI_WATCHDOG

config COH901327_WATCHDOG
bool "ST-Ericsson COH 901 327 watchdog"
depends on ARCH_U300 || (ARM && COMPILE_TEST)
depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
default y if MACH_U300
select WATCHDOG_CORE
help
Expand Down Expand Up @@ -789,6 +790,7 @@ config MOXART_WDT

config SIRFSOC_WATCHDOG
tristate "SiRFSOC watchdog"
depends on HAS_IOMEM
depends on ARCH_SIRF || COMPILE_TEST
select WATCHDOG_CORE
default y
Expand Down Expand Up @@ -1696,16 +1698,6 @@ config WDT_MTX1
Hardware driver for the MTX-1 boards. This is a watchdog timer that
will reboot the machine after a 100 seconds timer expired.

config PNX833X_WDT
tristate "PNX833x Hardware Watchdog"
depends on SOC_PNX8335
depends on BROKEN
help
Hardware driver for the PNX833x's watchdog. This is a
watchdog timer that will reboot the machine after a programmable
timer has expired and no process has written to /dev/watchdog during
that time.

config SIBYTE_WDOG
tristate "Sibyte SoC hardware watchdog"
depends on CPU_SB1 || (MIPS && COMPILE_TEST)
Expand Down
1 change: 0 additions & 1 deletion drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt.o
obj-$(CONFIG_INDYDOG) += indydog.o
obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o
obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
Expand Down
2 changes: 0 additions & 2 deletions drivers/watchdog/geodewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ static long geodewdt_ioctl(struct file *file, unsigned int cmd,
case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident,
sizeof(ident)) ? -EFAULT : 0;
break;

case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return put_user(0, p);
Expand Down
8 changes: 7 additions & 1 deletion drivers/watchdog/hpwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#include <linux/types.h>
#include <linux/watchdog.h>
#include <asm/nmi.h>
#include <linux/crash_dump.h>

#define HPWDT_VERSION "2.0.3"
#define HPWDT_VERSION "2.0.4"
#define SECS_TO_TICKS(secs) ((secs) * 1000 / 128)
#define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000)
#define HPWDT_MAX_TICKS 65535
Expand Down Expand Up @@ -334,6 +335,11 @@ static int hpwdt_init_one(struct pci_dev *dev,
watchdog_set_nowayout(&hpwdt_dev, nowayout);
watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL);

if (is_kdump_kernel()) {
pretimeout = 0;
kdumptimeout = 0;
}

if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
pretimeout = 0;
Expand Down
34 changes: 9 additions & 25 deletions drivers/watchdog/iTCO_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
* Includes, defines, variables, module parameters, ...
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

/* Module and version information */
#define DRV_NAME "iTCO_wdt"
#define DRV_VERSION "1.11"
Expand Down Expand Up @@ -279,7 +277,7 @@ static int iTCO_wdt_start(struct watchdog_device *wd_dev)
/* disable chipset's NO_REBOOT bit */
if (p->update_no_reboot_bit(p->no_reboot_priv, false)) {
spin_unlock(&p->io_lock);
pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n");
dev_err(wd_dev->parent, "failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n");
return -EIO;
}

Expand Down Expand Up @@ -510,7 +508,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
/* Check chipset's NO_REBOOT bit */
if (p->update_no_reboot_bit(p->no_reboot_priv, false) &&
iTCO_vendor_check_noreboot_on()) {
pr_info("unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n");
dev_info(dev, "unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n");
return -ENODEV; /* Cannot reset NO_REBOOT bit */
}

Expand All @@ -530,12 +528,12 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
if (!devm_request_region(dev, p->tco_res->start,
resource_size(p->tco_res),
pdev->name)) {
pr_err("I/O address 0x%04llx already in use, device disabled\n",
dev_err(dev, "I/O address 0x%04llx already in use, device disabled\n",
(u64)TCOBASE(p));
return -EBUSY;
}

pr_info("Found a %s TCO device (Version=%d, TCOBASE=0x%04llx)\n",
dev_info(dev, "Found a %s TCO device (Version=%d, TCOBASE=0x%04llx)\n",
pdata->name, pdata->version, (u64)TCOBASE(p));

/* Clear out the (probably old) status */
Expand All @@ -558,7 +556,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
break;
}

p->wddev.info = &ident,
p->wddev.info = &ident,
p->wddev.ops = &iTCO_wdt_ops,
p->wddev.bootstatus = 0;
p->wddev.timeout = WATCHDOG_TIMEOUT;
Expand All @@ -575,19 +573,19 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
if not reset to the default */
if (iTCO_wdt_set_timeout(&p->wddev, heartbeat)) {
iTCO_wdt_set_timeout(&p->wddev, WATCHDOG_TIMEOUT);
pr_info("timeout value out of range, using %d\n",
dev_info(dev, "timeout value out of range, using %d\n",
WATCHDOG_TIMEOUT);
}

watchdog_stop_on_reboot(&p->wddev);
watchdog_stop_on_unregister(&p->wddev);
ret = devm_watchdog_register_device(dev, &p->wddev);
if (ret != 0) {
pr_err("cannot register watchdog device (err=%d)\n", ret);
dev_err(dev, "cannot register watchdog device (err=%d)\n", ret);
return ret;
}

pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n",
dev_info(dev, "initialized. heartbeat=%d sec (nowayout=%d)\n",
heartbeat, nowayout);

return 0;
Expand Down Expand Up @@ -651,21 +649,7 @@ static struct platform_driver iTCO_wdt_driver = {
},
};

static int __init iTCO_wdt_init_module(void)
{
pr_info("Intel TCO WatchDog Timer Driver v%s\n", DRV_VERSION);

return platform_driver_register(&iTCO_wdt_driver);
}

static void __exit iTCO_wdt_cleanup_module(void)
{
platform_driver_unregister(&iTCO_wdt_driver);
pr_info("Watchdog Module Unloaded\n");
}

module_init(iTCO_wdt_init_module);
module_exit(iTCO_wdt_cleanup_module);
module_platform_driver(iTCO_wdt_driver);

MODULE_AUTHOR("Wim Van Sebroeck <[email protected]>");
MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver");
Expand Down
4 changes: 2 additions & 2 deletions drivers/watchdog/mpc8xxx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)

spin_lock_init(&ddata->lock);

ddata->wdd.info = &mpc8xxx_wdt_info,
ddata->wdd.ops = &mpc8xxx_wdt_ops,
ddata->wdd.info = &mpc8xxx_wdt_info;
ddata->wdd.ops = &mpc8xxx_wdt_ops;

ddata->wdd.timeout = WATCHDOG_TIMEOUT;
watchdog_init_timeout(&ddata->wdd, timeout, dev);
Expand Down
Loading

0 comments on commit 6755f45

Please sign in to comment.