Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-watchdog-5.7-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

- add TI K3 RTI watchdog

- add stop_on_reboot parameter to control reboot policy

- wm831x_wdt: Remove GPIO handling

- several small fixes, improvements and clean-ups

* tag 'linux-watchdog-5.7-rc1' of git://www.linux-watchdog.org/linux-watchdog:
watchdog: Add K3 RTI watchdog support
dt-bindings: watchdog: Add support for TI K3 RTI watchdog
watchdog: ziirave_wdt: change name to be more specific
watchdog: orion: use 0 for unset heartbeat
watchdog: npcm: remove whitespaces
watchdog: reset last_hw_keepalive time at start
watchdog: imx2_wdt: Drop .remove callback
watchdog: Add stop_on_reboot parameter to control reboot policy
watchdog: wm831x_wdt: Remove GPIO handling
watchdog: imx7ulp: Remove unused include of init.h
watchdog: imx_sc_wdt: Remove unused includes
watchdog: qcom: Use irq flags from firmware
watchdog: pm8916_wdt: Add system sleep callbacks
watchdog: qcom-wdt: disable pretimeout on timer platform

+412 -80
+65
Documentation/devicetree/bindings/watchdog/ti,rti-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/ti,rti-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments K3 SoC Watchdog Timer 8 + 9 + maintainers: 10 + - Tero Kristo <t-kristo@ti.com> 11 + 12 + description: 13 + The TI K3 SoC watchdog timer is implemented via the RTI (Real Time 14 + Interrupt) IP module. This timer adds a support for windowed watchdog 15 + mode, which will signal an error if it is pinged outside the watchdog 16 + time window, meaning either too early or too late. The error signal 17 + generated can be routed to either interrupt a safety controller or 18 + to directly reset the SoC. 19 + 20 + allOf: 21 + - $ref: "watchdog.yaml#" 22 + 23 + properties: 24 + compatible: 25 + enum: 26 + - ti,j7-rti-wdt 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + clocks: 32 + maxItems: 1 33 + 34 + power-domains: 35 + maxItems: 1 36 + 37 + assigned-clocks: 38 + maxItems: 1 39 + 40 + assigned-clocks-parents: 41 + maxItems: 1 42 + 43 + required: 44 + - compatible 45 + - reg 46 + - clocks 47 + - power-domains 48 + 49 + examples: 50 + - | 51 + /* 52 + * RTI WDT in main domain on J721e SoC. Assigned clocks are used to 53 + * select the source clock for the watchdog, forcing it to tick with 54 + * a 32kHz clock in this case. 55 + */ 56 + #include <dt-bindings/soc/ti,sci_pm_domain.h> 57 + 58 + watchdog0: rti@2200000 { 59 + compatible = "ti,rti-wdt"; 60 + reg = <0x0 0x2200000 0x0 0x100>; 61 + clocks = <&k3_clks 252 1>; 62 + power-domains = <&k3_pds 252 TI_SCI_PD_EXCLUSIVE>; 63 + assigned-clocks = <&k3_clks 252 1>; 64 + assigned-clock-parents = <&k3_clks 252 5>; 65 + };
+8
drivers/watchdog/Kconfig
··· 584 584 NOTE: once enabled, this timer cannot be disabled. 585 585 Say N if you are unsure. 586 586 587 + config K3_RTI_WATCHDOG 588 + tristate "Texas Instruments K3 RTI watchdog" 589 + depends on ARCH_K3 || COMPILE_TEST 590 + select WATCHDOG_CORE 591 + help 592 + Say Y here if you want to include support for the K3 watchdog 593 + timer (RTI module) available in the K3 generation of processors. 594 + 587 595 config ORION_WATCHDOG 588 596 tristate "Orion watchdog" 589 597 depends on ARCH_ORION5X || ARCH_DOVE || MACH_DOVE || ARCH_MVEBU || (COMPILE_TEST && !ARCH_EBSA110)
+1
drivers/watchdog/Makefile
··· 57 57 obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o 58 58 obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o 59 59 obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o 60 + obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o 60 61 obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o 61 62 obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o 62 63 obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
+10 -27
drivers/watchdog/imx2_wdt.c
··· 244 244 .max_register = 0x8, 245 245 }; 246 246 247 + static void imx2_wdt_action(void *data) 248 + { 249 + clk_disable_unprepare(data); 250 + } 251 + 247 252 static int __init imx2_wdt_probe(struct platform_device *pdev) 248 253 { 249 254 struct device *dev = &pdev->dev; ··· 297 292 if (ret) 298 293 return ret; 299 294 295 + ret = devm_add_action_or_reset(dev, imx2_wdt_action, wdev->clk); 296 + if (ret) 297 + return ret; 298 + 300 299 regmap_read(wdev->regmap, IMX2_WDT_WRSR, &val); 301 300 wdog->bootstatus = val & IMX2_WDT_WRSR_TOUT ? WDIOF_CARDRESET : 0; 302 301 ··· 324 315 */ 325 316 regmap_write(wdev->regmap, IMX2_WDT_WMCR, 0); 326 317 327 - ret = watchdog_register_device(wdog); 328 - if (ret) 329 - goto disable_clk; 330 - 331 - dev_info(dev, "timeout %d sec (nowayout=%d)\n", 332 - wdog->timeout, nowayout); 333 - 334 - return 0; 335 - 336 - disable_clk: 337 - clk_disable_unprepare(wdev->clk); 338 - return ret; 339 - } 340 - 341 - static int __exit imx2_wdt_remove(struct platform_device *pdev) 342 - { 343 - struct watchdog_device *wdog = platform_get_drvdata(pdev); 344 - struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); 345 - 346 - watchdog_unregister_device(wdog); 347 - 348 - if (imx2_wdt_is_running(wdev)) { 349 - imx2_wdt_ping(wdog); 350 - dev_crit(&pdev->dev, "Device removed: Expect reboot!\n"); 351 - } 352 - return 0; 318 + return devm_watchdog_register_device(dev, wdog); 353 319 } 354 320 355 321 static void imx2_wdt_shutdown(struct platform_device *pdev) ··· 401 417 MODULE_DEVICE_TABLE(of, imx2_wdt_dt_ids); 402 418 403 419 static struct platform_driver imx2_wdt_driver = { 404 - .remove = __exit_p(imx2_wdt_remove), 405 420 .shutdown = imx2_wdt_shutdown, 406 421 .driver = { 407 422 .name = DRIVER_NAME,
-1
drivers/watchdog/imx7ulp_wdt.c
··· 4 4 */ 5 5 6 6 #include <linux/clk.h> 7 - #include <linux/init.h> 8 7 #include <linux/io.h> 9 8 #include <linux/kernel.h> 10 9 #include <linux/module.h>
-2
drivers/watchdog/imx_sc_wdt.c
··· 6 6 #include <linux/arm-smccc.h> 7 7 #include <linux/firmware/imx/sci.h> 8 8 #include <linux/io.h> 9 - #include <linux/init.h> 10 9 #include <linux/kernel.h> 11 10 #include <linux/module.h> 12 11 #include <linux/moduleparam.h> 13 12 #include <linux/of.h> 14 13 #include <linux/platform_device.h> 15 - #include <linux/reboot.h> 16 14 #include <linux/watchdog.h> 17 15 18 16 #define DEFAULT_TIMEOUT 60
+9 -10
drivers/watchdog/npcm_wdt.c
··· 103 103 return 0; 104 104 } 105 105 106 - 107 106 static int npcm_wdt_set_timeout(struct watchdog_device *wdd, 108 107 unsigned int timeout) 109 108 { 110 109 if (timeout < 2) 111 110 wdd->timeout = 1; 112 111 else if (timeout < 3) 113 - wdd->timeout = 2; 112 + wdd->timeout = 2; 114 113 else if (timeout < 6) 115 - wdd->timeout = 5; 114 + wdd->timeout = 5; 116 115 else if (timeout < 11) 117 - wdd->timeout = 10; 116 + wdd->timeout = 10; 118 117 else if (timeout < 22) 119 - wdd->timeout = 21; 118 + wdd->timeout = 21; 120 119 else if (timeout < 44) 121 - wdd->timeout = 43; 120 + wdd->timeout = 43; 122 121 else if (timeout < 87) 123 - wdd->timeout = 86; 122 + wdd->timeout = 86; 124 123 else if (timeout < 173) 125 - wdd->timeout = 172; 124 + wdd->timeout = 172; 126 125 else if (timeout < 688) 127 - wdd->timeout = 687; 126 + wdd->timeout = 687; 128 127 else 129 - wdd->timeout = 2750; 128 + wdd->timeout = 2750; 130 129 131 130 if (watchdog_active(wdd)) 132 131 npcm_wdt_start(wdd);
+1 -1
drivers/watchdog/orion_wdt.c
··· 52 52 #define WDT_A370_RATIO (1 << WDT_A370_RATIO_SHIFT) 53 53 54 54 static bool nowayout = WATCHDOG_NOWAYOUT; 55 - static int heartbeat = -1; /* module parameter (seconds) */ 55 + static int heartbeat; /* module parameter (seconds) */ 56 56 57 57 struct orion_watchdog; 58 58
+25
drivers/watchdog/pm8916_wdt.c
··· 192 192 wdt->wdev.timeout = PM8916_WDT_DEFAULT_TIMEOUT; 193 193 wdt->wdev.pretimeout = 0; 194 194 watchdog_set_drvdata(&wdt->wdev, wdt); 195 + platform_set_drvdata(pdev, wdt); 195 196 196 197 watchdog_init_timeout(&wdt->wdev, 0, dev); 197 198 pm8916_wdt_configure_timers(&wdt->wdev); 198 199 199 200 return devm_watchdog_register_device(dev, &wdt->wdev); 200 201 } 202 + 203 + static int __maybe_unused pm8916_wdt_suspend(struct device *dev) 204 + { 205 + struct pm8916_wdt *wdt = dev_get_drvdata(dev); 206 + 207 + if (watchdog_active(&wdt->wdev)) 208 + return pm8916_wdt_stop(&wdt->wdev); 209 + 210 + return 0; 211 + } 212 + 213 + static int __maybe_unused pm8916_wdt_resume(struct device *dev) 214 + { 215 + struct pm8916_wdt *wdt = dev_get_drvdata(dev); 216 + 217 + if (watchdog_active(&wdt->wdev)) 218 + return pm8916_wdt_start(&wdt->wdev); 219 + 220 + return 0; 221 + } 222 + 223 + static SIMPLE_DEV_PM_OPS(pm8916_wdt_pm_ops, pm8916_wdt_suspend, 224 + pm8916_wdt_resume); 201 225 202 226 static const struct of_device_id pm8916_wdt_id_table[] = { 203 227 { .compatible = "qcom,pm8916-wdt" }, ··· 234 210 .driver = { 235 211 .name = "pm8916-wdt", 236 212 .of_match_table = of_match_ptr(pm8916_wdt_id_table), 213 + .pm = &pm8916_wdt_pm_ops, 237 214 }, 238 215 }; 239 216 module_platform_driver(pm8916_wdt_driver);
+24 -10
drivers/watchdog/qcom-wdt.c
··· 40 40 [WDT_BITE_TIME] = 0x14, 41 41 }; 42 42 43 + struct qcom_wdt_match_data { 44 + const u32 *offset; 45 + bool pretimeout; 46 + }; 47 + 43 48 struct qcom_wdt { 44 49 struct watchdog_device wdd; 45 50 unsigned long rate; ··· 184 179 clk_disable_unprepare(data); 185 180 } 186 181 182 + static const struct qcom_wdt_match_data match_data_apcs_tmr = { 183 + .offset = reg_offset_data_apcs_tmr, 184 + .pretimeout = false, 185 + }; 186 + 187 + static const struct qcom_wdt_match_data match_data_kpss = { 188 + .offset = reg_offset_data_kpss, 189 + .pretimeout = true, 190 + }; 191 + 187 192 static int qcom_wdt_probe(struct platform_device *pdev) 188 193 { 189 194 struct device *dev = &pdev->dev; 190 195 struct qcom_wdt *wdt; 191 196 struct resource *res; 192 197 struct device_node *np = dev->of_node; 193 - const u32 *regs; 198 + const struct qcom_wdt_match_data *data; 194 199 u32 percpu_offset; 195 200 int irq, ret; 196 201 struct clk *clk; 197 202 198 - regs = of_device_get_match_data(dev); 199 - if (!regs) { 203 + data = of_device_get_match_data(dev); 204 + if (!data) { 200 205 dev_err(dev, "Unsupported QCOM WDT module\n"); 201 206 return -ENODEV; 202 207 } ··· 262 247 263 248 /* check if there is pretimeout support */ 264 249 irq = platform_get_irq_optional(pdev, 0); 265 - if (irq > 0) { 266 - ret = devm_request_irq(dev, irq, qcom_wdt_isr, 267 - IRQF_TRIGGER_RISING, 250 + if (data->pretimeout && irq > 0) { 251 + ret = devm_request_irq(dev, irq, qcom_wdt_isr, 0, 268 252 "wdt_bark", &wdt->wdd); 269 253 if (ret) 270 254 return ret; ··· 281 267 wdt->wdd.min_timeout = 1; 282 268 wdt->wdd.max_timeout = 0x10000000U / wdt->rate; 283 269 wdt->wdd.parent = dev; 284 - wdt->layout = regs; 270 + wdt->layout = data->offset; 285 271 286 272 if (readl(wdt_addr(wdt, WDT_STS)) & 1) 287 273 wdt->wdd.bootstatus = WDIOF_CARDRESET; ··· 325 311 static SIMPLE_DEV_PM_OPS(qcom_wdt_pm_ops, qcom_wdt_suspend, qcom_wdt_resume); 326 312 327 313 static const struct of_device_id qcom_wdt_of_table[] = { 328 - { .compatible = "qcom,kpss-timer", .data = reg_offset_data_apcs_tmr }, 329 - { .compatible = "qcom,scss-timer", .data = reg_offset_data_apcs_tmr }, 330 - { .compatible = "qcom,kpss-wdt", .data = reg_offset_data_kpss }, 314 + { .compatible = "qcom,kpss-timer", .data = &match_data_apcs_tmr }, 315 + { .compatible = "qcom,scss-timer", .data = &match_data_apcs_tmr }, 316 + { .compatible = "qcom,kpss-wdt", .data = &match_data_kpss }, 331 317 { }, 332 318 }; 333 319 MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
+255
drivers/watchdog/rti_wdt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Watchdog driver for the K3 RTI module 4 + * 5 + * (c) Copyright 2019-2020 Texas Instruments Inc. 6 + * All rights reserved. 7 + */ 8 + 9 + #include <linux/clk.h> 10 + #include <linux/device.h> 11 + #include <linux/err.h> 12 + #include <linux/io.h> 13 + #include <linux/kernel.h> 14 + #include <linux/mod_devicetable.h> 15 + #include <linux/module.h> 16 + #include <linux/moduleparam.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/pm_runtime.h> 19 + #include <linux/types.h> 20 + #include <linux/watchdog.h> 21 + 22 + #define DEFAULT_HEARTBEAT 60 23 + 24 + /* Max heartbeat is calculated at 32kHz source clock */ 25 + #define MAX_HEARTBEAT 1000 26 + 27 + /* Timer register set definition */ 28 + #define RTIDWDCTRL 0x90 29 + #define RTIDWDPRLD 0x94 30 + #define RTIWDSTATUS 0x98 31 + #define RTIWDKEY 0x9c 32 + #define RTIDWDCNTR 0xa0 33 + #define RTIWWDRXCTRL 0xa4 34 + #define RTIWWDSIZECTRL 0xa8 35 + 36 + #define RTIWWDRX_NMI 0xa 37 + 38 + #define RTIWWDSIZE_50P 0x50 39 + 40 + #define WDENABLE_KEY 0xa98559da 41 + 42 + #define WDKEY_SEQ0 0xe51a 43 + #define WDKEY_SEQ1 0xa35c 44 + 45 + #define WDT_PRELOAD_SHIFT 13 46 + 47 + #define WDT_PRELOAD_MAX 0xfff 48 + 49 + #define DWDST BIT(1) 50 + 51 + static int heartbeat; 52 + 53 + /* 54 + * struct to hold data for each WDT device 55 + * @base - base io address of WD device 56 + * @freq - source clock frequency of WDT 57 + * @wdd - hold watchdog device as is in WDT core 58 + */ 59 + struct rti_wdt_device { 60 + void __iomem *base; 61 + unsigned long freq; 62 + struct watchdog_device wdd; 63 + }; 64 + 65 + static int rti_wdt_start(struct watchdog_device *wdd) 66 + { 67 + u32 timer_margin; 68 + struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); 69 + 70 + /* set timeout period */ 71 + timer_margin = (u64)wdd->timeout * wdt->freq; 72 + timer_margin >>= WDT_PRELOAD_SHIFT; 73 + if (timer_margin > WDT_PRELOAD_MAX) 74 + timer_margin = WDT_PRELOAD_MAX; 75 + writel_relaxed(timer_margin, wdt->base + RTIDWDPRLD); 76 + 77 + /* 78 + * RTI only supports a windowed mode, where the watchdog can only 79 + * be petted during the open window; not too early or not too late. 80 + * The HW configuration options only allow for the open window size 81 + * to be 50% or less than that; we obviouly want to configure the open 82 + * window as large as possible so we select the 50% option. To avoid 83 + * any glitches, we accommodate 5% safety margin also, so we setup 84 + * the min_hw_hearbeat at 55% of the timeout period. 85 + */ 86 + wdd->min_hw_heartbeat_ms = 11 * wdd->timeout * 1000 / 20; 87 + 88 + /* Generate NMI when wdt expires */ 89 + writel_relaxed(RTIWWDRX_NMI, wdt->base + RTIWWDRXCTRL); 90 + 91 + /* Open window size 50%; this is the largest window size available */ 92 + writel_relaxed(RTIWWDSIZE_50P, wdt->base + RTIWWDSIZECTRL); 93 + 94 + readl_relaxed(wdt->base + RTIWWDSIZECTRL); 95 + 96 + /* enable watchdog */ 97 + writel_relaxed(WDENABLE_KEY, wdt->base + RTIDWDCTRL); 98 + return 0; 99 + } 100 + 101 + static int rti_wdt_ping(struct watchdog_device *wdd) 102 + { 103 + struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); 104 + 105 + /* put watchdog in service state */ 106 + writel_relaxed(WDKEY_SEQ0, wdt->base + RTIWDKEY); 107 + /* put watchdog in active state */ 108 + writel_relaxed(WDKEY_SEQ1, wdt->base + RTIWDKEY); 109 + 110 + return 0; 111 + } 112 + 113 + static unsigned int rti_wdt_get_timeleft(struct watchdog_device *wdd) 114 + { 115 + u64 timer_counter; 116 + u32 val; 117 + struct rti_wdt_device *wdt = watchdog_get_drvdata(wdd); 118 + 119 + /* if timeout has occurred then return 0 */ 120 + val = readl_relaxed(wdt->base + RTIWDSTATUS); 121 + if (val & DWDST) 122 + return 0; 123 + 124 + timer_counter = readl_relaxed(wdt->base + RTIDWDCNTR); 125 + 126 + do_div(timer_counter, wdt->freq); 127 + 128 + return timer_counter; 129 + } 130 + 131 + static const struct watchdog_info rti_wdt_info = { 132 + .options = WDIOF_KEEPALIVEPING, 133 + .identity = "K3 RTI Watchdog", 134 + }; 135 + 136 + static const struct watchdog_ops rti_wdt_ops = { 137 + .owner = THIS_MODULE, 138 + .start = rti_wdt_start, 139 + .ping = rti_wdt_ping, 140 + .get_timeleft = rti_wdt_get_timeleft, 141 + }; 142 + 143 + static int rti_wdt_probe(struct platform_device *pdev) 144 + { 145 + int ret = 0; 146 + struct device *dev = &pdev->dev; 147 + struct resource *wdt_mem; 148 + struct watchdog_device *wdd; 149 + struct rti_wdt_device *wdt; 150 + struct clk *clk; 151 + 152 + wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); 153 + if (!wdt) 154 + return -ENOMEM; 155 + 156 + clk = clk_get(dev, NULL); 157 + if (IS_ERR(clk)) { 158 + if (PTR_ERR(clk) != -EPROBE_DEFER) 159 + dev_err(dev, "failed to get clock\n"); 160 + return PTR_ERR(clk); 161 + } 162 + 163 + wdt->freq = clk_get_rate(clk); 164 + 165 + clk_put(clk); 166 + 167 + if (!wdt->freq) { 168 + dev_err(dev, "Failed to get fck rate.\n"); 169 + return -EINVAL; 170 + } 171 + 172 + pm_runtime_enable(dev); 173 + ret = pm_runtime_get_sync(dev); 174 + if (ret) { 175 + if (ret != -EPROBE_DEFER) 176 + dev_err(&pdev->dev, "runtime pm failed\n"); 177 + return ret; 178 + } 179 + 180 + platform_set_drvdata(pdev, wdt); 181 + 182 + wdd = &wdt->wdd; 183 + wdd->info = &rti_wdt_info; 184 + wdd->ops = &rti_wdt_ops; 185 + wdd->min_timeout = 1; 186 + wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) / 187 + wdt->freq * 1000; 188 + wdd->timeout = DEFAULT_HEARTBEAT; 189 + wdd->parent = dev; 190 + 191 + watchdog_init_timeout(wdd, heartbeat, dev); 192 + 193 + watchdog_set_drvdata(wdd, wdt); 194 + watchdog_set_nowayout(wdd, 1); 195 + watchdog_set_restart_priority(wdd, 128); 196 + 197 + wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 198 + wdt->base = devm_ioremap_resource(dev, wdt_mem); 199 + if (IS_ERR(wdt->base)) { 200 + ret = PTR_ERR(wdt->base); 201 + goto err_iomap; 202 + } 203 + 204 + ret = watchdog_register_device(wdd); 205 + if (ret) { 206 + dev_err(dev, "cannot register watchdog device\n"); 207 + goto err_iomap; 208 + } 209 + 210 + return 0; 211 + 212 + err_iomap: 213 + pm_runtime_put_sync(&pdev->dev); 214 + 215 + return ret; 216 + } 217 + 218 + static int rti_wdt_remove(struct platform_device *pdev) 219 + { 220 + struct rti_wdt_device *wdt = platform_get_drvdata(pdev); 221 + 222 + watchdog_unregister_device(&wdt->wdd); 223 + pm_runtime_put(&pdev->dev); 224 + 225 + return 0; 226 + } 227 + 228 + static const struct of_device_id rti_wdt_of_match[] = { 229 + { .compatible = "ti,j7-rti-wdt", }, 230 + {}, 231 + }; 232 + MODULE_DEVICE_TABLE(of, rti_wdt_of_match); 233 + 234 + static struct platform_driver rti_wdt_driver = { 235 + .driver = { 236 + .name = "rti-wdt", 237 + .of_match_table = rti_wdt_of_match, 238 + }, 239 + .probe = rti_wdt_probe, 240 + .remove = rti_wdt_remove, 241 + }; 242 + 243 + module_platform_driver(rti_wdt_driver); 244 + 245 + MODULE_AUTHOR("Tero Kristo <t-kristo@ti.com>"); 246 + MODULE_DESCRIPTION("K3 RTI Watchdog Driver"); 247 + 248 + module_param(heartbeat, int, 0); 249 + MODULE_PARM_DESC(heartbeat, 250 + "Watchdog heartbeat period in seconds from 1 to " 251 + __MODULE_STRING(MAX_HEARTBEAT) ", default " 252 + __MODULE_STRING(DEFAULT_HEARTBEAT)); 253 + 254 + MODULE_LICENSE("GPL"); 255 + MODULE_ALIAS("platform:rti-wdt");
+12
drivers/watchdog/watchdog_core.c
··· 39 39 40 40 static DEFINE_IDA(watchdog_ida); 41 41 42 + static int stop_on_reboot = -1; 43 + module_param(stop_on_reboot, int, 0444); 44 + MODULE_PARM_DESC(stop_on_reboot, "Stop watchdogs on reboot (0=keep watching, 1=stop)"); 45 + 42 46 /* 43 47 * Deferred Registration infrastructure. 44 48 * ··· 256 252 ida_simple_remove(&watchdog_ida, id); 257 253 return ret; 258 254 } 255 + } 256 + 257 + /* Module parameter to force watchdog policy on reboot. */ 258 + if (stop_on_reboot != -1) { 259 + if (stop_on_reboot) 260 + set_bit(WDOG_STOP_ON_REBOOT, &wdd->status); 261 + else 262 + clear_bit(WDOG_STOP_ON_REBOOT, &wdd->status); 259 263 } 260 264 261 265 if (test_bit(WDOG_STOP_ON_REBOOT, &wdd->status)) {
+1
drivers/watchdog/watchdog_dev.c
··· 282 282 if (err == 0) { 283 283 set_bit(WDOG_ACTIVE, &wdd->status); 284 284 wd_data->last_keepalive = started_at; 285 + wd_data->last_hw_keepalive = started_at; 285 286 watchdog_update_worker(wdd); 286 287 } 287 288
-27
drivers/watchdog/wm831x_wdt.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/watchdog.h> 15 15 #include <linux/uaccess.h> 16 - #include <linux/gpio.h> 17 16 18 17 #include <linux/mfd/wm831x/core.h> 19 18 #include <linux/mfd/wm831x/pdata.h> ··· 28 29 struct watchdog_device wdt; 29 30 struct wm831x *wm831x; 30 31 struct mutex lock; 31 - int update_gpio; 32 32 int update_state; 33 33 }; 34 34 ··· 100 102 u16 reg; 101 103 102 104 mutex_lock(&driver_data->lock); 103 - 104 - if (driver_data->update_gpio) { 105 - gpio_set_value_cansleep(driver_data->update_gpio, 106 - driver_data->update_state); 107 - driver_data->update_state = !driver_data->update_state; 108 - ret = 0; 109 - goto out; 110 - } 111 105 112 106 reg = wm831x_reg_read(wm831x, WM831X_WATCHDOG); 113 107 ··· 228 238 reg |= pdata->primary << WM831X_WDOG_PRIMACT_SHIFT; 229 239 reg |= pdata->secondary << WM831X_WDOG_SECACT_SHIFT; 230 240 reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT; 231 - 232 - if (pdata->update_gpio) { 233 - ret = devm_gpio_request_one(dev, pdata->update_gpio, 234 - GPIOF_OUT_INIT_LOW, 235 - "Watchdog update"); 236 - if (ret < 0) { 237 - dev_err(wm831x->dev, 238 - "Failed to request update GPIO: %d\n", 239 - ret); 240 - return ret; 241 - } 242 - 243 - driver_data->update_gpio = pdata->update_gpio; 244 - 245 - /* Make sure the watchdog takes hardware updates */ 246 - reg |= WM831X_WDOG_RST_SRC; 247 - } 248 241 249 242 ret = wm831x_reg_unlock(wm831x); 250 243 if (ret == 0) {
+1 -1
drivers/watchdog/ziirave_wdt.c
··· 422 422 423 423 static const struct watchdog_info ziirave_wdt_info = { 424 424 .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, 425 - .identity = "Zodiac RAVE Watchdog", 425 + .identity = "RAVE Switch Watchdog", 426 426 }; 427 427 428 428 static const struct watchdog_ops ziirave_wdt_ops = {
-1
include/linux/mfd/wm831x/pdata.h
··· 89 89 90 90 struct wm831x_watchdog_pdata { 91 91 enum wm831x_watchdog_action primary, secondary; 92 - int update_gpio; 93 92 unsigned int software:1; 94 93 }; 95 94