Skip to content

Commit bb1556e

Browse files
committed
Merge tag 'linux-watchdog-6.16-rc1' of git://www.linux-watchdog.org/linux-watchdog
Pull watchdog updates from Wim Van Sebroeck: - Add watchdog timer for the NXP S32 platform - Add driver for Intel OC WDT - Add exynos990-wdt - Various other fixes and improvements * tag 'linux-watchdog-6.16-rc1' of git://www.linux-watchdog.org/linux-watchdog: (22 commits) watchdog: iTCO_wdt: Update the heartbeat value after clamping timeout watchdog: Add driver for Intel OC WDT watchdog: arm_smc_wdt: get wdt status through SMCWD_GET_TIMELEFT watchdog: iTCO: Drop driver-internal locking watchdog: apple: set max_hw_heartbeat_ms instead of max_timeout watchdog: qcom: introduce the device data for IPQ5424 watchdog device dt-bindings: watchdog: renesas,wdt: Document RZ/V2N (R9A09G056) support watchdog: lenovo_se30_wdt: Fix possible devm_ioremap() NULL pointer dereference in lenovo_se30_wdt_probe() watchdog: s3c2410_wdt: Add exynos990-wdt compatible data dt-bindings: watchdog: samsung-wdt: Add exynos990-wdt compatible dt-bindings: watchdog: Add rk3562 compatible dt-bindings: watchdog: fsl,scu-wdt: Document imx8qm watchdog: Add the Watchdog Timer for the NXP S32 platform dt-bindings: watchdog: Add NXP Software Watchdog Timer watchdog: Correct kerneldoc warnings watchdog: stm32: Fix wakeup source leaks on device unbind watchdog: Do not enable by default during compile testing watchdog: cros-ec: Avoid -Wflex-array-member-not-at-end warning watchdog: da9052_wdt: respect TWDMIN watchdog: da9052_wdt: do not disable wdt during probe ...
2 parents a2604f8 + 158f9f2 commit bb1556e

22 files changed

+749
-66
lines changed

Documentation/devicetree/bindings/watchdog/fsl,scu-wdt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ properties:
2020
items:
2121
- enum:
2222
- fsl,imx8dxl-sc-wdt
23+
- fsl,imx8qm-sc-wdt
2324
- fsl,imx8qxp-sc-wdt
2425
- const: fsl,imx-sc-wdt
2526

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/watchdog/nxp,s32g2-swt.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP Software Watchdog Timer (SWT)
8+
9+
maintainers:
10+
- Daniel Lezcano <[email protected]>
11+
12+
allOf:
13+
- $ref: watchdog.yaml#
14+
15+
properties:
16+
compatible:
17+
oneOf:
18+
- const: nxp,s32g2-swt
19+
- items:
20+
- const: nxp,s32g3-swt
21+
- const: nxp,s32g2-swt
22+
23+
reg:
24+
maxItems: 1
25+
26+
clocks:
27+
items:
28+
- description: Counter clock
29+
- description: Module clock
30+
- description: Register clock
31+
32+
clock-names:
33+
items:
34+
- const: counter
35+
- const: module
36+
- const: register
37+
38+
required:
39+
- compatible
40+
- reg
41+
- clocks
42+
- clock-names
43+
44+
unevaluatedProperties: false
45+
46+
examples:
47+
- |
48+
watchdog@40100000 {
49+
compatible = "nxp,s32g2-swt";
50+
reg = <0x40100000 0x1000>;
51+
clocks = <&clks 0x3a>, <&clks 0x3b>, <&clks 0x3c>;
52+
clock-names = "counter", "module", "register";
53+
timeout-sec = <10>;
54+
};

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ properties:
7676
- const: renesas,rcar-gen4-wdt # R-Car Gen4
7777

7878
- items:
79-
- const: renesas,r9a09g047-wdt # RZ/G3E
79+
- enum:
80+
- renesas,r9a09g047-wdt # RZ/G3E
81+
- renesas,r9a09g056-wdt # RZ/V2N
8082
- const: renesas,r9a09g057-wdt # RZ/V2H(P)
8183

8284
- const: renesas,r9a09g057-wdt # RZ/V2H(P)

Documentation/devicetree/bindings/watchdog/samsung-wdt.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ properties:
2525
- samsung,exynos5420-wdt # for Exynos5420
2626
- samsung,exynos7-wdt # for Exynos7
2727
- samsung,exynos850-wdt # for Exynos850
28+
- samsung,exynos990-wdt # for Exynos990
2829
- samsung,exynosautov9-wdt # for Exynosautov9
2930
- samsung,exynosautov920-wdt # for Exynosautov920
3031
- items:
@@ -49,14 +50,14 @@ properties:
4950
samsung,cluster-index:
5051
$ref: /schemas/types.yaml#/definitions/uint32
5152
description:
52-
Index of CPU cluster on which watchdog is running (in case of Exynos850
53-
or Google gs101).
53+
Index of CPU cluster on which watchdog is running (in case of Exynos850,
54+
Exynos990 or Google gs101).
5455

