Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751008AbWJESZa (ORCPT ); Thu, 5 Oct 2006 14:25:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751493AbWJESYt (ORCPT ); Thu, 5 Oct 2006 14:24:49 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:32779 "HELO iolanthe.rowland.org") by vger.kernel.org with SMTP id S1751008AbWJESYV (ORCPT ); Thu, 5 Oct 2006 14:24:21 -0400 Date: Thu, 5 Oct 2006 14:24:19 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Pavel Machek , , Subject: Re: [linux-usb-devel] error to be returned while suspended In-Reply-To: <200610051835.21704.oliver@neukum.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1757 Lines: 41 On Thu, 5 Oct 2006, Oliver Neukum wrote: > Am Donnerstag, 5. Oktober 2006 18:21 schrieb Alan Stern: > > Currently we don't have any userspace APIs for such a daemon to use. ?The > > only existing API is deprecated and will go away soon. > > I trust it'll be replaced. Yes. I think Greg wants to wait until the old API is completely gone. > > Current thinking is that a driver will suspend its device whenever the > > device isn't in use. ?With usblp, that would be whenever the device file > > isn't open. ?See the example code in usb-skeleton.c. > > In the general case the idea seems insufficient. If I close my laptop's lid > I want all input devices suspended, whether the corresponding files are > opened or not. In fact, if I have port level power control I might even > want to cut power to them. That's a separate issue. You were talking about runtime suspend, but closing the laptop's lid is a system suspend. Assuming some sort of mechanism is in place to do a suspend-to-RAM or suspend-to-disk when the lid is closed, the driver's suspend and resume methods will be called in the normal way. The driver doesn't need to do anything special to accomodate it. The only special thing you need to do is autosuspend when the device isn't in use, so that even when the laptop's lid is open you can still avoid using unnecessary power. Alan Stern P.S.: Cutting off port power is yet another issue. It isn't a suspend in the strict sense, because it will break an existing power session. - 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/