Skip to content

Commit

Permalink
Merge tag 'watchdog-for-linus-v4.10' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/groeck/linux-staging

Pull watchdog updates from Wim Van Sebroeck and Guenter Roeck:

 - new driver for Add Loongson1 SoC

 - minor cleanup and fixes in various drivers

* tag 'watchdog-for-linus-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  watchdog: it87_wdt: add IT8620E ID
  watchdog: mpc8xxx: Remove unneeded linux/miscdevice.h include
  watchdog: octeon: Remove unneeded linux/miscdevice.h include
  watchdog: bcm2835_wdt: set WDOG_HW_RUNNING bit when appropriate
  watchdog: loongson1: Add Loongson1 SoC watchdog driver
  watchdog: cpwd: remove memory allocate failure message
  watchdog: da9062/61: watchdog driver
  intel-mid_wdt: Error code is just an integer
  intel-mid_wdt: make sure watchdog is not running at startup
  watchdog: mei_wdt: request stop on reboot to prevent false positive event
  watchdog: hpwdt: changed maintainer information
  watchdog: jz4740: Fix modular build
  watchdog: qcom: fix kernel panic due to external abort on non-linefetch
  watchdog: davinci: add support for deferred probing
  watchdog: meson: Remove unneeded platform MODULE_ALIAS
  watchdog: Standardize leading tabs and spaces in Kconfig file
  watchdog: max77620_wdt: fix module autoload
  watchdog: bcm7038_wdt: fix module autoload
  • Loading branch information
torvalds committed Dec 24, 2016
2 parents 01e0d60 + 0671612 commit 3a77fa8
Show file tree
Hide file tree
Showing 18 changed files with 262 additions and 58 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5735,7 +5735,7 @@ S: Maintained
F: drivers/media/dvb-frontends/hd29l2*

HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
M: Brian Boylston <brian.boylston@hpe.com>
M: Jimmy Vance <jimmy.vance@hpe.com>
S: Supported
F: Documentation/watchdog/hpwdt.txt
F: drivers/watchdog/hpwdt.c
Expand Down
49 changes: 28 additions & 21 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ config SOFT_WATCHDOG
module will be called softdog.

config DA9052_WATCHDOG
tristate "Dialog DA9052 Watchdog"
depends on PMIC_DA9052
select WATCHDOG_CORE
help
Support for the watchdog in the DA9052 PMIC. Watchdog trigger
cause system reset.
tristate "Dialog DA9052 Watchdog"
depends on PMIC_DA9052
select WATCHDOG_CORE
help
Support for the watchdog in the DA9052 PMIC. Watchdog trigger
cause system reset.

Say Y here to include support for the DA9052 watchdog.
Alternatively say M to compile the driver as a module,
which will be called da9052_wdt.
Say Y here to include support for the DA9052 watchdog.
Alternatively say M to compile the driver as a module,
which will be called da9052_wdt.

config DA9055_WATCHDOG
tristate "Dialog Semiconductor DA9055 Watchdog"
Expand All @@ -104,11 +104,11 @@ config DA9063_WATCHDOG
This driver can be built as a module. The module name is da9063_wdt.

config DA9062_WATCHDOG
tristate "Dialog DA9062 Watchdog"
tristate "Dialog DA9062/61 Watchdog"
depends on MFD_DA9062
select WATCHDOG_CORE
help
Support for the watchdog in the DA9062 PMIC.
Support for the watchdog in the DA9062 and DA9061 PMICs.

This driver can be built as a module. The module name is da9062_wdt.

Expand Down Expand Up @@ -1008,8 +1008,8 @@ config IT87_WDT
tristate "IT87 Watchdog Timer"
depends on X86
---help---
This is the driver for the hardware watchdog on the ITE IT8702,
IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 and IT8728
This is the driver for the hardware watchdog on the ITE IT8620,
IT8702, IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 and IT8728
Super I/O chips.

If the driver does not work, then make sure that the game port in
Expand Down Expand Up @@ -1514,6 +1514,13 @@ config LANTIQ_WDT
help
Hardware driver for the Lantiq SoC Watchdog Timer.

config LOONGSON1_WDT
tristate "Loongson1 SoC hardware watchdog"
depends on MACH_LOONGSON32
select WATCHDOG_CORE
help
Hardware driver for the Loongson1 SoC Watchdog Timer.

config RALINK_WDT
tristate "Ralink SoC watchdog"
select WATCHDOG_CORE
Expand Down Expand Up @@ -1624,16 +1631,16 @@ config BOOKE_WDT_DEFAULT_TIMEOUT
The value can be overridden by the wdt_period command-line parameter.

config MEN_A21_WDT
tristate "MEN A21 VME CPU Carrier Board Watchdog Timer"
select WATCHDOG_CORE
depends on GPIOLIB || COMPILE_TEST
help
Watchdog driver for MEN A21 VMEbus CPU Carrier Boards.
tristate "MEN A21 VME CPU Carrier Board Watchdog Timer"
select WATCHDOG_CORE
depends on GPIOLIB || COMPILE_TEST
help
Watchdog driver for MEN A21 VMEbus CPU Carrier Boards.

