Skip to content

Commit 032e22f

Browse files
committed
Merge tag 'linux-watchdog-6.9-rc1' of git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck: - Remove usage of the deprecated ida_simple_xx() API - Add kernel-doc for wdt_set_timeout() - Add support for R-Car V4M, StarFive's JH8100 and sam9x7-wdt - Fixes and small improvements * tag 'linux-watchdog-6.9-rc1' of git://www.linux-watchdog.org/linux-watchdog: watchdog: intel-mid_wdt: Get platform data via dev_get_platdata() watchdog: intel-mid_wdt: Don't use "proxy" headers watchdog: intel-mid_wdt: Remove unused intel-mid.h dt-bindings: watchdog: sama5d4-wdt: add compatible for sam9x7-wdt dt-bindings: watchdog: sprd,sp9860-wdt: convert to YAML dt-bindings: watchdog: starfive,jh7100-wdt: Add compatible for JH8100 watchdog: stm32_iwdg: initialize default timeout dt-bindings: watchdog: arm,sp805: document the reset signal watchdog: sp805_wdt: deassert the reset if available watchdog/hpwdt: Support Suspend and Resume dt-bindings: watchdog: renesas-wdt: Add support for R-Car V4M watchdog: starfive: check watchdog status before enabling in system resume watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter watchdog: qcom: fine tune the max timeout value calculation watchdog: Add kernel-doc for wdt_set_timeout() watchdog: core: Remove usage of the deprecated ida_simple_xx() API
2 parents 75e41d4 + 6fe5aab commit 032e22f

File tree

14 files changed

+182
-48
lines changed

14 files changed

+182
-48
lines changed

Documentation/devicetree/bindings/watchdog/arm,sp805.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ properties:
5050
- const: wdog_clk
5151
- const: apb_pclk
5252

53+
resets:
54+
maxItems: 1
55+
description: WDOGRESn input reset signal for sp805 module.
56+
5357
required:
5458
- compatible
5559
- reg
@@ -67,4 +71,5 @@ examples:
6771
interrupts = <GIC_SPI 406 IRQ_TYPE_LEVEL_HIGH>;
6872
clocks = <&wdt_clk>, <&apb_pclk>;
6973
clock-names = "wdog_clk", "apb_pclk";
74+
resets = <&wdt_rst>;
7075
};

Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ allOf:
1414

1515
properties:
1616
compatible:
17-
enum:
18-
- atmel,sama5d4-wdt
19-
- microchip,sam9x60-wdt
20-
- microchip,sama7g5-wdt
17+
oneOf:
18+
- enum:
19+
- atmel,sama5d4-wdt
20+
- microchip,sam9x60-wdt
21+
- microchip,sama7g5-wdt
22+
- items:
23+
- const: microchip,sam9x7-wdt
24+
- const: microchip,sam9x60-wdt
2125

2226
reg:
2327
maxItems: 1

Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ properties:
7171
- renesas,r8a779a0-wdt # R-Car V3U
7272
- renesas,r8a779f0-wdt # R-Car S4-8
7373
- renesas,r8a779g0-wdt # R-Car V4H
74+
- renesas,r8a779h0-wdt # R-Car V4M
7475
- const: renesas,rcar-gen4-wdt # R-Car Gen4
7576

