From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keerthy Subject: Re: [PATCH] thermal: omap-thermal: Add notify function to thermal_zone_device_ops Date: Tue, 10 May 2016 17:32:52 +0530 Message-ID: <5731CDEC.5020904@ti.com> References: <1455599145-5656-1-git-send-email-j-keerthy@ti.com> <20160308204812.GA6800@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from comal.ext.ti.com ([198.47.26.152]:43049 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbcEJMC5 (ORCPT ); Tue, 10 May 2016 08:02:57 -0400 In-Reply-To: <20160308204812.GA6800@localhost.localdomain> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Eduardo Valentin , Keerthy Cc: nm@ti.com, rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-omap@vger.kernel.org On Wednesday 09 March 2016 02:18 AM, Eduardo Valentin wrote: > On Tue, Feb 16, 2016 at 10:35:45AM +0530, Keerthy wrote: >> notify function is used to notify when some temperature thresholds >> are crossed. In case we get notified for a critical trip point then >> schedule an emergency shutdown function to backup orderly_poweroff >> failures. >> >> orderly_poweroff is triggered when a graceful shutdown >> of system is desired. This may be used in many critical states of the >> kernel such as when subsystems detects conditions such as critical >> temperature conditions. However, in certain conditions in system >> boot up sequences like those in the middle of driver probes being >> initiated, userspace will be unable to power off the system in a clean >> manner and leaves the system in a critical state. In cases like these, >> the /sbin/poweroff will return success (having forked off to attempt >> powering off the system. However, the system overall will fail to >> completely poweroff (since other modules will be probed) and the system >> is still functional with no userspace (since that would have shut itself >> off). >> >> However, there is no clean way of detecting such failure of userspace >> powering off the system. In such scenarios, it is necessary for a backup >> workqueue to be able to force a shutdown of the system when orderly >> shutdown is not successful after a configurable time period. >> >> Signed-off-by: Keerthy >> --- >> >> The previous discussion: >> >> https://lkml.org/lkml/2016/1/28/989 >> >> Making use of the notify ops to schedule a backup thermal shutdown. > > Yeah, this was a bit of a stretching. If we cannot fix orderly power > off, I would say, better fixing it for all thermal drivers (previous > version of this). This patch: > 1. Abuse a notify function to be used as a power off functions > 2. Fix an issue only for a single driver. > > I will check your initial version. Eduardo, Any updates on this? Regards, Keerthy >