Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759404Ab0D3TBW (ORCPT ); Fri, 30 Apr 2010 15:01:22 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:32899 "EHLO mail-pz0-f204.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759379Ab0D3TBA convert rfc822-to-8bit (ORCPT ); Fri, 30 Apr 2010 15:01:00 -0400 MIME-Version: 1.0 In-Reply-To: <201004292311.27400.rjw@sisk.pl> References: <1272429119-12103-1-git-send-email-arve@android.com> <201004290105.15707.rjw@sisk.pl> <201004292311.27400.rjw@sisk.pl> Date: Thu, 29 Apr 2010 16:41:57 -0700 Message-ID: Subject: Re: [PATCH 2/8] PM: suspend_block: Add driver to access suspend blockers from user-space From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: "Rafael J. Wysocki" Cc: linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Alan Stern , Tejun Heo , Oleg Nesterov , Randy Dunlap , Andrew Morton , Ryusuke Konishi , Jim Collar , Greg Kroah-Hartman , Avi Kivity , Len Brown , Pavel Machek , Magnus Damm , Cornelia Huck , Nigel Cunningham , linux-doc@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1842 Lines: 49 2010/4/29 Rafael J. Wysocki : > On Thursday 29 April 2010, Arve Hj?nnev?g wrote: >> 2010/4/28 Rafael J. Wysocki : >> > On Thursday 29 April 2010, Arve Hj?nnev?g wrote: >> >> 2010/4/28 Rafael J. Wysocki : >> >> > On Wednesday 28 April 2010, Arve Hj?nnev?g wrote: >> >> >> Add a misc device, "suspend_blocker", that allows user-space processes >> >> >> to block auto suspend. The device has ioctls to create a suspend_blocker, >> >> >> and to block and unblock suspend. To delete the suspend_blocker, close >> >> >> the device. >> >> >> >> >> >> Signed-off-by: Arve Hj?nnev?g >> >> > ... >> >> >> + >> >> >> +#include >> >> >> +#include >> >> >> +#include >> >> >> +#include >> >> >> +#include >> >> >> +#include >> >> >> +#include >> >> >> + >> >> >> +enum { >> >> >> + ? ? DEBUG_FAILURE ? = BIT(0), >> >> >> +}; >> >> >> +static int debug_mask = DEBUG_FAILURE; >> >> > >> >> > What's the exact purpose of this? >> >> >> >> To show errors returned to user space. I can turn it off by default if you want. >> > >> > Not necessarily, but why is it a mask? ?It looks like a 0/1 thing would be >> > sufficient. >> >> I may want to add a bit to print all user-space block and unblock calls. > > Alternatively, you can add a new parameter for that, which I think I would prefer. > I use a bit-mask in the main suspend blocker code. This makes it easy to turn on or off all the messages. -- Arve Hj?nnev?g -- 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/