From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Brown Subject: Re: [PATCH] - race-free suspend. Was: Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8) Date: Thu, 3 Jun 2010 08:05:56 +1000 Message-ID: <20100603080556.46d2d671@notabene.brown> References: <20100602153235.340a7852@notabene.brown> <201006022241.14152.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from cantor.suse.de ([195.135.220.2]:52371 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758777Ab0FBWGR (ORCPT ); Wed, 2 Jun 2010 18:06:17 -0400 In-Reply-To: <201006022241.14152.rjw@sisk.pl> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: "Rafael J. Wysocki" Cc: Thomas Gleixner , Alan Stern , Felipe Balbi , Arve =?UTF-8?B?SGrDuG5uZXbDpWc=?= , Peter Zijlstra , "Paul@smtp1.linux-foundation.org" , LKML , Florian Mickler , Linux OMAP Mailing List , Linux PM , Alan Cox , James Bottomley On Wed, 2 Jun 2010 22:41:14 +0200 "Rafael J. Wysocki" wrote: > On Wednesday 02 June 2010, Neil Brown wrote: > > - Would this fix the "bug"?? > > - and address the issues that suspend-blockers was created to address? > > - or are the requirements on user-space too onerous? > > In theory wakeup events can also happen after wait_for_blockers() has returned > 0 and I guess we should rollback the suspend in such cases. > I naively assumed this was already the case, but on a slightly closer look at the code it seems not. Presumably there is some point deep in the suspend code, probably after the call to sysdev_suspend, where interrupts are disabled and we are about to actually suspend. At that point a simple "is a roll-back required" test could abort the suspend. Then any driver that handles wake-up events, if it gets and event that (would normally cause a wakeup) PM_SUSPEND_PREPARE and PM_POST_SUSPEND, could set the "roll-back is required" flag. ?? NeilBrown