5556
samsung,syscon-phandle:
5657
$ref: /schemas/types.yaml#/definitions/phandle
5758
description:
5859
Phandle to the PMU system controller node (in case of Exynos5250,
59-
Exynos5420, Exynos7, Exynos850 and gs101).
60+
Exynos5420, Exynos7, Exynos850, Exynos990 and gs101).
6061

6162
required:
6263
- compatible
@@ -77,6 +78,7 @@ allOf:
7778
- samsung,exynos5420-wdt
7879
- samsung,exynos7-wdt
7980
- samsung,exynos850-wdt
81+
- samsung,exynos990-wdt
8082
- samsung,exynosautov9-wdt
8183
- samsung,exynosautov920-wdt
8284
then:
@@ -89,6 +91,7 @@ allOf:
8991
enum:
9092
- google,gs101-wdt
9193
- samsung,exynos850-wdt
94+
- samsung,exynos990-wdt
9295
- samsung,exynosautov9-wdt
9396
- samsung,exynosautov920-wdt
9497
then:
@@ -102,7 +105,7 @@ allOf:
102105
- const: watchdog
103106
- const: watchdog_src
104107
samsung,cluster-index:
105-
enum: [0, 1]
108+
enum: [0, 1, 2]
106109
required:
107110
- samsung,cluster-index
108111
else:

Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- rockchip,rk3328-wdt
2929
- rockchip,rk3368-wdt
3030
- rockchip,rk3399-wdt
31+
- rockchip,rk3562-wdt
3132
- rockchip,rk3568-wdt
3233
- rockchip,rk3576-wdt
3334
- rockchip,rk3588-wdt

drivers/watchdog/Kconfig

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,15 @@ config IMX7ULP_WDT
804804
To compile this driver as a module, choose M here: the
805805
module will be called imx7ulp_wdt.
806806

807+
config S32G_WDT
808+
tristate "S32G Watchdog"
809+
depends on ARCH_S32 || COMPILE_TEST
810+
select WATCHDOG_CORE
811+
help
812+
This is the driver for the hardware watchdog on the NXP
813+
S32G platforms. If you wish to have watchdog support
814+
enabled, say Y, otherwise say N.
815+
807816
config DB500_WATCHDOG
808817
tristate "ST-Ericsson DB800 watchdog"
809818
depends on MFD_DB8500_PRCMU
@@ -1001,7 +1010,7 @@ config STM32_WATCHDOG
10011010
tristate "STM32 Independent WatchDoG (IWDG) support"
10021011
depends on ARCH_STM32 || COMPILE_TEST
10031012
select WATCHDOG_CORE
1004-
default y
1013+
default ARCH_STM32
10051014
help
10061015
Say Y here to include support for the watchdog timer
10071016
in stm32 SoCs.
@@ -1363,6 +1372,17 @@ config INTEL_MID_WATCHDOG
13631372

13641373
To compile this driver as a module, choose M here.
13651374

1375+
config INTEL_OC_WATCHDOG
1376+
tristate "Intel OC Watchdog"
1377+
depends on (X86 || COMPILE_TEST) && ACPI && HAS_IOPORT
1378+
select WATCHDOG_CORE
1379+
help
1380+
Hardware driver for Intel Over-Clocking watchdog present in
1381+
Platform Controller Hub (PCH) chipsets.
1382+
1383+
To compile this driver as a module, choose M here: the
1384+
module will be called intel_oc_wdt.
1385+
13661386
config ITCO_WDT
13671387
tristate "Intel TCO Timer/Watchdog"
13681388
depends on X86 && PCI
@@ -1869,7 +1889,7 @@ config OCTEON_WDT
18691889
config MARVELL_GTI_WDT
18701890
tristate "Marvell GTI Watchdog driver"
18711891
depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT)
1872-
default y
1892+
default ARCH_THUNDER
18731893
select WATCHDOG_CORE
18741894
help
18751895
Marvell GTI hardware supports watchdog timer. First timeout
@@ -2035,7 +2055,7 @@ config 8xxx_WDT
20352055
config PIKA_WDT
20362056
tristate "PIKA FPGA Watchdog"
20372057
depends on WARP || (PPC64 && COMPILE_TEST)
2038-
default y
2058+
default WARP
20392059
help
20402060
This enables the watchdog in the PIKA FPGA. Currently used on
20412061
the Warp platform.

drivers/watchdog/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
6969
obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
7070
obj-$(CONFIG_IMX_SC_WDT) += imx_sc_wdt.o
7171
obj-$(CONFIG_IMX7ULP_WDT) += imx7ulp_wdt.o
72+
obj-$(CONFIG_S32G_WDT) += s32g_wdt.o
7273
obj-$(CONFIG_DB500_WATCHDOG) += db8500_wdt.o
7374
obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
7475
obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
@@ -150,6 +151,7 @@ obj-$(CONFIG_W83977F_WDT) += w83977f_wdt.o
150151
obj-$(CONFIG_MACHZ_WDT) += machzwd.o
151152
obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
152153
obj-$(CONFIG_INTEL_MID_WATCHDOG) += intel-mid_wdt.o
154+
obj-$(CONFIG_INTEL_OC_WATCHDOG) += intel_oc_wdt.o
153155
obj-$(CONFIG_INTEL_MEI_WDT) += mei_wdt.o
154156
obj-$(CONFIG_NI903X_WDT) += ni903x_wdt.o
155157
obj-$(CONFIG_NIC7018_WDT) += nic7018_wdt.o

