linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: sprd: adi: Add missing lock protection when rebooting
@ 2019-10-28 10:10 Baolin Wang
  2019-10-28 10:10 ` [PATCH 2/2] spi: sprd: adi: Set BIT_WDG_NEW bit " Baolin Wang
  2019-10-28 14:56 ` Applied "spi: sprd: adi: Add missing lock protection " Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Baolin Wang @ 2019-10-28 10:10 UTC (permalink / raw)
  To: broonie
  Cc: orsonzhai, zhang.lyra, baolin.wang, baolin.wang7, ling_ling.xu,
	linux-spi, linux-kernel

From: Lingling Xu <ling_ling.xu@unisoc.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@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-28 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 10:10 [PATCH 1/2] spi: sprd: adi: Add missing lock protection when rebooting Baolin Wang
2019-10-28 10:10 ` [PATCH 2/2] spi: sprd: adi: Set BIT_WDG_NEW bit " Baolin Wang
2019-10-28 14:56   ` Applied "spi: sprd: adi: Set BIT_WDG_NEW bit when rebooting" to the spi tree Mark Brown
2019-10-28 14:56 ` Applied "spi: sprd: adi: Add missing lock protection " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).