From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756613Ab0E1OGB (ORCPT ); Fri, 28 May 2010 10:06:01 -0400 Received: from cavan.codon.org.uk ([93.93.128.6]:46283 "EHLO cavan.codon.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661Ab0E1OGA (ORCPT ); Fri, 28 May 2010 10:06:00 -0400 Date: Fri, 28 May 2010 15:05:37 +0100 From: Matthew Garrett To: Alan Cox Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Alan Stern , Thomas Gleixner , Peter Zijlstra , LKML , Florian Mickler , felipe.balbi@nokia.com, Linux OMAP Mailing List , Linux PM Subject: Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8) Message-ID: <20100528140537.GE25798@srcf.ucam.org> References: <20100527230806.4deb6de3@lxorguk.ukuu.org.uk> <20100527220949.GB10602@srcf.ucam.org> <20100527232357.6d14fdb2@lxorguk.ukuu.org.uk> <20100528101755.7b5f6b8a@lxorguk.ukuu.org.uk> <20100528121636.34be17ad@lxorguk.ukuu.org.uk> <20100528145526.0ce83c85@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100528145526.0ce83c85@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.18 (2008-05-17) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: mjg59@cavan.codon.org.uk X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2010 at 02:55:26PM +0100, Alan Cox wrote: > The following cannot occur on my laptop for simple idling > > Alarm > Suspend > > because the Alarm resets the suspend timer when it is delivered. Userspace is about to write to /sys/power/state when it gets scheduled. Alarm delivery occurs at that instant. Kernel has no idea that it's about to go to sleep, so the driver handles things appropriately and clears the hardware state. Userspace gets scheduled, writes and the system suspends. The problem is that having userspace decidie to initiate a suspend and then actually initiate a suspend isn't an atomic operation. -- Matthew Garrett | mjg59@srcf.ucam.org