Return-Path: Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id A9CE81A0226 for ; Mon, 11 May 2015 16:49:52 +1000 (AEST) Message-ID: <1431326992.31935.1.camel@ellerman.id.au> Subject: Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform From: Michael Ellerman To: Vipin K Parashar Date: Mon, 11 May 2015 16:49:52 +1000 In-Reply-To: <1430991020-7556-2-git-send-email-vipin@linux.vnet.ibm.com> References: <1430991020-7556-1-git-send-email-vipin@linux.vnet.ibm.com> <1430991020-7556-2-git-send-email-vipin@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: stewart@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, joel@jms.id.au List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, 2015-05-07 at 15:00 +0530, Vipin K Parashar wrote: > This patch 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 patch 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 > this patch also adds functionality to wait for EPOW condition to return to > normal. Host 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. Can I suggest an alternative design: - when we recieve a DPO event call orderly_poweroff() - when we recieve an EPOW event call orderly_poweroff() Thoughts? cheers