From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: Query: When will drv->poweroff() called Date: Mon, 6 Feb 2012 13:07:40 +0100 Message-ID: <201202061307.40628.rjw@sisk.pl> References: <4F2F6B40.6070308@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F2F6B40.6070308@st.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Viresh Kumar Cc: len.brown@intel.com, Vipul Kumar SAMAR , Bhupesh SHARMA , Pratyush ANAND , Armando VISCONTI , Mirko GARDI , "linux-kernel@vger.kernel.org" , Vipin KUMAR , Shiraz HASHIM , Amit VIRDI , Rajeev KUMAR , deepak sikri , "linux-pm@lists.linux-foundation.org" , Vincenzo FRASCINO List-Id: linux-pm@vger.kernel.org Hi, On Monday, February 06, 2012, Viresh Kumar wrote: > > Hi Guys, > > Sorry for asking this silly question, but i couldn't locate much > help for it in documentation, so asking it. > > We were testing hibernation for SPEAr13xx SoC family, based on > ARM Cortex a9. > > I observed that poweroff() callback of individual drivers are not > getting called at all, while we test hibernate. They should be called in the last phase of hibernation, after the image has been created and the system is going for "power off" (hance the callback name). > I tried to go through the code to see what happened. It looked like > there should be call to hibernation_set_ops() for platforms that are > willing to get a call to poweroff() for their drivers. That's correct. The ->poweroff() callbacks are only executed if hibernation_mode is equal to HIBERNATION_PLATFORM, which is not the default. > Otherwise shutdown of the busses gets called, which is a completely > different path. > > There are many drivers today, that are registering poweroff() from dev_pm_ops > but are not doing bus specific shutdown stuff. > > Even i tried to look for hibernation_set_ops() in kernel, and only acpi > code is calling it. That's correct too. > I didn't understood how other ARM Sub-Arch's are handling this. Well, they are supposed to call hibernation_set_ops() and set the operations appropriately. Those operations may be empty routines if they don't need to do anything, but they have to be defined. Thanks, Rafael From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754808Ab2BFMD4 (ORCPT ); Mon, 6 Feb 2012 07:03:56 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:38879 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754155Ab2BFMDz (ORCPT ); Mon, 6 Feb 2012 07:03:55 -0500 From: "Rafael J. Wysocki" To: Viresh Kumar Subject: Re: Query: When will drv->poweroff() called Date: Mon, 6 Feb 2012 13:07:40 +0100 User-Agent: KMail/1.13.6 (Linux/3.3.0-rc2+; KDE/4.6.0; x86_64; ; ) Cc: pavel@ucw.cz, len.brown@intel.com, "linux-pm@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , Shiraz HASHIM , Armando VISCONTI , Vipin KUMAR , deepak sikri , Vipul Kumar SAMAR , Amit VIRDI , Rajeev KUMAR , Pratyush ANAND , Mirko GARDI , Vincenzo FRASCINO , Bhupesh SHARMA References: <4F2F6B40.6070308@st.com> In-Reply-To: <4F2F6B40.6070308@st.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202061307.40628.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Monday, February 06, 2012, Viresh Kumar wrote: > > Hi Guys, > > Sorry for asking this silly question, but i couldn't locate much > help for it in documentation, so asking it. > > We were testing hibernation for SPEAr13xx SoC family, based on > ARM Cortex a9. > > I observed that poweroff() callback of individual drivers are not > getting called at all, while we test hibernate. They should be called in the last phase of hibernation, after the image has been created and the system is going for "power off" (hance the callback name). > I tried to go through the code to see what happened. It looked like > there should be call to hibernation_set_ops() for platforms that are > willing to get a call to poweroff() for their drivers. That's correct. The ->poweroff() callbacks are only executed if hibernation_mode is equal to HIBERNATION_PLATFORM, which is not the default. > Otherwise shutdown of the busses gets called, which is a completely > different path. > > There are many drivers today, that are registering poweroff() from dev_pm_ops > but are not doing bus specific shutdown stuff. > > Even i tried to look for hibernation_set_ops() in kernel, and only acpi > code is calling it. That's correct too. > I didn't understood how other ARM Sub-Arch's are handling this. Well, they are supposed to call hibernation_set_ops() and set the operations appropriately. Those operations may be empty routines if they don't need to do anything, but they have to be defined. Thanks, Rafael