[{"id":1709131,"web_url":"http://patchwork.ozlabs.org/comment/1709131/","msgid":"<5f5af496-ba37-6a24-7aeb-0c3947820fa7@linux.vnet.ibm.com>","date":"2017-07-05T04:11:12","subject":"Re: [PATCH v2 1/3] powerpc: do not call ppc_md.panic in fadump panic\n\tnotifier","submitter":{"id":1436,"url":"http://patchwork.ozlabs.org/api/people/1436/","name":"Mahesh J Salgaonkar","email":"mahesh@linux.vnet.ibm.com"},"content":"On 07/05/2017 09:26 AM, Nicholas Piggin wrote:\n> If fadump is not registered, and no other crash or debug handlers are\n> registered, the powerpc panic handler stops the guest before the generic\n> panic code can push out debug information to the console.\n> \n> Currently, system reset injection causes the guest to silently\n> stop.\n> \n> Stop calling ppc_md.panic in the panic notifier. crash_fadump already\n> does rtas_os_term() to terminate the guest if fadump is registered.\n> \n> Remove ppc_md.panic. Move fadump panic notifier into fadump code.\n> \n> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>\n\nReviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>\n\nThanks,\n-Mahesh.\n\n> ---\n>  arch/powerpc/include/asm/machdep.h     |  1 -\n>  arch/powerpc/include/asm/setup.h       |  1 -\n>  arch/powerpc/kernel/fadump.c           | 22 ++++++++++++++++++++++\n>  arch/powerpc/kernel/setup-common.c     | 27 ---------------------------\n>  arch/powerpc/platforms/ps3/setup.c     | 15 ---------------\n>  arch/powerpc/platforms/pseries/setup.c |  1 -\n>  6 files changed, 22 insertions(+), 45 deletions(-)\n> \n> diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h\n> index cd2fc1cc1cc7..73b92017b6d7 100644\n> --- a/arch/powerpc/include/asm/machdep.h\n> +++ b/arch/powerpc/include/asm/machdep.h\n> @@ -76,7 +76,6 @@ struct machdep_calls {\n> \n>  \tvoid __noreturn\t(*restart)(char *cmd);\n>  \tvoid __noreturn (*halt)(void);\n> -\tvoid\t\t(*panic)(char *str);\n>  \tvoid\t\t(*cpu_die)(void);\n> \n>  \tlong\t\t(*time_init)(void); /* Optional, may be NULL */\n> diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h\n> index 654d64c9f3ac..3a3fb0ca68f5 100644\n> --- a/arch/powerpc/include/asm/setup.h\n> +++ b/arch/powerpc/include/asm/setup.h\n> @@ -23,7 +23,6 @@ extern void reloc_got2(unsigned long);\n> \n>  void check_for_initrd(void);\n>  void initmem_init(void);\n> -void setup_panic(void);\n>  #define ARCH_PANIC_TIMEOUT 180\n> \n>  #ifdef CONFIG_PPC_PSERIES\n> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c\n> index 3079518f2245..8f1a8bd8433c 100644\n> --- a/arch/powerpc/kernel/fadump.c\n> +++ b/arch/powerpc/kernel/fadump.c\n> @@ -1447,6 +1447,25 @@ static void fadump_init_files(void)\n>  \treturn;\n>  }\n> \n> +static int fadump_panic_event(struct notifier_block *this,\n> +                             unsigned long event, void *ptr)\n> +{\n> +\t/*\n> +\t * If firmware-assisted dump has been registered then trigger\n> +\t * firmware-assisted dump and let firmware handle everything\n> +\t * else. If this returns, then fadump was not registered, so\n> +\t * go through the rest of the panic path.\n> +\t */\n> +\tcrash_fadump(NULL, ptr);\n> +\n> +\treturn NOTIFY_DONE;\n> +}\n> +\n> +static struct notifier_block fadump_panic_block = {\n> +\t.notifier_call = fadump_panic_event,\n> +\t.priority = INT_MIN /* may not return; must be done last */\n> +};\n> +\n>  /*\n>   * Prepare for firmware-assisted dump.\n>   */\n> @@ -1479,6 +1498,9 @@ int __init setup_fadump(void)\n>  \t\tinit_fadump_mem_struct(&fdm, fw_dump.reserve_dump_area_start);\n>  \tfadump_init_files();\n> \n> +\tatomic_notifier_chain_register(&panic_notifier_list,\n> +\t\t\t\t\t&fadump_panic_block);\n> +\n>  \treturn 1;\n>  }\n>  subsys_initcall(setup_fadump);\n> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c\n> index 94a948207cd2..b697530d9bdc 100644\n> --- a/arch/powerpc/kernel/setup-common.c\n> +++ b/arch/powerpc/kernel/setup-common.c\n> @@ -704,30 +704,6 @@ int check_legacy_ioport(unsigned long base_port)\n>  }\n>  EXPORT_SYMBOL(check_legacy_ioport);\n> \n> -static int ppc_panic_event(struct notifier_block *this,\n> -                             unsigned long event, void *ptr)\n> -{\n> -\t/*\n> -\t * If firmware-assisted dump has been registered then trigger\n> -\t * firmware-assisted dump and let firmware handle everything else.\n> -\t */\n> -\tcrash_fadump(NULL, ptr);\n> -\tppc_md.panic(ptr);  /* May not return */\n> -\treturn NOTIFY_DONE;\n> -}\n> -\n> -static struct notifier_block ppc_panic_block = {\n> -\t.notifier_call = ppc_panic_event,\n> -\t.priority = INT_MIN /* may not return; must be done last */\n> -};\n> -\n> -void __init setup_panic(void)\n> -{\n> -\tif (!ppc_md.panic)\n> -\t\treturn;\n> -\tatomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);\n> -}\n> -\n>  #ifdef CONFIG_CHECK_CACHE_COHERENCY\n>  /*\n>   * For platforms that have configurable cache-coherency.  This function\n> @@ -872,9 +848,6 @@ void __init setup_arch(char **cmdline_p)\n>  \t/* Probe the machine type, establish ppc_md. */\n>  \tprobe_machine();\n> \n> -\t/* Setup panic notifier if requested by the platform. */\n> -\tsetup_panic();\n> -\n>  \t/*\n>  \t * Configure ppc_md.power_save (ppc32 only, 64-bit machines do\n>  \t * it from their respective probe() function.\n> diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c\n> index 6244bc849469..9dabea6e1443 100644\n> --- a/arch/powerpc/platforms/ps3/setup.c\n> +++ b/arch/powerpc/platforms/ps3/setup.c\n> @@ -104,20 +104,6 @@ static void __noreturn ps3_halt(void)\n>  \tps3_sys_manager_halt(); /* never returns */\n>  }\n> \n> -static void ps3_panic(char *str)\n> -{\n> -\tDBG(\"%s:%d %s\\n\", __func__, __LINE__, str);\n> -\n> -\tsmp_send_stop();\n> -\tprintk(\"\\n\");\n> -\tprintk(\"   System does not reboot automatically.\\n\");\n> -\tprintk(\"   Please press POWER button.\\n\");\n> -\tprintk(\"\\n\");\n> -\n> -\twhile(1)\n> -\t\tlv1_pause(1);\n> -}\n> -\n>  #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \\\n>      defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)\n>  static void __init prealloc(struct ps3_prealloc *p)\n> @@ -269,7 +255,6 @@ define_machine(ps3) {\n>  \t.probe\t\t\t\t= ps3_probe,\n>  \t.setup_arch\t\t\t= ps3_setup_arch,\n>  \t.init_IRQ\t\t\t= ps3_init_IRQ,\n> -\t.panic\t\t\t\t= ps3_panic,\n>  \t.get_boot_time\t\t\t= ps3_get_boot_time,\n>  \t.set_dabr\t\t\t= ps3_set_dabr,\n>  \t.calibrate_decr\t\t\t= ps3_calibrate_decr,\n> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c\n> index b5d86426e97b..b5b650910cf5 100644\n> --- a/arch/powerpc/platforms/pseries/setup.c\n> +++ b/arch/powerpc/platforms/pseries/setup.c\n> @@ -722,7 +722,6 @@ define_machine(pseries) {\n>  \t.pcibios_fixup\t\t= pSeries_final_fixup,\n>  \t.restart\t\t= rtas_restart,\n>  \t.halt\t\t\t= rtas_halt,\n> -\t.panic\t\t\t= rtas_os_term,\n>  \t.get_boot_time\t\t= rtas_get_boot_time,\n>  \t.get_rtc_time\t\t= rtas_get_rtc_time,\n>  \t.set_rtc_time\t\t= rtas_set_rtc_time,\n>","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3x2SDf1yXsz9s06\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  5 Jul 2017 14:14:10 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3x2SDf14mlzDr5w\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed,  5 Jul 2017 14:14:10 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3x2S9S1W94zDr1p\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed,  5 Jul 2017 14:11:23 +1000 (AEST)","from pps.filterd (m0098413.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id\n\tv6549OQA073833\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 5 Jul 2017 00:11:21 -0400","from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2bg6gebu99-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 05 Jul 2017 00:11:21 -0400","from localhost\n\tby e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <mahesh@linux.vnet.ibm.com>; \n\tWed, 5 Jul 2017 14:11:18 +1000","from d23relay10.au.ibm.com (202.81.31.229)\n\tby e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 5 Jul 2017 14:11:16 +1000","from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv654BFFO8913198\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 5 Jul 2017 14:11:15 +1000","from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv654BDpH024722\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 5 Jul 2017 14:11:13 +1000","from [9.124.211.5] ([9.124.211.5])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv654BACh024675; Wed, 5 Jul 2017 14:11:11 +1000"],"Subject":"Re: [PATCH v2 1/3] powerpc: do not call ppc_md.panic in fadump panic\n\tnotifier","To":"Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org","References":"<20170705035627.19563-1-npiggin@gmail.com>\n\t<20170705035627.19563-2-npiggin@gmail.com>","From":"Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>","Date":"Wed, 5 Jul 2017 09:41:12 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0","MIME-Version":"1.0","In-Reply-To":"<20170705035627.19563-2-npiggin@gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-MW","Content-Transfer-Encoding":"7bit","X-TM-AS-MML":"disable","x-cbid":"17070504-0016-0000-0000-0000025990F5","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17070504-0017-0000-0000-000006D9B6A5","Message-Id":"<5f5af496-ba37-6a24-7aeb-0c3947820fa7@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-07-05_03:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000\n\tdefinitions=main-1707050068","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1760889,"web_url":"http://patchwork.ozlabs.org/comment/1760889/","msgid":"<3xjgLH1hs0z9t2y@ozlabs.org>","date":"2017-08-31T11:36:06","subject":"Re: [v2,\n\t1/3] powerpc: do not call ppc_md.panic in fadump panic notifier","submitter":{"id":69509,"url":"http://patchwork.ozlabs.org/api/people/69509/","name":"Michael Ellerman","email":"patch-notifications@ellerman.id.au"},"content":"On Wed, 2017-07-05 at 03:56:25 UTC, Nicholas Piggin wrote:\n> If fadump is not registered, and no other crash or debug handlers are\n> registered, the powerpc panic handler stops the guest before the generic\n> panic code can push out debug information to the console.\n> \n> Currently, system reset injection causes the guest to silently\n> stop.\n> \n> Stop calling ppc_md.panic in the panic notifier. crash_fadump already\n> does rtas_os_term() to terminate the guest if fadump is registered.\n> \n> Remove ppc_md.panic. Move fadump panic notifier into fadump code.\n> \n> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>\n> Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>\n\nSeries applied to powerpc next, thanks.\n\nhttps://git.kernel.org/powerpc/c/a3b2cb30f252b21a6f962e0dd107c8\n\ncheers","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjgtK0gcCz9s7F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 22:00:25 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjgtJ6X89zDqXn\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 22:00:24 +1000 (AEST)","from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjgLH3l3dzDqRM\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 31 Aug 2017 21:36:07 +1000 (AEST)","by ozlabs.org (Postfix, from userid 1034)\n\tid 3xjgLH1hs0z9t2y; Thu, 31 Aug 2017 21:36:06 +1000 (AEST)"],"X-powerpc-patch-notification":"thanks","X-powerpc-patch-commit":"a3b2cb30f252b21a6f962e0dd107c8b897ca65e4","In-Reply-To":"<20170705035627.19563-2-npiggin@gmail.com>","To":"Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org","From":"Michael Ellerman <patch-notifications@ellerman.id.au>","Subject":"Re: [v2,\n\t1/3] powerpc: do not call ppc_md.panic in fadump panic notifier","Message-Id":"<3xjgLH1hs0z9t2y@ozlabs.org>","Date":"Thu, 31 Aug 2017 21:36:06 +1000 (AEST)","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>,\n\tNicholas Piggin <npiggin@gmail.com>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]