[PATCH 9/9] powerpc/ps3: Add udbg_panic

Geoff Levand geoff at infradead.org
Sat Mar 28 07:26:23 AEDT 2020


BUG_ON() won't work in the early init code, so replace it with
a new routine udbg_panic() that uses udbg_printf() and lv1_panic().

Signed-off-by: Geoff Levand <geoff at infradead.org>
---
 arch/powerpc/platforms/ps3/mm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 423be34f0f5f..7c7c2f53eacb 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -26,6 +26,13 @@
 #define DBG pr_devel
 #endif
 
+#define udbg_panic(_val, _msg) \
+if (_val) { \
+	udbg_printf("%s:%d: " _msg ": %d\n", \
+		__func__, __LINE__, (int)(_val)); \
+	lv1_panic(0); \
+}
+
 enum {
 #if defined(CONFIG_PS3_DYNAMIC_DMA)
 	USE_DYNAMIC_DMA = 1,
@@ -313,7 +320,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 
 	if (r->base) {
 		result = lv1_release_memory(r->base);
-		BUG_ON(result);
+		udbg_panic(result, "lv1_release_memory failed");
 		r->size = r->base = r->offset = 0;
 		map.total = map.rm.size;
 	}
-- 
2.20.1



More information about the Linuxppc-dev mailing list