The driver can also be built as a module. If so, the module will be
called mena21_wdt.
The driver can also be built as a module. If so, the module will be
called mena21_wdt.

If unsure select N here.
If unsure select N here.

# PPC64 Architecture

Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o
octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o
obj-$(CONFIG_LANTIQ_WDT) += lantiq_wdt.o
obj-$(CONFIG_LOONGSON1_WDT) += loongson1_wdt.o
obj-$(CONFIG_RALINK_WDT) += rt2880_wdt.o
obj-$(CONFIG_IMGPDC_WDT) += imgpdc_wdt.o
obj-$(CONFIG_MT7621_WDT) += mt7621_wdt.o
Expand Down
20 changes: 20 additions & 0 deletions drivers/watchdog/bcm2835_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ struct bcm2835_wdt {
static unsigned int heartbeat;
static bool nowayout = WATCHDOG_NOWAYOUT;

static bool bcm2835_wdt_is_running(struct bcm2835_wdt *wdt)
{
uint32_t cur;

cur = readl(wdt->base + PM_RSTC);

return !!(cur & PM_RSTC_WRCFG_FULL_RESET);
}

static int bcm2835_wdt_start(struct watchdog_device *wdog)
{
struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog);
Expand Down Expand Up @@ -181,6 +190,17 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
watchdog_init_timeout(&bcm2835_wdt_wdd, heartbeat, dev);
watchdog_set_nowayout(&bcm2835_wdt_wdd, nowayout);
bcm2835_wdt_wdd.parent = &pdev->dev;
if (bcm2835_wdt_is_running(wdt)) {
/*
* The currently active timeout value (set by the
* bootloader) may be different from the module
* heartbeat parameter or the value in device
* tree. But we just need to set WDOG_HW_RUNNING,
* because then the framework will "immediately" ping
* the device, updating the timeout.
*/
set_bit(WDOG_HW_RUNNING, &bcm2835_wdt_wdd.status);
}
err = watchdog_register_device(&bcm2835_wdt_wdd);
if (err) {
dev_err(dev, "Failed to register watchdog device");
Expand Down
1 change: 1 addition & 0 deletions drivers/watchdog/bcm7038_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ static const struct of_device_id bcm7038_wdt_match[] = {
{ .compatible = "brcm,bcm7038-wdt" },
{},
};
MODULE_DEVICE_TABLE(of, bcm7038_wdt_match);

static struct platform_driver bcm7038_wdt_driver = {
.probe = bcm7038_wdt_probe,
Expand Down
23 changes: 7 additions & 16 deletions drivers/watchdog/cpwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,9 @@ static int cpwd_probe(struct platform_device *op)
if (cpwd_device)
return -EINVAL;

p = kzalloc(sizeof(*p), GFP_KERNEL);
err = -ENOMEM;
if (!p) {
pr_err("Unable to allocate struct cpwd\n");
goto out;
}
p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL);
if (!p)
return -ENOMEM;

p->irq = op->archdata.irqs[0];

Expand All @@ -553,12 +550,12 @@ static int cpwd_probe(struct platform_device *op)
4 * WD_TIMER_REGSZ, DRIVER_NAME);
if (!p->regs) {
pr_err("Unable to map registers\n");
goto out_free;
return -ENOMEM;
}

options = of_find_node_by_path("/options");
err = -ENODEV;
if (!options) {
err = -ENODEV;
pr_err("Unable to find /options node\n");
goto out_iounmap;
}
Expand Down Expand Up @@ -620,10 +617,7 @@ static int cpwd_probe(struct platform_device *op)

platform_set_drvdata(op, p);
cpwd_device = p;
err = 0;

out:
return err;
return 0;

out_unregister:
for (i--; i >= 0; i--)
Expand All @@ -632,9 +626,7 @@ static int cpwd_probe(struct platform_device *op)
out_iounmap:
of_iounmap(&op->resource[0], p->regs, 4 * WD_TIMER_REGSZ);

out_free:
kfree(p);
goto out;
return err;
}

static int cpwd_remove(struct platform_device *op)
Expand All @@ -659,7 +651,6 @@ static int cpwd_remove(struct platform_device *op)
free_irq(p->irq, p);

of_iounmap(&op->resource[0], p->regs, 4 * WD_TIMER_REGSZ);
kfree(p);

cpwd_device = NULL;

Expand Down
12 changes: 10 additions & 2 deletions drivers/watchdog/da9062_wdt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* da9062_wdt.c - WDT device driver for DA9062
* Watchdog device driver for DA9062 and DA9061 PMICs
* Copyright (C) 2015 Dialog Semiconductor Ltd.
*
* This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -188,6 +188,13 @@ static const struct watchdog_ops da9062_watchdog_ops = {
.set_timeout = da9062_wdt_set_timeout,
};

