watchdog: imx_sc_wdt: continue if the wdog already enabled
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Reviewed-by Peng Fan <[email protected]>
--- drivers/watchdog/imx_sc_wdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/watchdog/imx_sc_wdt.c +4 -1
@@ -34,6 +34,7 @@#define SC_IRQ_WDOG 1#define SC_IRQ_GROUP_WDOG 1 +#define SC_TIMER_ERR_BUSY 10static 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,
Signature · 1 line
2.34.1
Quoted 6 lines · Jacky Bai
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 <[email protected]>Reviewed-by Peng Fan <[email protected]>
Reviewed-by Guenter Roeck <[email protected]>
Quoted 30 lines
--- drivers/watchdog/imx_sc_wdt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/watchdog/imx_sc_wdt.c +4
-1@@ -34,6 +34,7 @@#define SC_IRQ_WDOG 1#define SC_IRQ_GROUP_WDOG 1 +#define SC_TIMER_ERR_BUSY 10static 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,Signature · 1 line
2.34.1