Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp309986imj; Thu, 7 Feb 2019 04:49:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IbUhP4wLaPdZHbngPKHPngEEFnE6CYjwUd3bG2W5KJc7wmshD16TbRXGDYo1rX/1FE18UQ4 X-Received: by 2002:a63:fb15:: with SMTP id o21mr14562816pgh.211.1549543757139; Thu, 07 Feb 2019 04:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549543757; cv=none; d=google.com; s=arc-20160816; b=CaDyCkqVWClDfS1eFKBKgyTpjaLnF9TfN1C1Tq4WOUN0YVVmYxS443beb6Tly9dY/L UTNORjBr0WJhhJgnz4i9Qo5HbN3zW7do9e3TVdXZaL5JYVQ8O9HT0WQ2EYjORrtP3di8 V5kP7rHxVs7UR9YrE4QAJeFeDLBZf0GA4Dv+pv5XxJ7JHzpMcgdM2j4O0o9Ushvi1JfZ 3h0bRipOYM9Ikd+OiNQFcelBlLg04/4nZ6DTw2Rp8kAYRZrXzNv+ivDnvH+xU0VtSaS7 kMmyZfm2rKO6k2d8tPVrnoin5wCu9Z5zsz4iJUjf1B60miPtLmTfryw6m6g+0YoYU/kt FcwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VTmcuRTufQAYMD4xj82i3oY7sQSk/yCm445QA46KSPQ=; b=qYZi45fue2NuW0MBM1UR2yj4/Z6LJrh9oEsDJ9dfzqWRv28uoHNFc7+q+pdYpSjRAe 70CsyExixcWmclBXp2B/lifmzOfHoGzBptogVwjvdz50wlA7yQRzTlHz9acSHkfCpEPG O+n30OUEC7R1iHoW8HRE+n7MCBHP+M0h7fYuC6zYKFmhDiZfpNUu0u00klMzGVcpuZHB odB3eg1tDq6WvlTXR72k6hcByR+IereDO/zvO+uSlbkHZxGTkArw5yONGoRsPsco+HkK F+M5x3fqtz7AaLiHRN0cuVslnPQkcuzuk76wNhVUAplfUcpdKgk5FB5Pa+ipqVKz3sk7 57tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si8664464pga.87.2019.02.07.04.49.01; Thu, 07 Feb 2019 04:49:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbfBGMrK (ORCPT + 99 others); Thu, 7 Feb 2019 07:47:10 -0500 Received: from ozlabs.org ([203.11.71.1]:49295 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbfBGMqz (ORCPT ); Thu, 7 Feb 2019 07:46:55 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 43wJ3d3ww0z9sN6; Thu, 7 Feb 2019 23:46:53 +1100 (AEDT) From: Michael Ellerman To: linuxppc-dev@ozlabs.org Cc: akpm@linux-foundation.org, tj@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, dyoung@redhat.com, sergey.senozhatsky@gmail.com, pmladek@suse.com Subject: [PATCH v3 4/7] powerpc: Add device-tree model to dump stack arch description Date: Thu, 7 Feb 2019 23:46:32 +1100 Message-Id: <20190207124635.3885-4-mpe@ellerman.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190207124635.3885-1-mpe@ellerman.id.au> References: <20190207124635.3885-1-mpe@ellerman.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. eg: Hardware name: model:'IBM,8247-22L' 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 38a90097469a..70af26a1eedd 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -687,6 +688,23 @@ static void __init tm_init(void) static void tm_init(void) { } #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */ +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("model:'%s'", prop); + + /* break now */ + return 1; +} + void __init early_init_devtree(void *params) { phys_addr_t limit; @@ -697,6 +715,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.20.1