[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <7b04711127434555e3a1a86bc6be99860cd86668.1572257085.git.baolin.wang@linaro.org>
Date: Mon, 28 Oct 2019 18:10:30 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: broonie@...nel.org
Cc: orsonzhai@...il.com, zhang.lyra@...il.com, baolin.wang@...aro.org,
baolin.wang7@...il.com, ling_ling.xu@...soc.com,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] spi: sprd: adi: Add missing lock protection when rebooting
From: Lingling Xu <ling_ling.xu@...soc.com>
When rebooting the system, we should lock the watchdog after
configuration to make sure the watchdog can reboot the system
successfully.
Signed-off-by: Lingling Xu <ling_ling.xu@...soc.com>
Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
drivers/spi/spi-sprd-adi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index 9a05128..9613cfe 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -393,6 +393,9 @@ static int sprd_adi_restart_handler(struct notifier_block *this,
val |= BIT_WDG_RUN | BIT_WDG_RST;
sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_CTRL, val);
+ /* Lock the watchdog */
+ sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOCK, ~WDG_UNLOCK_KEY);
+
mdelay(1000);
dev_emerg(sadi->dev, "Unable to restart system\n");
--
1.7.9.5
Powered by blists - more mailing lists