diff mbox series

[1/2] arm64: add grace period when rebooting

Message ID 20201219143648.56217-2-wsa+renesas@sang-engineering.com (mailing list archive)
State Under Review
Delegated to: Geert Uytterhoeven
Headers show
Series arm64: small updates to rebooting | expand

Commit Message

Wolfram Sang Dec. 19, 2020, 2:36 p.m. UTC
I work on a system where I currently need to reboot via watchdog.
Because the watchdog needs a bit of time to fire, add a grace period
like on arm32 to avoid the false positive warning message.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm64/kernel/process.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Will Deacon Jan. 12, 2021, 1:55 p.m. UTC | #1
On Sat, Dec 19, 2020 at 03:36:46PM +0100, Wolfram Sang wrote:
> I work on a system where I currently need to reboot via watchdog.
> Because the watchdog needs a bit of time to fire, add a grace period
> like on arm32 to avoid the false positive warning message.

Please can you elaborate a bit on the control flow here, specifically
from the part which arms the watchdog to how we end up in at the mdelay()?

Ideally, the mdelay() would live in some code that knows about the watchdog,
and therefore can choose the appropriate delay.

Thanks,

Will
Wolfram Sang Jan. 12, 2021, 2:28 p.m. UTC | #2
Hi Will,

> Ideally, the mdelay() would live in some code that knows about the watchdog,
> and therefore can choose the appropriate delay.

Agreed. I'll put the delay into the watchdog driver.

Thanks,

   Wolfram
diff mbox series

Patch

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 6616486a58fe..3c770329364f 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -204,6 +204,9 @@  void machine_restart(char *cmd)
 	else
 		do_kernel_restart(cmd);
 
+	/* Give a grace period for failure to restart of 1s */
+	mdelay(1000);
+
 	/*
 	 * Whoops - the architecture was unable to reboot.
 	 */