From: Baolin Wang <baolin.wang@linaro.org>
To: broonie@kernel.org
Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com,
baolin.wang@linaro.org, baolin.wang7@gmail.com,
ling_ling.xu@unisoc.com, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] spi: sprd: adi: Add missing lock protection when rebooting
Date: Mon, 28 Oct 2019 18:10:30 +0800 [thread overview]
Message-ID: <7b04711127434555e3a1a86bc6be99860cd86668.1572257085.git.baolin.wang@linaro.org> (raw)
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
next reply other threads:[~2019-10-28 10:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 10:10 Baolin Wang [this message]
2019-10-28 10:10 ` [PATCH 2/2] spi: sprd: adi: Set BIT_WDG_NEW bit when rebooting 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7b04711127434555e3a1a86bc6be99860cd86668.1572257085.git.baolin.wang@linaro.org \
--to=baolin.wang@linaro.org \
--cc=baolin.wang7@gmail.com \
--cc=broonie@kernel.org \
--cc=ling_ling.xu@unisoc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).