From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2C1AC4360C for ; Sun, 6 Oct 2019 17:38:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABACF20862 for ; Sun, 6 Oct 2019 17:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383530; bh=7DJSolCrQCCDsfBhpfU09oTsWICrh81yjcangCFS3fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dXjfIVdzDz77JO74U1FcBu38i2l8gJlQ1lxZ4/MAvjS1us1MjPBxSjgLJMDlK7pIX BAe9BOjfQdV7QeXOSBFQ6ZsM8OG52MNGf2Yh1g+tYnDjIJGXZ6bmlJiaCDurc2tZaJ 14WjfG0wyuLn3VN3oEmGkk9O33psG1vwU7XyiFzs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730655AbfJFRit (ORCPT ); Sun, 6 Oct 2019 13:38:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:38138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730664AbfJFRio (ORCPT ); Sun, 6 Oct 2019 13:38:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A01EF217D6; Sun, 6 Oct 2019 17:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383524; bh=7DJSolCrQCCDsfBhpfU09oTsWICrh81yjcangCFS3fg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z7Xf81rJLMz7i5TfoUgVx/5Hhn46rjih+KqEH2BBcvmaaQrK/AySVJin4fYVXglIq h8hsinKZBRYSLu8DVuXQxjpkIWXa8i62gDo49WncFU0bN5GWB3Er3yW3A4mphd3+9W Ey3HgJSrfKrOa/BjYtGijrYQg9hwmgdbyoY2Jwes= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Salgaonkar , Nicholas Piggin , Ganesh Goudar , Michael Ellerman , Sasha Levin Subject: [PATCH 5.2 083/137] powerpc: dump kernel log before carrying out fadump or kdump Date: Sun, 6 Oct 2019 19:21:07 +0200 Message-Id: <20191006171215.763091783@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ganesh Goudar [ Upstream commit e7ca44ed3ba77fc26cf32650bb71584896662474 ] Since commit 4388c9b3a6ee ("powerpc: Do not send system reset request through the oops path"), pstore dmesg file is not updated when dump is triggered from HMC. This commit modified system reset (sreset) handler to invoke fadump or kdump (if configured), without pushing dmesg to pstore. This leaves pstore to have old dmesg data which won't be much of a help if kdump fails to capture the dump. This patch fixes that by calling kmsg_dump() before heading to fadump ot kdump. Fixes: 4388c9b3a6ee ("powerpc: Do not send system reset request through the oops path") Reviewed-by: Mahesh Salgaonkar Reviewed-by: Nicholas Piggin Signed-off-by: Ganesh Goudar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190904075949.15607-1-ganeshgr@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/traps.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 47df30982de1b..c8ea3a253b815 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -472,6 +472,7 @@ void system_reset_exception(struct pt_regs *regs) if (debugger(regs)) goto out; + kmsg_dump(KMSG_DUMP_OOPS); /* * A system reset is a request to dump, so we always send * it through the crashdump code (if fadump or kdump are -- 2.20.1