* [PATCH] xen/arm: Print message if reset did not work
@ 2020-10-16 13:58 Bertrand Marquis
2020-10-19 17:37 ` Stefano Stabellini
0 siblings, 1 reply; 3+ messages in thread
From: Bertrand Marquis @ 2020-10-16 13:58 UTC (permalink / raw)
To: xen-devel; +Cc: Stefano Stabellini, Julien Grall, Volodymyr Babchuk
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>
---
xen/arch/arm/shutdown.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
index b32f07ec0e..600088ec48 100644
--- a/xen/arch/arm/shutdown.c
+++ b/xen/arch/arm/shutdown.c
@@ -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++;
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/arm: Print message if reset did not work
2020-10-16 13:58 [PATCH] xen/arm: Print message if reset did not work Bertrand Marquis
@ 2020-10-19 17:37 ` Stefano Stabellini
2020-10-20 12:46 ` Bertrand Marquis
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2020-10-19 17:37 UTC (permalink / raw)
To: Bertrand Marquis
Cc: xen-devel, Stefano Stabellini, Julien Grall, Volodymyr Babchuk
On Fri, 16 Oct 2020, Bertrand Marquis wrote:
> 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>
> ---
> xen/arch/arm/shutdown.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
> index b32f07ec0e..600088ec48 100644
> --- a/xen/arch/arm/shutdown.c
> +++ b/xen/arch/arm/shutdown.c
> @@ -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++;
I'd think that one "!" is enough :-) but anyway
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/arm: Print message if reset did not work
2020-10-19 17:37 ` Stefano Stabellini
@ 2020-10-20 12:46 ` Bertrand Marquis
0 siblings, 0 replies; 3+ messages in thread
From: Bertrand Marquis @ 2020-10-20 12:46 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: open list:X86, Julien Grall, Volodymyr Babchuk
> On 19 Oct 2020, at 18:37, Stefano Stabellini <sstabellini@kernel.org> wrote:
>
> On Fri, 16 Oct 2020, Bertrand Marquis wrote:
>> 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>
>> ---
>> xen/arch/arm/shutdown.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/xen/arch/arm/shutdown.c b/xen/arch/arm/shutdown.c
>> index b32f07ec0e..600088ec48 100644
>> --- a/xen/arch/arm/shutdown.c
>> +++ b/xen/arch/arm/shutdown.c
>> @@ -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++;
>
> I'd think that one "!" is enough :-) but anyway
True :-)
Feel to limit the exclamation to one while committing.
>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Thanks
Bertrand
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-20 12:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 13:58 [PATCH] xen/arm: Print message if reset did not work Bertrand Marquis
2020-10-19 17:37 ` Stefano Stabellini
2020-10-20 12:46 ` Bertrand Marquis
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).