7677
reg:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/watchdog/sprd,sp9860-wdt.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Spreadtrum SP9860 watchdog timer
8+
9+
maintainers:
10+
- Orson Zhai <orsonzhai@gmail.com>
11+
- Baolin Wang <baolin.wang7@gmail.com>
12+
- Chunyan Zhang <zhang.lyra@gmail.com>
13+
14+
allOf:
15+
- $ref: watchdog.yaml#
16+
17+
properties:
18+
compatible:
19+
const: sprd,sp9860-wdt
20+
21+
reg:
22+
maxItems: 1
23+
24+
interrupts:
25+
maxItems: 1
26+
27+
clocks:
28+
maxItems: 2
29+
30+
clock-names:
31+
items:
32+
- const: enable
33+
- const: rtc_enable
34+
35+
required:
36+
- compatible
37+
- reg
38+
- interrupts
39+
- clocks
40+
- clock-names
41+
- timeout-sec
42+
43+
unevaluatedProperties: false
44+
45+
examples:
46+
- |
47+
#include <dt-bindings/clock/sprd,sc9860-clk.h>
48+
#include <dt-bindings/interrupt-controller/arm-gic.h>
49+
#include <dt-bindings/interrupt-controller/irq.h>
50+
51+
soc {
52+
#address-cells = <2>;
53+
#size-cells = <2>;
54+
55+
watchdog@40310000 {
56+
compatible = "sprd,sp9860-wdt";
57+
reg = <0 0x40310000 0 0x1000>;
58+
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
59+
clocks = <&aon_gate CLK_APCPU_WDG_EB>, <&aon_gate CLK_AP_WDG_RTC_EB>;
60+
clock-names = "enable", "rtc_enable";
61+
timeout-sec = <12>;
62+
};
63+
};
64+
...

Documentation/devicetree/bindings/watchdog/sprd-wdt.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.

Documentation/devicetree/bindings/watchdog/starfive,jh7100-wdt.yaml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ description:
1919
isn't cleared, the watchdog will reset the system unless the watchdog
2020
reset is disabled.
2121

22-
allOf:
23-
- $ref: watchdog.yaml#
24-
2522
properties:
2623
compatible:
27-
enum:
28-
- starfive,jh7100-wdt
29-
- starfive,jh7110-wdt
24+
oneOf:
25+
- enum:
26+
- starfive,jh7100-wdt
27+
- starfive,jh7110-wdt
28+
- items:
29+
- enum:
30+
- starfive,jh8100-wdt
31+
- const: starfive,jh7110-wdt
3032

3133
reg:
3234
maxItems: 1
@@ -45,9 +47,8 @@ properties:
4547
- const: core
4648

4749
resets:
48-
items:
49-
- description: APB reset
50-
- description: Core reset
50+
minItems: 1
51+
maxItems: 2
5152

5253
required:
5354
- compatible
@@ -56,6 +57,27 @@ required:
5657
- clock-names
5758
- resets
5859

60+
allOf:
61+
- $ref: watchdog.yaml#
62+
63+
- if:
64+
properties:
65+
compatible:
66+
contains:
67+
enum:
68+
- starfive,jh8100-wdt
69+
then:
70+
properties:
71+
resets:
72+
items:
73+
- description: Core reset
74+
else:
75+
properties:
76+
resets:
77+
items:
78+
- description: APB reset
79+
- description: Core reset
80+
5981
unevaluatedProperties: false
6082

6183
examples:

drivers/watchdog/hpwdt.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
378378
pci_disable_device(dev);
379379
}
380380

381+
static int hpwdt_suspend(struct device *dev)
382+
{
383+
if (watchdog_active(&hpwdt_dev))
384+
hpwdt_stop();
385+
386+
return 0;
387+
}
388+
389+
static int hpwdt_resume(struct device *dev)
390+
{
391+
if (watchdog_active(&hpwdt_dev))
392+
hpwdt_start(&hpwdt_dev);
393+
394+
return 0;
395+
}
396+
397+
static const struct dev_pm_ops hpwdt_pm_ops = {
398+
LATE_SYSTEM_SLEEP_PM_OPS(hpwdt_suspend, hpwdt_resume)
399+
};
400+
381401
static struct pci_driver hpwdt_driver = {
382402
.name = "hpwdt",
383403
.id_table = hpwdt_devices,
384404
.probe = hpwdt_init_one,
385405
.remove = hpwdt_exit,
406+
407+
.driver = {
408+
.name = "hpwdt",
409+
.pm = &hpwdt_pm_ops,
410+
}
386411
};
387412

