Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773AbbDAOgx (ORCPT ); Wed, 1 Apr 2015 10:36:53 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:56842 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753724AbbDAOgv (ORCPT ); Wed, 1 Apr 2015 10:36:51 -0400 Date: Wed, 1 Apr 2015 10:36:50 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Tomeu Vizoso , Linux-pm mailing list , Greg Kroah-Hartman , Scot Doyle , Dan Williams , Julius Werner , "Rafael J. Wysocki" , Sebastian Andrzej Siewior , USB list , Kernel development list Subject: Re: [PATCH 6/6] USB / PM: Allow USB devices to remain runtime-suspended when sleeping In-Reply-To: <1427898406.30440.12.camel@suse.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1467 Lines: 40 On Wed, 1 Apr 2015, Oliver Neukum wrote: > On Wed, 2015-04-01 at 10:01 -0400, Alan Stern wrote: > > On Wed, 1 Apr 2015, Oliver Neukum wrote: > > > > > On Tue, 2015-03-31 at 13:09 -0400, Alan Stern wrote: > > > > In other words, if the device is currently in runtime suspend with > > > > remote wakeup enabled, but device_may_wakeup() returns 0 (so that the > > > > device should be disabled for wakeup when the system goes into > > > > suspend), then the prepare callback has to return 0. > > > > > > > > Therefore what you need to do here is something like this: > > > > > > > > struct usb_device *udev = to_usb_device(dev); > > > > > > > > /* Return 0 if the current wakeup setting is wrong, otherwise > > > > 1 */ > > > > > > And the other way round? > > > > Your meaning isn't clear. Are you asking what should happen if the > > device is in runtime suspend with remote wakeup disabled, but > > device_may_wakeup() returns 1? > > Yes. I was thinking about that case. > > > That case should never happen -- but > > if it does then the prepare callback should return 0. > > Exactly. It didn't seem to do so. Well, Tomeu can fix it up to handle both cases properly. Alan Stern -- 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/