From: Dmitry Torokhov Subject: Re: [PATCH 0/8] Suspend block api (version 6) Date: Tue, 25 May 2010 15:28:14 -0700 Message-ID: <20100525222814.GB4928@core.coreip.homeip.net> References: <20100525165137.GB2730@core.coreip.homeip.net> <20100525183334.GA4669@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: 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: Arve =?iso-8859-1?B?SGr4bm5lduVn?= Cc: Greg Kroah-Hartman , Sven Neumann , Jesse Barnes , Oleg Nesterov , Tero Saarni , linux-input@vger.kernel.org, Linux-pm mailing list , Arjan van de Ven , Alexey Dobriyan , Matthew Garrett , Len Brown , Jacob Pan , Daniel Mack , linux-omap@vger.kernel.org, Liam Girdwood , Daniel Walker , Theodore Ts'o , =?iso-8859-1?Q?M=E1rton_N=E9meth?= , Brian Swetland , Mark Brown List-Id: linux-input@vger.kernel.org On Tue, May 25, 2010 at 03:05:41PM -0700, Arve Hj=F8nnev=E5g wrote: > On Tue, May 25, 2010 at 11:33 AM, Dmitry Torokhov > wrote: > > On Tue, May 25, 2010 at 02:25:08PM -0400, Alan Stern wrote: > >> On Tue, 25 May 2010, Dmitry Torokhov wrote: > >> > >> > BTW, If you are concerned about events that already "left" physical > >> > device but has not reached userspace yet - maybe instead of suspend > >> > blockers we should make sure that all drivers throughout the chain > >> > implement suspend/resume and refuse suspending if their queues are n= ot > >> > empty. =A0In input land that would mean extending suspend routine in > >> > input_dev and adding one to evdev. > >> > >> That's not the only problem. =A0We also have to consider events that h= ave > >> reached userspace but not yet been fully processed. =A0The user thread > >> handling the event needs some way to prevent the system from suspending > >> until it is all done. > >> > > > > It is a problem if kernel initiated suspend transition on its own. I > > believe that it is userspace responsibility to initiate sustend (and > > make sure that needs of userspace, including processing of certain > > events, are served beforehand). > = > That only works if a single user-space thread initiates suspend Yes, there should be a single entity controlling suspend. > and > consumes all wakeup events (or if the user-space code that initiates > suspend implements suspend blockers), Yes. > and even then the kernel would > still need to block suspend in same places as it does if the kernel > initiates suspend. If a wakeup event happens right after user-space > initiates suspend, that suspend must be aborted. This is true regardless of whether we use suspend blockers or not. If, after initiating suspend, we detect wake up event that event shoudl be acted upon and suspend should be ignored. > By only initiating > suspend from user-space, you force this to be a polling operation. > I am not sure what you mean by this. -- = Dmitry