From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: Re: [RFC][PATCH 2/3] PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily Date: Thu, 15 May 2014 10:35:51 -0700 Message-ID: <7hiop7ymfc.fsf@paris.lan> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from mail-pa0-f42.google.com ([209.85.220.42]:39052 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754894AbaEORfx (ORCPT ); Thu, 15 May 2014 13:35:53 -0400 Received: by mail-pa0-f42.google.com with SMTP id rd3so1359070pab.29 for ; Thu, 15 May 2014 10:35:53 -0700 (PDT) In-Reply-To: (Alan Stern's message of "Tue, 13 May 2014 11:46:55 -0400 (EDT)") Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Alan Stern Cc: "Rafael J. Wysocki" , Linux PM list , ACPI Devel Maling List , Aaron Lu , Mika Westerberg , Linux Kernel Mailing List , Ulf Hansson Alan Stern writes: > On Tue, 13 May 2014, Rafael J. Wysocki wrote: > >> > A wakeup request from the hardware could cause a runtime resume to >> > occur at this time. The barrier wouldn't prevent that. >> > >> > It's unlikely, I agree, but not impossible. >> >> Yeah, I didn't think about that. > > Come to think of it, if the hardware sends a wakeup request then it > must have been enabled for remote wakeup. And if the hardware settings > are appropriate for system suspend then it must be enabled for system > wakeup. Consequently a wakeup from the hardware ought to abort the > system suspend in any case. So maybe we don't care about this > scenario. > > On the other hand, there may be other mechanisms that could cause a > runtime resume at this inconvenient time. A timer routine, for > instance. Another common case is when device X depends on device Y in it's ->prepare or ->suspend path (e.g. need to write to an I2C connected GPIO/PMIC) in which case, device Y (and the I2C bus) would be runtime resumed during device X's ->prepare or ->suspend path, and possibly after device Y (or the I2C busses) ->prepare and ->suspend. Kevin