From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp03.in.ibm.com (e28smtp03.in.ibm.com [122.248.162.3]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 894791A0010 for ; Mon, 11 May 2015 20:47:45 +1000 (AEST) Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 May 2015 16:17:41 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 71A68125805A for ; Mon, 11 May 2015 16:19:48 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t4BAla2A56033320 for ; Mon, 11 May 2015 16:17:36 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t4BAlar5002392 for ; Mon, 11 May 2015 16:17:36 +0530 Received: from localhost.localdomain ([9.109.223.45]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t4BAlabj002386 for ; Mon, 11 May 2015 16:17:36 +0530 Message-ID: <555088C8.9040806@linux.vnet.ibm.com> Date: Mon, 11 May 2015 16:17:36 +0530 From: Vipin K Parashar MIME-Version: 1.0 To: linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform References: <1430991020-7556-1-git-send-email-vipin@linux.vnet.ibm.com> <1430991020-7556-2-git-send-email-vipin@linux.vnet.ibm.com> <1431326992.31935.1.camel@ellerman.id.au> <55506FEB.3010701@linux.vnet.ibm.com> In-Reply-To: <55506FEB.3010701@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 05/11/2015 02:31 PM, Vipin K Parashar wrote: > > On 05/11/2015 12:19 PM, Michael Ellerman wrote: >> 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? > > Current design is calling orderly_poweroff immediately upon DPO event > as there is not need to wait for user initiated shutdowns. > EPOW is sent in anticipation of a poweroff needed ahead of time. A > typical example > is EPOW due to system on UPS power with 15 mins timeout. There could > be case > when power is restored back within timeout and a poweroff is not > needed. In such case > HW sends EPOW reset informing that EPOW condition has returned to normal. > Another example is EPOW due to high ambient temp with 15 mins > timeout. > Here too if temp goes down to manageable limits within timeout window, > HW sends EPOW reset > to avoid shutdown. > So to handle such cases current design implements wait for > HW Timeout - MAX_POWEROFF_SYS_TIME seconds before poweroff. If EPOW > condition > returns to normal within this time poweroff is cancelled. So immediate > poweroff is avoided > here to handle cases when EPOW condition returns to normal. > For EPOW cases (like system on UPS power with UPS battery low or > Ambient temp > critically high) which have timeouts lower than MAX_POWEROFF_SYS > seconds, it calls immediate > orderly_poweroff. > In concise design implements immediate orderly_poweroff for DPO > as well as EPOW cases when > timeout is less than MAX_POWEROFF_SYS_TIME while for EPOW cases with > MAX_POWEROFF_SYS_TIME > timeout it implements a wait for EPOW to return the normal. Correction as below for above line: ........... it implements a wait for EPOW to return to normal followed by a orderly_poweroff after wait time. > > Suggestions/thoughts ? > > --Vipin >> cheers >> >> > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev