From patchwork Tue May 5 11:12:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 468071 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9BDF21409BB for ; Tue, 5 May 2015 21:16:14 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 8243F1A11C0 for ; Tue, 5 May 2015 21:16:14 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 26A981A066A for ; Tue, 5 May 2015 21:12:50 +1000 (AEST) Received: by ozlabs.org (Postfix) id 079871409B7; Tue, 5 May 2015 21:12:50 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id CCAC7140A99; Tue, 5 May 2015 21:12:49 +1000 (AEST) From: Michael Ellerman To: 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> Cc: tj@kernel.org, Andrew Morton , linux-kernel@vger.kernel.org, Anton Blanchard X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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);