static const struct of_device_id da9062_compatible_id_table[] = {
{ .compatible = "dlg,da9062-watchdog", },
{ },
};

MODULE_DEVICE_TABLE(of, da9062_compatible_id_table);

static int da9062_wdt_probe(struct platform_device *pdev)
{
int ret;
Expand Down Expand Up @@ -244,11 +251,12 @@ static struct platform_driver da9062_wdt_driver = {
.remove = da9062_wdt_remove,
.driver = {
.name = "da9062-watchdog",
.of_match_table = da9062_compatible_id_table,
},
};
module_platform_driver(da9062_wdt_driver);

MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>");
MODULE_DESCRIPTION("WDT device driver for Dialog DA9062");
MODULE_DESCRIPTION("WDT device driver for Dialog DA9062 and DA9061");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:da9062-watchdog");
6 changes: 5 additions & 1 deletion drivers/watchdog/davinci_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ static int davinci_wdt_probe(struct platform_device *pdev)
return -ENOMEM;

davinci_wdt->clk = devm_clk_get(dev, NULL);
if (WARN_ON(IS_ERR(davinci_wdt->clk)))

if (IS_ERR(davinci_wdt->clk)) {
if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to get clock node\n");
return PTR_ERR(davinci_wdt->clk);
}

clk_prepare_enable(davinci_wdt->clk);

Expand Down
22 changes: 11 additions & 11 deletions drivers/watchdog/intel-mid_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static inline int wdt_command(int sub, u32 *in, int inlen)

static int wdt_start(struct watchdog_device *wd)
{
struct device *dev = watchdog_get_drvdata(wd);
int ret, in_size;
int timeout = wd->timeout;
struct ipc_wd_start {
Expand All @@ -57,36 +58,32 @@ static int wdt_start(struct watchdog_device *wd)
in_size = DIV_ROUND_UP(sizeof(ipc_wd_start), 4);

ret = wdt_command(SCU_WATCHDOG_START, (u32 *)&ipc_wd_start, in_size);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
if (ret)
dev_crit(dev, "error starting watchdog: %d\n", ret);
}

return ret;
}

static int wdt_ping(struct watchdog_device *wd)
{
struct device *dev = watchdog_get_drvdata(wd);
int ret;

ret = wdt_command(SCU_WATCHDOG_KEEPALIVE, NULL, 0);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
dev_crit(dev, "Error executing keepalive: 0x%x\n", ret);
}
if (ret)
dev_crit(dev, "Error executing keepalive: %d\n", ret);

return ret;
}

static int wdt_stop(struct watchdog_device *wd)
{
struct device *dev = watchdog_get_drvdata(wd);
int ret;

ret = wdt_command(SCU_WATCHDOG_STOP, NULL, 0);
if (ret) {
struct device *dev = watchdog_get_drvdata(wd);
dev_crit(dev, "Error stopping watchdog: 0x%x\n", ret);
}
if (ret)
dev_crit(dev, "Error stopping watchdog: %d\n", ret);

return ret;
}
Expand Down Expand Up @@ -151,6 +148,9 @@ static int mid_wdt_probe(struct platform_device *pdev)
return ret;
}

/* Make sure the watchdog is not running */
wdt_stop(wdt_dev);

ret = watchdog_register_device(wdt_dev);
if (ret) {
dev_err(&pdev->dev, "error registering watchdog device\n");
Expand Down
4 changes: 3 additions & 1 deletion drivers/watchdog/it87_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* http://www.ite.com.tw/
*
* Support of the watchdog timers, which are available on
* IT8702, IT8712, IT8716, IT8718, IT8720, IT8721, IT8726,
* IT8620, IT8702, IT8712, IT8716, IT8718, IT8720, IT8721, IT8726,
* IT8728 and IT8783.
*
* This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -78,6 +78,7 @@

/* Chip Id numbers */
#define NO_DEV_ID 0xffff
#define IT8620_ID 0x8620
#define IT8702_ID 0x8702
#define IT8705_ID 0x8705
#define IT8712_ID 0x8712
Expand Down Expand Up @@ -630,6 +631,7 @@ static int __init it87_wdt_init(void)
case IT8726_ID:
max_units = 65535;
break;
case IT8620_ID:
case IT8718_ID:
case IT8720_ID:
case IT8721_ID:
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/jz4740_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static const struct of_device_id jz4740_wdt_of_matches[] = {
{ .compatible = "ingenic,jz4740-watchdog", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, jz4740_wdt_of_matches)
MODULE_DEVICE_TABLE(of, jz4740_wdt_of_matches);
#endif

static int jz4740_wdt_probe(struct platform_device *pdev)
Expand Down
Loading

0 comments on commit 3a77fa8

Please sign in to comment.