Skip to content

Commit 06fdbf4

Browse files
JackyBaiWim Van Sebroeck
authored andcommitted
watchdog: imx_sc_wdt: continue if the wdog already enabled
if the wdog is already enabled, and try to enabled it again, we should ignore the error and continue, rather than return error. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20231010074626.2787383-1-ping.bai@nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent c7e2f4e commit 06fdbf4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/watchdog/imx_sc_wdt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
#define SC_IRQ_WDOG 1
3636
#define SC_IRQ_GROUP_WDOG 1
37+
#define SC_TIMER_ERR_BUSY 10
3738

3839
static bool nowayout = WATCHDOG_NOWAYOUT;
3940
module_param(nowayout, bool, 0000);
@@ -61,7 +62,9 @@ static int imx_sc_wdt_start(struct watchdog_device *wdog)
6162

6263
arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_START_WDOG,
6364
0, 0, 0, 0, 0, 0, &res);
64-
if (res.a0)
65+
66+
/* Ignore if already enabled(SC_TIMER_ERR_BUSY) */
67+
if (res.a0 && res.a0 != SC_TIMER_ERR_BUSY)
6568
return -EACCES;
6669

6770
arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_SET_WDOG_ACT,

0 commit comments

Comments
 (0)