Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp308346imj; Thu, 7 Feb 2019 04:47:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IYHxPhsGMIF9OX58vn/j38Bp2+oR/VdKYqXHiA2Kvgs8NbVDyyZTIe3egH7uSYKUGYVRRqL X-Received: by 2002:a17:902:e090:: with SMTP id cb16mr2477763plb.32.1549543647884; Thu, 07 Feb 2019 04:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549543647; cv=none; d=google.com; s=arc-20160816; b=KK34YaQZHQDHsSTLtZ6JRHXeF/HQflTDKjnwHOE8OIcT/WacOhBkKLbCXAMCpnfYfg Rr7YIOsAT3pF6dGQU7yLoIn4Ez1apW7GYwJnZlQhpt9h/M2uQGkCKDsxz3Frtjd5iZgX UKM9oPXcnnpSiErA5ssmuSR0y+WEzI78dchW0MV4dK81ym/zMC872hbGv5Ql+JKHkTAN a/y+DWgRr7oxqCdRnqrnhud2bzqhdhwD/m74MbPUwHYF9Y9nG6ZqzF6L8vaBhfgL1l2O k2zY6pn/Zc5hvjoUih+n70y32ujmJa2kT+4axYcZMiSClMnXsj8bsmq6B7sUKZcxSzFl qO8w== 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=8cdCLoXbXXYi0X8xTxZk9nIudfN7FgUrJOqa/asaCsI=; b=Vq5SDycWbttb2LGUnBQ4sjkZV9JZBGK607DlgFmpXKNMO5bTPwvKPcHI/puIERKlmP FgDB/X3qzOGFv2Oxi1GscDeUuZjFa7BdBBg0onaFLw0sNu/4JmAfGbi0uDoxU4o+uTZb JH+XwQs21wo10q2eaZLfpE0sNvFKT8G9sYMdqgdkkBQwPF0GdfmoIXGHLKrDWbIgs7JL 58n99Zi0+yQxwe0trEnDFPCTTX4h/a5wVeICEnV4Hqe+QS/ExY05O4efvJnZJs9bzM2S gjvs687dE/yOnm1YhzeOPC8L7lOhbn1vKxoQcAB4vmi1U/UTDZGZRHyO6fAT8F27H/s9 QfwA== 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 n5si128400pgc.563.2019.02.07.04.47.12; Thu, 07 Feb 2019 04:47:27 -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 S1727445AbfBGMrA (ORCPT + 99 others); Thu, 7 Feb 2019 07:47:00 -0500 Received: from ozlabs.org ([203.11.71.1]:56077 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727430AbfBGMq6 (ORCPT ); Thu, 7 Feb 2019 07:46:58 -0500 Received: by ozlabs.org (Postfix, from userid 1034) id 43wJ3g4cNBz9sNJ; Thu, 7 Feb 2019 23:46:55 +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 6/7] powerpc/powernv: Add opal details to dump stack arch description Date: Thu, 7 Feb 2019 23:46:34 +1100 Message-Id: <20190207124635.3885-6-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 Once we have unflattened the device tree we can easily grab these opal version details and add them to dump stack arch description, which is printed in case of an oops. eg: Hardware name: ... opal:v6.2 Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/powernv/setup.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 14befee4b3f1..1bfb422436fb 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -156,8 +156,33 @@ static void __init pnv_setup_arch(void) /* XXX PMCS */ } +static void __init pnv_add_dump_stack_arch_desc(void) +{ + struct device_node *dn; + const char *version; + + dn = of_find_node_by_path("/ibm,opal/firmware"); + if (!dn) + return; + + version = of_get_property(dn, "version", NULL); + if (!version) + version = of_get_property(dn, "git-id", NULL); + + if (version) + dump_stack_add_arch_desc("opal:%s", version); + + version = of_get_property(dn, "mi-version", NULL); + if (version) + dump_stack_add_arch_desc("mi:%s", version); + + of_node_put(dn); +} + static void __init pnv_init(void) { + pnv_add_dump_stack_arch_desc(); + /* * Initialize the LPC bus now so that legacy serial * ports can be found on it -- 2.20.1