From b90cef338f1e11e97ef4d180f2b4167af6d7da09 Mon Sep 17 00:00:00 2001 From: Jacky Bai Date: Mon, 18 Jan 2021 15:25:03 +0800 Subject: [PATCH] LF-3211 watchdog: imx7ulp: Add explict memory barrier for unlock sequence Add explict memory barrier for the wdog unlock sequence. Suggested-by: Ye Li Signed-off-by: Jacky Bai Reviewed-by: Ye Li (cherry picked from commit 59ec9bb1baaad40175aac6da16e1b000e5d5ee70) Signed-off-by: Andrey Zhizhikin --- drivers/watchdog/imx7ulp_wdt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c index 014f497ea0dc..b8ac0cb04d2f 100644 --- a/drivers/watchdog/imx7ulp_wdt.c +++ b/drivers/watchdog/imx7ulp_wdt.c @@ -179,9 +179,13 @@ static int imx7ulp_wdt_init(void __iomem *base, unsigned int timeout) int ret; local_irq_disable(); + + mb(); /* unlock the wdog for reconfiguration */ writel_relaxed(UNLOCK_SEQ0, base + WDOG_CNT); writel_relaxed(UNLOCK_SEQ1, base + WDOG_CNT); + mb(); + ret = imx7ulp_wdt_wait(base, WDOG_CS_ULK); if (ret) goto init_out;