Commit 06fdbf4d authored by Jacky Bai's avatar Jacky Bai Committed by Wim Van Sebroeck
Browse files

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: default avatarJacky Bai <ping.bai@nxp.com>
Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20231010074626.2787383-1-ping.bai@nxp.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent c7e2f4e6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@

#define SC_IRQ_WDOG			1
#define SC_IRQ_GROUP_WDOG		1
#define SC_TIMER_ERR_BUSY		10

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

	arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_START_WDOG,
		      0, 0, 0, 0, 0, 0, &res);
	if (res.a0)

	/* Ignore if already enabled(SC_TIMER_ERR_BUSY) */
	if (res.a0 && res.a0 != SC_TIMER_ERR_BUSY)
		return -EACCES;

	arm_smccc_smc(IMX_SIP_TIMER, IMX_SIP_TIMER_SET_WDOG_ACT,