From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757518Ab0E2PMH (ORCPT ); Sat, 29 May 2010 11:12:07 -0400 Received: from smtp-out.google.com ([74.125.121.35]:32131 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757447Ab0E2PMB convert rfc822-to-8bit (ORCPT ); Sat, 29 May 2010 11:12:01 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=JMmvTAHa5ZwwUtM/IHG2bMqcDYwNdRF/Ns7wvv95VSq8kLvQW2VBbk+DPsADjiBFw vaWiYZ/Ghl4Ozn7Ei5Vaw== MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 29 May 2010 08:11:58 -0700 Message-ID: Subject: Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8) From: Brian Swetland To: Alan Stern Cc: Florian Mickler , Peter Zijlstra , "Rafael J. Wysocki" , Linux PM , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Alan Cox , Matthew Garrett , Thomas Gleixner , LKML , Ingo Molnar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 29, 2010 at 8:03 AM, Alan Stern wrote: > On Sat, 29 May 2010, Brian Swetland wrote: >> On Sat, May 29, 2010 at 7:10 AM, Alan Stern wrote: >> > If no such constraints are active, the QoS-based suspend blocks in an >> > interruptible wait until the number of active QOS_EVENTUALLY >> > constraints drops to 0.  When that happens, it carries out a normal >> > suspend-to-RAM -- except that it checks along the way to make sure that >> > no new QoS constraints are activated while the suspend is in progress. >> > If they are, the PM core backs out and fails the QoS-based suspend. >> >> The issue with this approach is that if userspace wants to suspend >> while a driver is holding a QOS_EVENTUALLY constraint, it's basically >> going to spin constantly writing "qos" and failing. > > No, no.  If userspace wants to suspend while a driver is holding a > QOS_EVENTUALLY constraint, the user process blocks in an interruptible > wait state as described in the first paragraph above. Oops -- I misread the first paragraph. The behavior you described is indeed what I would want. Brian