]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen/arm: Print message if reset did not work
authorBertrand Marquis <bertrand.marquis@arm.com>
Fri, 16 Oct 2020 13:58:47 +0000 (14:58 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 20 Oct 2020 20:20:31 +0000 (13:20 -0700)
If for some reason the hardware reset is not working, print a message to
the user every 5 seconds to warn him that the system did not reset
properly and Xen is still looping.

The message is printed infinitely so that someone connecting to a serial
console with no history would see the message coming after 5 seconds.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
[stefano: remove second '!']
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
xen/arch/arm/shutdown.c

index b32f07ec0ef3d349dfef53b5a9097433c8dbf96f..3dc6819d56deb76b8498dcf244bb3edc0b012ab5 100644 (file)
@@ -36,6 +36,7 @@ void machine_halt(void)
 void machine_restart(unsigned int delay_millisecs)
 {
     int timeout = 10;
+    unsigned long count = 0;
 
     watchdog_disable();
     console_start_sync();
@@ -59,6 +60,9 @@ void machine_restart(unsigned int delay_millisecs)
     {
         platform_reset();
         mdelay(100);
+        if ( (count % 50) == 0 )
+            printk(XENLOG_ERR "Xen: Platform reset did not work properly!\n");
+        count++;
     }
 }