Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761896Ab0HFWGe (ORCPT ); Fri, 6 Aug 2010 18:06:34 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:47321 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676Ab0HFWGa convert rfc822-to-8bit (ORCPT ); Fri, 6 Aug 2010 18:06:30 -0400 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: Attempted summary of suspend-blockers LKML thread Date: Sat, 7 Aug 2010 00:04:43 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-rjw+; KDE/4.4.4; x86_64; ; ) Cc: Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= , Matthew Garrett , david@lang.hm, "Paul E. McKenney" , Arjan van de Ven , linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, florian@mickler.org, swetland@google.com, peterz@infradead.org, tglx@linutronix.de, alan@lxorguk.ukuu.org.uk References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-Id: <201008070004.43923.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1942 Lines: 41 On Friday, August 06, 2010, Alan Stern wrote: > On Thu, 5 Aug 2010, Arve Hj?nnev?g wrote: ... > But what sorts of things qualify as wakeup events? Right now, the code > handles only events coming by way of the PME# signal (or its platform > equivalent). But that signal usually gets activated only when a PCI > device is in a low-power mode; if the device is at full power then it > simply generates an IRQ. It's the same event, but reported to the > kernel in a different way. So consider... > > Case 1: The system is suspending and the PCI device has already been > placed in D3hot when an event occurs. PME# is activated, > the wakeup event is reported, the suspend is aborted, and the > system won't try to suspend again for at least 100 ms. Good. > > Case 2: The system is running normally and the PCI device is at full > power when an event occurs. PME# isn't activated and > pm_wakeup_event doesn't get called. Then when the system > tries to suspend 25 ms later, there's nothing to prevent it > even though the event is still being processed. Bad. > > In case 2 the race has not been resolved. It seems to me that the > only proper solution is to call pm_wakeup_event for _every_ PCI > interrupt. This may be too much to add to a hot path, but what's the > alternative? Arguably not every PCI interrupt should be regarded as a wakeup event, so I think we can simply say in the cases when that's necessary the driver should be responsible for using pm_wakeup_event() or pm_stay_awake() / pm_relax() as appropriate. My patch only added it to the bus-level code which covered the PME-based wakeup events that _cannot_ be handled by device drivers. Thanks, Rafael -- 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/