Commit e46096b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'linux-watchdog-4.17-rc2' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog fixes from Wim Van Sebroeck:

 - fall-through fixes

 - MAINTAINER change for hpwdt

 - renesas-wdt: Add support for WDIOF_CARDRESET

 - aspeed: set bootstatus during probe

* tag 'linux-watchdog-4.17-rc2' of git://www.linux-watchdog.org/linux-watchdog:
  aspeed: watchdog: Set bootstatus during probe
  watchdog: renesas-wdt: Add support for WDIOF_CARDRESET
  watchdog: wafer5823wdt: Mark expected switch fall-through
  watchdog: w83977f_wdt: Mark expected switch fall-through
  watchdog: sch311x_wdt: Mark expected switch fall-through
  watchdog: hpwdt: change maintainer.
parents 6488ec26 49d4d277
...@@ -6268,7 +6268,7 @@ S: Odd Fixes ...@@ -6268,7 +6268,7 @@ S: Odd Fixes
F: drivers/media/usb/hdpvr/ F: drivers/media/usb/hdpvr/
HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
M: Jimmy Vance <jimmy.vance@hpe.com> M: Jerry Hoemann <jerry.hoemann@hpe.com>
S: Supported S: Supported
F: Documentation/watchdog/hpwdt.txt F: Documentation/watchdog/hpwdt.txt
F: drivers/watchdog/hpwdt.c F: drivers/watchdog/hpwdt.c
......
...@@ -55,6 +55,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); ...@@ -55,6 +55,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
#define WDT_CTRL_WDT_INTR BIT(2) #define WDT_CTRL_WDT_INTR BIT(2)
#define WDT_CTRL_RESET_SYSTEM BIT(1) #define WDT_CTRL_RESET_SYSTEM BIT(1)
#define WDT_CTRL_ENABLE BIT(0) #define WDT_CTRL_ENABLE BIT(0)
#define WDT_TIMEOUT_STATUS 0x10
#define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1)
/* /*
* WDT_RESET_WIDTH controls the characteristics of the external pulse (if * WDT_RESET_WIDTH controls the characteristics of the external pulse (if
...@@ -192,6 +194,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev) ...@@ -192,6 +194,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
struct device_node *np; struct device_node *np;
const char *reset_type; const char *reset_type;
u32 duration; u32 duration;
u32 status;
int ret; int ret;
wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
...@@ -307,6 +310,10 @@ static int aspeed_wdt_probe(struct platform_device *pdev) ...@@ -307,6 +310,10 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
writel(duration - 1, wdt->base + WDT_RESET_WIDTH); writel(duration - 1, wdt->base + WDT_RESET_WIDTH);
} }
status = readl(wdt->base + WDT_TIMEOUT_STATUS);
if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY)
wdt->wdd.bootstatus = WDIOF_CARDRESET;
ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd); ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to register\n"); dev_err(&pdev->dev, "failed to register\n");
......
...@@ -121,7 +121,8 @@ static int rwdt_restart(struct watchdog_device *wdev, unsigned long action, ...@@ -121,7 +121,8 @@ static int rwdt_restart(struct watchdog_device *wdev, unsigned long action,
} }
static const struct watchdog_info rwdt_ident = { static const struct watchdog_info rwdt_ident = {
.options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT, .options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
WDIOF_CARDRESET,
.identity = "Renesas WDT Watchdog", .identity = "Renesas WDT Watchdog",
}; };
...@@ -197,9 +198,10 @@ static int rwdt_probe(struct platform_device *pdev) ...@@ -197,9 +198,10 @@ static int rwdt_probe(struct platform_device *pdev)
return PTR_ERR(clk); return PTR_ERR(clk);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev); pm_runtime_get_sync(&pdev->dev);
priv->clk_rate = clk_get_rate(clk); priv->clk_rate = clk_get_rate(clk);
priv->wdev.bootstatus = (readb_relaxed(priv->base + RWTCSRA) &
RWTCSRA_WOVF) ? WDIOF_CARDRESET : 0;
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
if (!priv->clk_rate) { if (!priv->clk_rate) {
......
...@@ -299,7 +299,7 @@ static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -299,7 +299,7 @@ static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd,
if (sch311x_wdt_set_heartbeat(new_timeout)) if (sch311x_wdt_set_heartbeat(new_timeout))
return -EINVAL; return -EINVAL;
sch311x_wdt_keepalive(); sch311x_wdt_keepalive();
/* Fall */ /* Fall through */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -427,7 +427,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -427,7 +427,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL; return -EINVAL;
wdt_keepalive(); wdt_keepalive();
/* Fall */ /* Fall through */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, uarg.i); return put_user(timeout, uarg.i);
......
...@@ -178,7 +178,7 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd, ...@@ -178,7 +178,7 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
timeout = new_timeout; timeout = new_timeout;
wafwdt_stop(); wafwdt_stop();
wafwdt_start(); wafwdt_start();
/* Fall */ /* Fall through */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment