aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorJacky Bai <ping.bai@nxp.com>2023-10-10 15:46:26 +0800
committerWim Van Sebroeck <wim@linux-watchdog.org>2023-10-29 19:45:07 +0100
commit06fdbf4ddb21b53c2e2fbf7f00df51c1b4e735c4 (patch)
tree1e36badbe5787c69c67c1269175abb91b60ad901 /drivers/watchdog
parentwatchdog: st_lpc: Use device_get_match_data() (diff)
downloadwireguard-linux-06fdbf4ddb21b53c2e2fbf7f00df51c1b4e735c4.tar.xz
wireguard-linux-06fdbf4ddb21b53c2e2fbf7f00df51c1b4e735c4.zip
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>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/imx_sc_wdt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
index 8ac021748d16..e51fe1b78518 100644
--- a/drivers/watchdog/imx_sc_wdt.c
+++ b/drivers/watchdog/imx_sc_wdt.c
@@ -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,