OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <ajones@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v2 2/3] lib: sbi: dump logs when crash
Date: Mon, 1 Jul 2024 08:26:20 +0200	[thread overview]
Message-ID: <20240701-d12ce66efe0628ce321e646c@orel> (raw)
In-Reply-To: <20240624141903.2305676-3-wxjstz@126.com>

On Mon, Jun 24, 2024 at 10:18:58PM GMT, Xiang W wrote:
> When opensbi crashes, try to initialize the console in order to
> output error messages.
> 
> Signed-off-by: Xiang W <wxjstz@126.com>
> ---
>  lib/sbi/sbi_hart.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
> index c366701..48ec97c 100644
> --- a/lib/sbi/sbi_hart.c
> +++ b/lib/sbi/sbi_hart.c
> @@ -1010,6 +1010,10 @@ int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot)
>  
>  void __attribute__((noreturn)) sbi_hart_hang(void)
>  {
> +	/* Try to initialize the console to output some error messages */
> +	if (sbi_console_get_device() == NULL)
> +		sbi_console_init(sbi_scratch_thishart_ptr());
> +
>  	while (1)
>  		wfi();
>  	__builtin_unreachable();
> -- 
> 2.43.0
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>


  parent reply	other threads:[~2024-07-01  6:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 14:18 [PATCH v2 0/3] print befor sbi_console_init Xiang W
2024-06-24 14:18 ` [PATCH v2 1/3] lib: sbi: print before sbi_console_init Xiang W
2024-07-01  6:25   ` Andrew Jones
2024-07-05  6:54   ` Anup Patel
2024-06-24 14:18 ` [PATCH v2 2/3] lib: sbi: dump logs when crash Xiang W
2024-06-26 13:44   ` Himanshu Chauhan
2024-07-01  6:26   ` Andrew Jones [this message]
2024-07-05  6:55   ` Anup Patel
2024-06-24 14:18 ` [PATCH v2 3/3] lib: sbi: Make the console print buffer size configurable Xiang W
2024-07-01  6:26   ` Andrew Jones

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=20240701-d12ce66efe0628ce321e646c@orel \
    --to=ajones@ventanamicro.com \
    --cc=opensbi@lists.infradead.org \
    /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