diff options
author | Lingling Xu <ling_ling.xu@unisoc.com> | 2019-10-28 11:10:30 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-28 14:16:51 +0100 |
commit | 91ea1d70607e374b014b4b9bea771ce661f9f64b (patch) | |
tree | 51c1e081e148dc6b4cdf20b1558b6ca9b6cf68eb /drivers/spi/spi-sprd-adi.c | |
parent | spi: pxa2xx: Introduce temporary variables to increase readability (diff) | |
download | linux-91ea1d70607e374b014b4b9bea771ce661f9f64b.tar.xz linux-91ea1d70607e374b014b4b9bea771ce661f9f64b.zip |
spi: sprd: adi: Add missing lock protection when rebooting
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>
Link: https://lore.kernel.org/r/7b04711127434555e3a1a86bc6be99860cd86668.1572257085.git.baolin.wang@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-sprd-adi.c')
-rw-r--r-- | drivers/spi/spi-sprd-adi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 9a051286f120..9613cfe3c0a2 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"); |