OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [1/1] lib: sbi: Add debug print when sbi_pmu_init fails
@ 2023-04-14  5:13 Tan En De
  2023-04-19  5:57 ` Atish Patra
  0 siblings, 1 reply; 2+ messages in thread
From: Tan En De @ 2023-04-14  5:13 UTC (permalink / raw)
  To: opensbi

Since sbi_pmu_init is called after sbi_console_init,
the sbi_printf can be called when sbi_pmu_init fails.

Signed-off-by: Tan En De <ende.tan@starfivetech.com>
---
 lib/sbi/sbi_init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index a031336..5db8e7f 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -290,8 +290,11 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 		sbi_hart_hang();
 
 	rc = sbi_pmu_init(scratch, true);
-	if (rc)
+	if (rc) {
+		sbi_printf("%s: pmu init failed (error %d)\n",
+			   __func__, rc);
 		sbi_hart_hang();
+	}
 
 	sbi_boot_print_banner(scratch);
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-19  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-14  5:13 [1/1] lib: sbi: Add debug print when sbi_pmu_init fails Tan En De
2023-04-19  5:57 ` Atish Patra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox