Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758252AbbEELNs (ORCPT ); Tue, 5 May 2015 07:13:48 -0400 Received: from ozlabs.org ([103.22.144.67]:50712 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752181AbbEELMv (ORCPT ); Tue, 5 May 2015 07:12:51 -0400 From: Michael Ellerman To: Cc: , Anton Blanchard , tj@kernel.org, Andrew Morton Subject: [PATCH 3/6] powerpc: Add device-tree model to dump stack arch description Date: Tue, 5 May 2015 21:12:14 +1000 Message-Id: <1430824337-15339-3-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430824337-15339-1-git-send-email-mpe@ellerman.id.au> References: <1430824337-15339-1-git-send-email-mpe@ellerman.id.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1702 Lines: 61 As soon as we know the model of the machine we're on, add it to the dump stack arch description, which is printed in case of an oops. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 308c5e15676b..a8ac55f7bd7b 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -642,6 +643,23 @@ static void __init early_reserve_mem(void) #endif } +static int __init +early_init_dt_scan_model(unsigned long node, const char *uname, + int depth, void *data) +{ + const char *prop; + + if (depth != 0) + return 0; + + prop = of_get_flat_dt_prop(node, "model", NULL); + if (prop) + dump_stack_add_arch_desc(prop); + + /* break now */ + return 1; +} + void __init early_init_devtree(void *params) { phys_addr_t limit; @@ -652,6 +670,8 @@ void __init early_init_devtree(void *params) if (!early_init_dt_verify(params)) panic("BUG: Failed verifying flat device tree, bad version?"); + of_scan_flat_dt(early_init_dt_scan_model, NULL); + #ifdef CONFIG_PPC_RTAS /* Some machines might need RTAS info for debugging, grab it now. */ of_scan_flat_dt(early_init_dt_scan_rtas, NULL); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/