388413
MODULE_AUTHOR("Tom Mingarelli");

drivers/watchdog/intel-mid_wdt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@
99
* Contact: David Cohen <david.a.cohen@linux.intel.com>
1010
*/
1111

12+
#include <linux/bitops.h>
13+
#include <linux/device.h>
14+
#include <linux/errno.h>
1215
#include <linux/interrupt.h>
16+
#include <linux/math.h>
1317
#include <linux/module.h>
14-
#include <linux/nmi.h>
18+
#include <linux/panic.h>
1519
#include <linux/platform_device.h>
20+
#include <linux/types.h>
1621
#include <linux/watchdog.h>
22+
1723
#include <linux/platform_data/intel-mid_wdt.h>
1824

1925
#include <asm/intel_scu_ipc.h>
20-
#include <asm/intel-mid.h>
2126

2227
#define IPC_WATCHDOG 0xf8
2328

@@ -122,7 +127,7 @@ static int mid_wdt_probe(struct platform_device *pdev)
122127
{
123128
struct device *dev = &pdev->dev;
124129
struct watchdog_device *wdt_dev;
125-
struct intel_mid_wdt_pdata *pdata = dev->platform_data;
130+
struct intel_mid_wdt_pdata *pdata = dev_get_platdata(dev);
126131
struct mid_wdt *mid;
127132
int ret;
128133

drivers/watchdog/it87_wdt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,16 @@ static int wdt_stop(struct watchdog_device *wdd)
213213

214214
/**
215215
* wdt_set_timeout - set a new timeout value with watchdog ioctl
216+
* @wdd: pointer to the watchdog_device structure
216217
* @t: timeout value in seconds
217218
*
218219
* The hardware device has a 8 or 16 bit watchdog timer (depends on
219220
* chip version) that can be configured to count seconds or minutes.
220221
*
221222
* Used within WDIOC_SETTIMEOUT watchdog device ioctl.
223+
*
224+
* Return: 0 if the timeout was set successfully, or a negative error code on
225+
* failure.
222226
*/
223227

224228
static int wdt_set_timeout(struct watchdog_device *wdd, unsigned int t)

drivers/watchdog/qcom-wdt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static const u32 reg_offset_data_kpss[] = {
4141
struct qcom_wdt_match_data {
4242
const u32 *offset;
4343
bool pretimeout;
44+
u32 max_tick_count;
4445
};
4546

4647
struct qcom_wdt {
@@ -177,11 +178,13 @@ static const struct watchdog_info qcom_wdt_pt_info = {
177178
static const struct qcom_wdt_match_data match_data_apcs_tmr = {
178179
.offset = reg_offset_data_apcs_tmr,
179180
.pretimeout = false,
181+
.max_tick_count = 0x10000000U,
180182
};
181183

182184
static const struct qcom_wdt_match_data match_data_kpss = {
183185
.offset = reg_offset_data_kpss,
184186
.pretimeout = true,
187+
.max_tick_count = 0xFFFFFU,
185188
};
186189

187190
static int qcom_wdt_probe(struct platform_device *pdev)
@@ -236,7 +239,7 @@ static int qcom_wdt_probe(struct platform_device *pdev)
236239
*/
237240
wdt->rate = clk_get_rate(clk);
238241
if (wdt->rate == 0 ||
239-
wdt->rate > 0x10000000U) {
242+
wdt->rate > data->max_tick_count) {
240243
dev_err(dev, "invalid clock rate\n");
241244
return -EINVAL;
242245
}
@@ -260,7 +263,7 @@ static int qcom_wdt_probe(struct platform_device *pdev)
260263

261264
wdt->wdd.ops = &qcom_wdt_ops;
262265
wdt->wdd.min_timeout = 1;
263-
wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
266+
wdt->wdd.max_timeout = data->max_tick_count / wdt->rate;
264267
wdt->wdd.parent = dev;
265268
wdt->layout = data->offset;
266269

0 commit comments

Comments
 (0)