From patchwork Mon Aug 24 08:31:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 265129 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=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, 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 54B09C433E4 for ; Mon, 24 Aug 2020 08:54:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3132E208E4 for ; Mon, 24 Aug 2020 08:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598259298; bh=DFuCPXtEEz1xu3aZpmT9lVN3B+6ux1rs+YD9CTBmBa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=clFSvVxyp6bQOFvrfurS3SCdAdYcIAeufPJhCdAiFZiWIFvA5rd/fIj7ONYVKvOLb EQ2ee/oIwpHnjkUL20QYQUA8FGeBvxh17PDrJy+4BE7jerWiBfjANUWqSKqmyPVUVy ukj0XiG16FK4LLhBeF5AUy0X1q6xnr0lPMFymiRw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730355AbgHXIyz (ORCPT ); Mon, 24 Aug 2020 04:54:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:36060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730374AbgHXIyw (ORCPT ); Mon, 24 Aug 2020 04:54:52 -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 309FD204FD; Mon, 24 Aug 2020 08:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598259291; bh=DFuCPXtEEz1xu3aZpmT9lVN3B+6ux1rs+YD9CTBmBa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gZ2lQGcnx4KxbjanQLJFkw5yfCHKZupJjei+FS3Z+A1oYI5fJnLlUE8LzXJU6kZlM PZ+2qivZvDIe9mUVQHmptS7KCQ/Z50tn9uTFu4XQQ+0gMc00fswfy5SWJPurnCy5mh XVxxfLN8MseSkiTa4pjZCEn7LZqWg/8yu4UhxnQE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasant Hegde , Michael Ellerman Subject: [PATCH 4.14 45/50] powerpc/pseries: Do not initiate shutdown when system is running on UPS Date: Mon, 24 Aug 2020 10:31:46 +0200 Message-Id: <20200824082354.320936419@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200824082351.823243923@linuxfoundation.org> References: <20200824082351.823243923@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vasant Hegde commit 90a9b102eddf6a3f987d15f4454e26a2532c1c98 upstream. As per PAPR we have to look for both EPOW sensor value and event modifier to identify the type of event and take appropriate action. In LoPAPR v1.1 section 10.2.2 includes table 136 "EPOW Action Codes": SYSTEM_SHUTDOWN 3 The system must be shut down. An EPOW-aware OS logs the EPOW error log information, then schedules the system to be shut down to begin after an OS defined delay internal (default is 10 minutes.) Then in section 10.3.2.2.8 there is table 146 "Platform Event Log Format, Version 6, EPOW Section", which includes the "EPOW Event Modifier": For EPOW sensor value = 3 0x01 = Normal system shutdown with no additional delay 0x02 = Loss of utility power, system is running on UPS/Battery 0x03 = Loss of system critical functions, system should be shutdown 0x04 = Ambient temperature too high All other values = reserved We have a user space tool (rtas_errd) on LPAR to monitor for EPOW_SHUTDOWN_ON_UPS. Once it gets an event it initiates shutdown after predefined time. It also starts monitoring for any new EPOW events. If it receives "Power restored" event before predefined time it will cancel the shutdown. Otherwise after predefined time it will shutdown the system. Commit 79872e35469b ("powerpc/pseries: All events of EPOW_SYSTEM_SHUTDOWN must initiate shutdown") changed our handling of the "on UPS/Battery" case, to immediately shutdown the system. This breaks existing setups that rely on the userspace tool to delay shutdown and let the system run on the UPS. Fixes: 79872e35469b ("powerpc/pseries: All events of EPOW_SYSTEM_SHUTDOWN must initiate shutdown") Cc: stable@vger.kernel.org # v4.0+ Signed-off-by: Vasant Hegde [mpe: Massage change log and add PAPR references] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200820061844.306460-1-hegdevasant@linux.vnet.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/pseries/ras.c | 1 - 1 file changed, 1 deletion(-) --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c @@ -115,7 +115,6 @@ static void handle_system_shutdown(char case EPOW_SHUTDOWN_ON_UPS: pr_emerg("Loss of system power detected. System is running on" " UPS/battery. Check RTAS error log for details\n"); - orderly_poweroff(true); break; case EPOW_SHUTDOWN_LOSS_OF_CRITICAL_FUNCTIONS: