From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 13FD11A05EB for ; Thu, 7 May 2015 19:31:31 +1000 (AEST) Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 May 2015 19:31:29 +1000 Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 95DCA2BB0040 for ; Thu, 7 May 2015 19:31:27 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t479VJWv37683330 for ; Thu, 7 May 2015 19:31:27 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t479UsHT017847 for ; Thu, 7 May 2015 19:30:55 +1000 From: Vipin K Parashar To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 0/2] Poweroff (EPOW, DPO) events support for PowerNV platform Date: Thu, 7 May 2015 15:00:18 +0530 Message-Id: <1430991020-7556-1-git-send-email-vipin@linux.vnet.ibm.com> Cc: stewart@linux.vnet.ibm.com, Vipin K Parashar , joel@jms.id.au List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This patchset adds support for FSP EPOW (Early Power Off Warning) and DPO (Delayed Power Off) events support for PowerNV platform. EPOW events are generated by SPCN/FSP due to various critical system conditions that need system shutdown. Few examples of these conditions are high ambient temperature or system running on UPS power with low UPS battery. DPO event is generated in response to admin initiated system shutdown request. This patchset enables host kernel on PowerNV platform to handle OPAL notifications for these events and initiate system poweroff. Since EPOW notifications are sent in advance of impending shutdown event and thus functionality is also added to wait for EPOW condition to return to normal. EPOW events timeout values are available via OPAL exported device tree values under EPOW node. Host kernel allows MAX_POWEROFF_SYS_TIME (600 seconds) as system poweroff time (time for host + guests shutdown) and waits for remaining time for EPOW condition to return to normal. If EPOW condition doesn't return to normal in calculated time it proceeds with graceful system shutdown. For EPOW events with smaller timeouts values than MAX_POWEROFF_SYS_TIME it proceeds with system shutdown without any wait for EPOW condition to return to normal. System admin can also add systemd service shutdown scripts to perform any specific actions like graceful guest shutdown upon system poweroff. libvirt-guests is systemd service available on recent distros for management of guests at system stat/shutdown time. Changes in v2: - Made code changes to improve code as per previous review comments. - Added patch to obtain EPOW event timeout values from OPAL device-tree. Vipin K Parashar (2): powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform powerpc/powernv: Extract EPOW events timeout values from OPAL device tree arch/powerpc/include/asm/opal-api.h | 30 ++ arch/powerpc/include/asm/opal.h | 3 +- arch/powerpc/platforms/powernv/opal-power.c | 440 +++++++++++++++++++++++-- arch/powerpc/platforms/powernv/opal-wrappers.S | 1 + 4 files changed, 452 insertions(+), 22 deletions(-) -- 1.9.3