[{"id":1722823,"web_url":"http://patchwork.ozlabs.org/comment/1722823/","msgid":"<20170719171613.2fbf30f2@roar.ozlabs.ibm.com>","date":"2017-07-19T07:16:13","subject":"Re: [PATCH v2 1/3] powerpc/powernv: handle the platform error\n\treboot in ppc_md.restart","submitter":{"id":69518,"url":"http://patchwork.ozlabs.org/api/people/69518/","name":"Nicholas Piggin","email":"npiggin@gmail.com"},"content":"On Wed, 19 Jul 2017 16:59:10 +1000\nNicholas Piggin <npiggin@gmail.com> wrote:\n\n> Change this by providing a special crash function which does some of\n> the console flushing from the panic() path before calling firmware to\n> reboot.\n\nOops, I changed the changelog but not the patch subject. Should\nbe something like \"flush console before platform error reboot\".\n\nThanks,\nNick","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 3xC7fF6qBKz9sDB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 19 Jul 2017 17:17:57 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xC7fF5gfszDrV5\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 19 Jul 2017 17:17:57 +1000 (AEST)","from mail-pg0-x243.google.com (mail-pg0-x243.google.com\n\t[IPv6:2607:f8b0:400e:c05::243])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xC7cY4SX7zDrS2\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 19 Jul 2017 17:16:29 +1000 (AEST)","by mail-pg0-x243.google.com with SMTP id z1so5880752pgs.0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 19 Jul 2017 00:16:29 -0700 (PDT)","from roar.ozlabs.ibm.com ([122.99.82.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tr62sm11020883pfl.45.2017.07.19.00.16.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 19 Jul 2017 00:16:26 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"eSogPyKl\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"eSogPyKl\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"eSogPyKl\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:in-reply-to:references\n\t:organization:mime-version:content-transfer-encoding;\n\tbh=ww0RG+wyPxu9jQTLHqRedixloEdEsjnt7+Ny62qpTyk=;\n\tb=eSogPyKlGnbjhZBMtBz61447N8WEAlgs8rXpAnVO0O7NvLrMON/HF4OzE7Otq2cKQ8\n\tn1NFWYmrrpNjIg+SbQDNSgrzgYbJxHDdDpxC4jBwDhX5i+M4iuLUwRFYkH4jepSCubeD\n\tn6w0z4i7yx1E6QEJehyhkXmihtqM3JBmmfeh5Fqvzfcv79rTnAI7M9lp/JlTtqgQyxKn\n\tUChdBAdShOR/RMYvyWC+GmP/txlO/tFCMtzzqnQlxXI64tZVJ9Ce9o9XUxH2pTNDDqRo\n\taEJ/3FeA9To9M++dN4ebqqPwFbyDZNeRQLbmVzLws7XofjZsbg2S6NRGl4P/aIlCoU7E\n\tzs1w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:organization:mime-version:content-transfer-encoding;\n\tbh=ww0RG+wyPxu9jQTLHqRedixloEdEsjnt7+Ny62qpTyk=;\n\tb=YwTkIZTTcn0HVOz2jCUoX/tX7Ad+K4jjfAM6MmzhpiMKhKPixl7emOZ6nOHO0eLMDp\n\tn9cv5ORBZQEsjSeqjY0WVCvJws5xRuCTTjJDWBnSz4KGRMoj8UDyyIATLqNE0Ph1oQfh\n\tXU4VRSgVw3R8bTT1ozCPXok5I4LQr7ZVbG1inHMRZlqLaXeaW0l7DuOCnAg+8wskX1Fk\n\t2wjrXL9NbHVHYajKiiaBJXELU/DB/VY1f9xyFXenKVWUMooxTzicVocJD2UgDf6uJzPA\n\tCg++z5w3qruf4EO8UXL3MMQjICJWM82YISVnCezdZB6AnOjWZLb9eq3F5eK72ZdcdD1X\n\t2mfg==","X-Gm-Message-State":"AIVw112/qQ37I4WqHh0WCnFAUxAS3toziNP0p4z337uXdDxiHpGmfh2D\n\tUx+p6emADmBDbJLB","X-Received":"by 10.98.18.69 with SMTP id a66mr1585249pfj.33.1500448587391;\n\tWed, 19 Jul 2017 00:16:27 -0700 (PDT)","Date":"Wed, 19 Jul 2017 17:16:13 +1000","From":"Nicholas Piggin <npiggin@gmail.com>","To":"linuxppc-dev@lists.ozlabs.org","Subject":"Re: [PATCH v2 1/3] powerpc/powernv: handle the platform error\n\treboot in ppc_md.restart","Message-ID":"<20170719171613.2fbf30f2@roar.ozlabs.ibm.com>","In-Reply-To":"<20170719065912.19183-2-npiggin@gmail.com>","References":"<20170719065912.19183-1-npiggin@gmail.com>\n\t<20170719065912.19183-2-npiggin@gmail.com>","Organization":"IBM","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","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>","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":1724024,"web_url":"http://patchwork.ozlabs.org/comment/1724024/","msgid":"<7494dafd-a967-ee17-82df-393fb9095fad@linux.vnet.ibm.com>","date":"2017-07-20T05:39:52","subject":"Re: [PATCH v2 1/3] powerpc/powernv: handle the platform error reboot\n\tin ppc_md.restart","submitter":{"id":1436,"url":"http://patchwork.ozlabs.org/api/people/1436/","name":"Mahesh J Salgaonkar","email":"mahesh@linux.vnet.ibm.com"},"content":"On 07/19/2017 12:29 PM, Nicholas Piggin wrote:\n> Unrecovered MCE and HMI errors are sent through a special restart OPAL\n> call to log the platform error. The downside is that they don't go\n> through normal Linux crash paths, so they don't give much information\n> to the Linux console.\n> \n> Change this by providing a special crash function which does some of\n> the console flushing from the panic() path before calling firmware to\n> reboot.\n> \n> The downside of this is a little more code to execute before reaching\n> the firmware reboot. However in practice, it's critical to get the\n> Linux console messages output in order to debug a problem. So this is\n> a desirable tradeoff.\n> \n> Note on the implementation: It is difficult to plumb a custom reboot\n> handler into the panic path, because panic does a little bit too much\n> work. For example, it will try to delay with the timebase, but that\n> may be corrupted in some cases resulting in a hang without reaching\n> the platform reboot. Another problem is that panic can invoke the\n> crash dump code which is not what we want in the case of a hardware\n> platform error. Long-term the best solution will be to rework the\n> panic path so it can be suitable for this kind of panic, but for now\n> we just duplicate a bit of the 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/opal.h           |  2 +-\n>  arch/powerpc/platforms/powernv/opal-hmi.c | 22 ++------\n>  arch/powerpc/platforms/powernv/opal.c     | 89 ++++++++++++++++++-------------\n>  arch/powerpc/platforms/powernv/powernv.h  |  2 +\n>  4 files changed, 57 insertions(+), 58 deletions(-)\n> \n> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h\n> index 588fb1c23af9..182dab435aad 100644\n> --- a/arch/powerpc/include/asm/opal.h\n> +++ b/arch/powerpc/include/asm/opal.h\n> @@ -50,7 +50,7 @@ int64_t opal_tpo_write(uint64_t token, uint32_t year_mon_day,\n>  \t\t       uint32_t hour_min);\n>  int64_t opal_cec_power_down(uint64_t request);\n>  int64_t opal_cec_reboot(void);\n> -int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag);\n> +int64_t opal_cec_reboot2(uint32_t reboot_type, const char *diag);\n>  int64_t opal_read_nvram(uint64_t buffer, uint64_t size, uint64_t offset);\n>  int64_t opal_write_nvram(uint64_t buffer, uint64_t size, uint64_t offset);\n>  int64_t opal_handle_interrupt(uint64_t isn, __be64 *outstanding_event_mask);\n> diff --git a/arch/powerpc/platforms/powernv/opal-hmi.c b/arch/powerpc/platforms/powernv/opal-hmi.c\n> index 88f3c61eec95..d78fed728cdf 100644\n> --- a/arch/powerpc/platforms/powernv/opal-hmi.c\n> +++ b/arch/powerpc/platforms/powernv/opal-hmi.c\n> @@ -30,6 +30,8 @@\n>  #include <asm/cputable.h>\n>  #include <asm/machdep.h>\n> \n> +#include \"powernv.h\"\n> +\n>  static int opal_hmi_handler_nb_init;\n>  struct OpalHmiEvtNode {\n>  \tstruct list_head list;\n> @@ -267,8 +269,6 @@ static void hmi_event_handler(struct work_struct *work)\n>  \tspin_unlock_irqrestore(&opal_hmi_evt_lock, flags);\n> \n>  \tif (unrecoverable) {\n> -\t\tint ret;\n> -\n>  \t\t/* Pull all HMI events from OPAL before we panic. */\n>  \t\twhile (opal_get_msg(__pa(&msg), sizeof(msg)) == OPAL_SUCCESS) {\n>  \t\t\tu32 type;\n> @@ -284,23 +284,7 @@ static void hmi_event_handler(struct work_struct *work)\n>  \t\t\tprint_hmi_event_info(hmi_evt);\n>  \t\t}\n> \n> -\t\t/*\n> -\t\t * Unrecoverable HMI exception. We need to inform BMC/OCC\n> -\t\t * about this error so that it can collect relevant data\n> -\t\t * for error analysis before rebooting.\n> -\t\t */\n> -\t\tret = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR,\n> -\t\t\t\"Unrecoverable HMI exception\");\n> -\t\tif (ret == OPAL_UNSUPPORTED) {\n> -\t\t\tpr_emerg(\"Reboot type %d not supported\\n\",\n> -\t\t\t\t\t\tOPAL_REBOOT_PLATFORM_ERROR);\n> -\t\t}\n> -\n> -\t\t/*\n> -\t\t * Fall through and panic if opal_cec_reboot2() returns\n> -\t\t * OPAL_UNSUPPORTED.\n> -\t\t */\n> -\t\tpanic(\"Unrecoverable HMI exception\");\n> +\t\tpnv_platform_error_reboot(NULL, \"Unrecoverable HMI exception\");\n>  \t}\n>  }\n> \n> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c\n> index 9b87abb178f0..96436d129684 100644\n> --- a/arch/powerpc/platforms/powernv/opal.c\n> +++ b/arch/powerpc/platforms/powernv/opal.c\n> @@ -25,6 +25,10 @@\n>  #include <linux/memblock.h>\n>  #include <linux/kthread.h>\n>  #include <linux/freezer.h>\n> +#include <linux/printk.h>\n> +#include <linux/kmsg_dump.h>\n> +#include <linux/console.h>\n> +#include <linux/sched/debug.h>\n> \n>  #include <asm/machdep.h>\n>  #include <asm/opal.h>\n> @@ -436,10 +440,55 @@ static int opal_recover_mce(struct pt_regs *regs,\n>  \treturn recovered;\n>  }\n> \n> +void pnv_platform_error_reboot(struct pt_regs *regs, const char *msg)\n> +{\n> +\t/*\n> +\t * This is mostly taken from kernel/panic.c, but tries to do\n> +\t * relatively minimal work. Don't use delay functions (TB may\n> +\t * be broken), don't crash dump (need to set a firmware log),\n> +\t * don't run notifiers. We do want to get some information to\n> +\t * Linux console.\n> +\t */\n> +\tconsole_verbose();\n> +\tbust_spinlocks(1);\n> +\tpr_emerg(\"Hardware platform error: %s\\n\", msg);\n> +\tif (regs)\n> +\t\tshow_regs(regs);\n> +\tsmp_send_stop();\n> +\tprintk_safe_flush_on_panic();\n> +\tkmsg_dump(KMSG_DUMP_PANIC);\n> +\tbust_spinlocks(0);\n> +\tdebug_locks_off();\n> +\tconsole_flush_on_panic();\n> +\n> +\t/*\n> +\t * Don't bother to shut things down because this will\n> +\t * xstop the system.\n> +\t */\n> +\tif (opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR, msg)\n> +\t\t\t\t\t\t== OPAL_UNSUPPORTED) {\n> +\t\tpr_emerg(\"Reboot type %d not supported for %s\\n\",\n> +\t\t\t\tOPAL_REBOOT_PLATFORM_ERROR, msg);\n> +\t}\n> +\n> +\t/*\n> +\t * We reached here. There can be three possibilities:\n> +\t * 1. We are running on a firmware level that do not support\n> +\t *    opal_cec_reboot2()\n> +\t * 2. We are running on a firmware level that do not support\n> +\t *    OPAL_REBOOT_PLATFORM_ERROR reboot type.\n> +\t * 3. We are running on FSP based system that does not need\n> +\t *    opal to trigger checkstop explicitly for error analysis.\n> +\t *    The FSP PRD component would have already got notified\n> +\t *    about this error through other channels.\n> +\t */\n> +\n> +\tppc_md.restart(NULL);\n> +}\n> +\n>  int opal_machine_check(struct pt_regs *regs)\n>  {\n>  \tstruct machine_check_event evt;\n> -\tint ret;\n> \n>  \tif (!get_mce_event(&evt, MCE_EVENT_RELEASE))\n>  \t\treturn 0;\n> @@ -455,43 +504,7 @@ int opal_machine_check(struct pt_regs *regs)\n>  \tif (opal_recover_mce(regs, &evt))\n>  \t\treturn 1;\n> \n> -\t/*\n> -\t * Unrecovered machine check, we are heading to panic path.\n> -\t *\n> -\t * We may have hit this MCE in very early stage of kernel\n> -\t * initialization even before opal-prd has started running. If\n> -\t * this is the case then this MCE error may go un-noticed or\n> -\t * un-analyzed if we go down panic path. We need to inform\n> -\t * BMC/OCC about this error so that they can collect relevant\n> -\t * data for error analysis before rebooting.\n> -\t * Use opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR) to do so.\n> -\t * This function may not return on BMC based system.\n> -\t */\n> -\tret = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR,\n> -\t\t\t\"Unrecoverable Machine Check exception\");\n> -\tif (ret == OPAL_UNSUPPORTED) {\n> -\t\tpr_emerg(\"Reboot type %d not supported\\n\",\n> -\t\t\t\t\tOPAL_REBOOT_PLATFORM_ERROR);\n> -\t}\n> -\n> -\t/*\n> -\t * We reached here. There can be three possibilities:\n> -\t * 1. We are running on a firmware level that do not support\n> -\t *    opal_cec_reboot2()\n> -\t * 2. We are running on a firmware level that do not support\n> -\t *    OPAL_REBOOT_PLATFORM_ERROR reboot type.\n> -\t * 3. We are running on FSP based system that does not need opal\n> -\t *    to trigger checkstop explicitly for error analysis. The FSP\n> -\t *    PRD component would have already got notified about this\n> -\t *    error through other channels.\n> -\t *\n> -\t * If hardware marked this as an unrecoverable MCE, we are\n> -\t * going to panic anyway. Even if it didn't, it's not safe to\n> -\t * continue at this point, so we should explicitly panic.\n> -\t */\n> -\n> -\tpanic(\"PowerNV Unrecovered Machine Check\");\n> -\treturn 0;\n> +\tpnv_platform_error_reboot(regs, \"Unrecoverable Machine Check exception\");\n>  }\n> \n>  /* Early hmi handler called in real mode. */\n> diff --git a/arch/powerpc/platforms/powernv/powernv.h b/arch/powerpc/platforms/powernv/powernv.h\n> index 6dbc0a1da1f6..a159d48573d7 100644\n> --- a/arch/powerpc/platforms/powernv/powernv.h\n> +++ b/arch/powerpc/platforms/powernv/powernv.h\n> @@ -7,6 +7,8 @@ extern void pnv_smp_init(void);\n>  static inline void pnv_smp_init(void) { }\n>  #endif\n> \n> +extern void pnv_platform_error_reboot(struct pt_regs *regs, const char *msg) __noreturn;\n> +\n>  struct pci_dev;\n> \n>  #ifdef CONFIG_PCI\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 [103.22.144.68])\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 3xCjSH2k8kz9t2c\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 20 Jul 2017 15:41:19 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xCjSH1ttGzDrDR\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 20 Jul 2017 15:41:19 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\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 3xCjQn439DzDrDD\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 20 Jul 2017 15:40:01 +1000 (AEST)","from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv6K5dog7091788\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 20 Jul 2017 01:39:59 -0400","from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2btp4jrwtd-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 20 Jul 2017 01:39:59 -0400","from localhost\n\tby e23smtp04.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\tThu, 20 Jul 2017 15:39:56 +1000","from d23relay10.au.ibm.com (202.81.31.229)\n\tby e23smtp04.au.ibm.com (202.81.31.210) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 20 Jul 2017 15:39:55 +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\tv6K5dshA27721884\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 20 Jul 2017 15:39:54 +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\tv6K5dqBI009594\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 20 Jul 2017 15:39:53 +1000","from [9.195.46.51] ([9.195.46.51])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv6K5dpV4009564; Thu, 20 Jul 2017 15:39:51 +1000"],"Subject":"Re: [PATCH v2 1/3] powerpc/powernv: handle the platform error reboot\n\tin ppc_md.restart","To":"Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org","References":"<20170719065912.19183-1-npiggin@gmail.com>\n\t<20170719065912.19183-2-npiggin@gmail.com>","From":"Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>","Date":"Thu, 20 Jul 2017 11:09:52 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170719065912.19183-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":"17072005-0012-0000-0000-000002575CED","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17072005-0013-0000-0000-000007712D68","Message-Id":"<7494dafd-a967-ee17-82df-393fb9095fad@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-07-20_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-1706020000\n\tdefinitions=main-1707200092","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":1760892,"web_url":"http://patchwork.ozlabs.org/comment/1760892/","msgid":"<3xjgLJ2myxz9t1t@ozlabs.org>","date":"2017-08-31T11:36:07","subject":"Re: [v2, 1/3] powerpc/powernv: handle the platform error reboot in\n\tppc_md.restart","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-19 at 06:59:10 UTC, Nicholas Piggin wrote:\n> Unrecovered MCE and HMI errors are sent through a special restart OPAL\n> call to log the platform error. The downside is that they don't go\n> through normal Linux crash paths, so they don't give much information\n> to the Linux console.\n> \n> Change this by providing a special crash function which does some of\n> the console flushing from the panic() path before calling firmware to\n> reboot.\n> \n> The downside of this is a little more code to execute before reaching\n> the firmware reboot. However in practice, it's critical to get the\n> Linux console messages output in order to debug a problem. So this is\n> a desirable tradeoff.\n> \n> Note on the implementation: It is difficult to plumb a custom reboot\n> handler into the panic path, because panic does a little bit too much\n> work. For example, it will try to delay with the timebase, but that\n> may be corrupted in some cases resulting in a hang without reaching\n> the platform reboot. Another problem is that panic can invoke the\n> crash dump code which is not what we want in the case of a hardware\n> platform error. Long-term the best solution will be to rework the\n> panic path so it can be suitable for this kind of panic, but for now\n> we just duplicate a bit of the 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/b746e3e01e70d23ef53dcde1203ab7\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 3xjgw13N9Vz9s7F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 22:01:53 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjgw12BJRzDqhM\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 22:01:53 +1000 (AEST)","from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\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 3xjgLJ5j9HzDqTm\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 31 Aug 2017 21:36:08 +1000 (AEST)","by ozlabs.org (Postfix, from userid 1034)\n\tid 3xjgLJ2myxz9t1t; Thu, 31 Aug 2017 21:36:08 +1000 (AEST)"],"X-powerpc-patch-notification":"thanks","X-powerpc-patch-commit":"b746e3e01e70d23ef53dcde1203ab78a1b7ac514","In-Reply-To":"<20170719065912.19183-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, 1/3] powerpc/powernv: handle the platform error reboot in\n\tppc_md.restart","Message-Id":"<3xjgLJ2myxz9t1t@ozlabs.org>","Date":"Thu, 31 Aug 2017 21:36:07 +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>"}}]