drivers/watchdog/apple_wdt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ static int apple_wdt_ping(struct watchdog_device *wdd)
9595
static int apple_wdt_set_timeout(struct watchdog_device *wdd, unsigned int s)
9696
{
9797
struct apple_wdt *wdt = to_apple_wdt(wdd);
98+
u32 actual;
9899

99100
writel_relaxed(0, wdt->regs + APPLE_WDT_WD1_CUR_TIME);
100-
writel_relaxed(wdt->clk_rate * s, wdt->regs + APPLE_WDT_WD1_BITE_TIME);
101+
102+
actual = min(s, wdd->max_hw_heartbeat_ms / 1000);
103+
writel_relaxed(wdt->clk_rate * actual, wdt->regs + APPLE_WDT_WD1_BITE_TIME);
101104

102105
wdd->timeout = s;
103106

@@ -177,7 +180,7 @@ static int apple_wdt_probe(struct platform_device *pdev)
177180

178181
wdt->wdd.ops = &apple_wdt_ops;
179182
wdt->wdd.info = &apple_wdt_info;
180-
wdt->wdd.max_timeout = U32_MAX / wdt->clk_rate;
183+
wdt->wdd.max_hw_heartbeat_ms = U32_MAX / wdt->clk_rate * 1000;
181184
wdt->wdd.timeout = APPLE_WDT_TIMEOUT_DEFAULT;
182185

183186
wdt_ctrl = readl_relaxed(wdt->regs + APPLE_WDT_WD1_CTRL);

drivers/watchdog/arm_smc_wdt.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ static int smcwd_call(struct watchdog_device *wdd, enum smcwd_call call,
4646
return -ENODEV;
4747
if (res->a0 == PSCI_RET_INVALID_PARAMS)
4848
return -EINVAL;
49+
if (res->a0 == PSCI_RET_DISABLED)
50+
return -ENODATA;
4951
if (res->a0 != PSCI_RET_SUCCESS)
5052
return -EIO;
5153
return 0;
@@ -131,10 +133,19 @@ static int smcwd_probe(struct platform_device *pdev)
131133

132134
wdd->info = &smcwd_info;
133135
/* get_timeleft is optional */
134-
if (smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, NULL))
135-
wdd->ops = &smcwd_ops;
136-
else
136+
err = smcwd_call(wdd, SMCWD_GET_TIMELEFT, 0, NULL);
137+
switch (err) {
138+
case 0:
139+
set_bit(WDOG_HW_RUNNING, &wdd->status);
140+
fallthrough;
141+
case -ENODATA:
137142
wdd->ops = &smcwd_timeleft_ops;
143+
break;
144+
default:
145+
wdd->ops = &smcwd_ops;
146+
break;
147+
}
148+
138149
wdd->timeout = res.a2;
139150
wdd->max_timeout = res.a2;
140151
wdd->min_timeout = res.a1;

drivers/watchdog/cros_ec_wdt.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,22 @@ static int cros_ec_wdt_send_cmd(struct cros_ec_device *cros_ec,
2525
union cros_ec_wdt_data *arg)
2626
{
2727
int ret;
28-
struct {
29-
struct cros_ec_command msg;
30-
union cros_ec_wdt_data data;
31-
} __packed buf = {
32-
.msg = {
33-
.version = 0,
34-
.command = EC_CMD_HANG_DETECT,
35-
.insize = (arg->req.command == EC_HANG_DETECT_CMD_GET_STATUS) ?
36-
sizeof(struct ec_response_hang_detect) :
37-
0,
38-
.outsize = sizeof(struct ec_params_hang_detect),
39-
},
40-
.data.req = arg->req
41-
};
42-
43-
ret = cros_ec_cmd_xfer_status(cros_ec, &buf.msg);
28+
DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
29+
sizeof(union cros_ec_wdt_data));
30+
31+
msg->version = 0;
32+
msg->command = EC_CMD_HANG_DETECT;
33+
msg->insize = (arg->req.command == EC_HANG_DETECT_CMD_GET_STATUS) ?
34+
sizeof(struct ec_response_hang_detect) :
35+
0;
36+
msg->outsize = sizeof(struct ec_params_hang_detect);
37+
*(struct ec_params_hang_detect *)msg->data = arg->req;
38+
39+
ret = cros_ec_cmd_xfer_status(cros_ec, msg);
4440
if (ret < 0)
4541
return ret;
4642

47-
arg->resp = buf.data.resp;
43+
arg->resp = *(struct ec_response_hang_detect *)msg->data;
4844

4945
return 0;
5046
}

0 commit comments

Comments
 (0)