Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754324Ab2BPWFX (ORCPT ); Thu, 16 Feb 2012 17:05:23 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:56610 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753303Ab2BPWFV convert rfc822-to-8bit (ORCPT ); Thu, 16 Feb 2012 17:05:21 -0500 From: "Rafael J. Wysocki" To: Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= Subject: Re: [PATCH 3/3] PM / Sleep: Make __pm_stay_awake() delete wakeup source timers Date: Thu, 16 Feb 2012 23:09:15 +0100 User-Agent: KMail/1.13.6 (Linux/3.3.0-rc3+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM list , LKML References: <201202152318.04206.rjw@sisk.pl> <201202152324.08073.rjw@sisk.pl> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-Id: <201202162309.15367.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1565 Lines: 33 On Thursday, February 16, 2012, Arve Hj?nnev?g wrote: > 2012/2/15 Rafael J. Wysocki : > > From: Rafael J. Wysocki > > > > If __pm_stay_awake() is called after __pm_wakeup_event() for the same > > wakep source object before its timer expires, it won't cancel the > > timer, so the wakeup source will be deactivated from the timer > > function as scheduled by __pm_wakeup_event(). In that case > > __pm_stay_awake() doesn't have any effect beyond incrementing > > the wakeup source's event_count field, although it should cancel > > the timer and make the wakeup source stay active until __pm_relax() > > is called for it. > > > > Conversely, if __pm_wakeup_event() is called for a wakeup source > > that has been activated by __pm_stay_awake() before, it will set up > > the timer to deactivate the wakeup source, although it should leave > > it active until __pm_relax() is called for it. > > We have many drivers that call wake_lock_timeout instead of > wake_unlock to cancel a previous wake_lock call. These drivers will > need to use two wakeup sources if __pm_wakeup_event does not always > set the timeout. I think it is better to have the state of the wakeup > source only depend on the last function you called, instead of that > last function being a noop in some cases. OK Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/