Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934414AbbENP5H (ORCPT ); Thu, 14 May 2015 11:57:07 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:50731 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932698AbbENP5E (ORCPT ); Thu, 14 May 2015 11:57:04 -0400 Date: Thu, 14 May 2015 10:54:55 -0500 From: Felipe Balbi To: Alan Stern CC: Felipe Balbi , Tony Lindgren , "Rafael J. Wysocki" , Andreas Fenkart , Greg Kroah-Hartman , Huiquan Zhong , Kevin Hilman , NeilBrown , Mika Westerberg , Nishanth Menon , Peter Hurley , Sebastian Andrzej Siewior , Ulf Hansson , Thomas Gleixner , , , , Subject: Re: [PATCH 2/5] PM / Wakeirq: Add automated device wake IRQ handling Message-ID: <20150514155455.GE24269@saruman.tx.rr.com> Reply-To: References: <20150514020634.GB20006@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5oH/S/bF6lOfqCQb" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2768 Lines: 77 --5oH/S/bF6lOfqCQb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 14, 2015 at 11:51:10AM -0400, Alan Stern wrote: > On Wed, 13 May 2015, Felipe Balbi wrote: >=20 > > This brings up a question, actually. What to do with devices which were > > already runtime suspended when user initiated suspend-to-ram ? Do we > > leave wakeups enabled, or do we revisit device_may_wakeup() and > > conditionally runtime_resume the device, disable wakeup, and let its > > ->suspend() callback be called ? >=20 > In theory, the subsystem/device drivers already have code do this. =20 > They're supposed to, anyway. The USB host stack does it in > drivers/usb/core/driver.c:choose_wakeup(). that answers the question, specifically, this comment and piece of code do: 1395 static void choose_wakeup(struct usb_device *udev, pm_message_t msg) 1396 { [...] 1409 /* Enable remote wakeup if it is allowed, even if no interface= drivers 1410 * actually want it. 1411 */ 1412 w =3D device_may_wakeup(&udev->dev); 1413=20 1414 /* If the device is autosuspended with the wrong wakeup settin= g, 1415 * autoresume now so the setting can be changed. 1416 */ 1417 if (udev->state =3D=3D USB_STATE_SUSPENDED && w !=3D udev->do_= remote_wakeup) 1418 pm_runtime_resume(&udev->dev); 1419 udev->do_remote_wakeup =3D w; 1420 } so that's something that also needs to be taken into consideration. Thanks --=20 balbi --5oH/S/bF6lOfqCQb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVVMVPAAoJEIaOsuA1yqREkVMP/3MlisffsDInBEqJDJ0HqEBC FvVtT1ffp39F5ogbrk5oBdGr0FyOZqqNNjLU6rd+W3nVYWWxD/FXdtSJT6A/XNAe i8QZjy1t1DrDYKluyWylRdctR/eXyWtFFV/RE5S4Mz+Fd9b6NmdQY8C66y3489/N lKANIt0zlOSQEV1V6BZ7Qto4W6f4OX+fsoDlpovpXvILZskJBsxe14YtQvH5aSVY Ta/1WDz+J0QX2eyTpm2mG6OrlKMvJlNZEwgzWINl/FQCxWdjdFYjOon0HzsVgUvZ 5i+v4VF6HAEmhdKZeTkbcw5rQZHE83GFtWr9xpttCGssj9Nh3YnrYwOXyrWjONcN Ih1exf9ScTLJDCKaHQsyjkTn807hAsJHwIbpr0rCC4OuMdJoXNGkFwdwUFg8EVLr Ybwol1maOWFOOzMhnB99qiVT/St2ip4imgJZPe7wWCXe3Wj85ORx9j2jlPACeZSr o1eK6sFrydBJIBOT/ZSjELRc5ABfFCnbRt2rg+xYE/hQPyHp3t7iiDelqFoMCzye yhuSJptZIa0dwPuWaZVVE9ErBwFXgKhdPNlkv/WlNR7gqnYKjrpvaPrXBcjEKLZc QIp908id3ij4yQlM5wk8LkbjfPUQFGV6GJOXUI3gbvuafaZtcWmCZAUAyrWTqgr8 Brb0Bsn7QeyVQm4C4/9B =Dtnx -----END PGP SIGNATURE----- --5oH/S/bF6lOfqCQb-- -- 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/