Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933774AbZJHVbs (ORCPT ); Thu, 8 Oct 2009 17:31:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933727AbZJHVbq (ORCPT ); Thu, 8 Oct 2009 17:31:46 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:44054 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932675AbZJHVbo (ORCPT ); Thu, 8 Oct 2009 17:31:44 -0400 Date: Thu, 8 Oct 2009 17:31:07 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Alan Cox , Greg KH , Kernel development list , USB list Subject: Re: [PATCH 4/5] usb_serial: Kill port mutex In-Reply-To: <200910082240.36607.oliver@neukum.org> 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: 1525 Lines: 34 On Thu, 8 Oct 2009, Oliver Neukum wrote: > Am Donnerstag, 8. Oktober 2009 22:06:10 schrieb Alan Stern: > > > > > On further thought, unthrottle should autoresume if the device is > > open and autosuspended (but it shouldn't do anything if the device is > > suspended). After all, the reason for the autosuspend may have been > > the lack of activity caused by the throttling. > > > > In practice this isn't likely to come up. It would be surprising if > > throttling lasted long enough to cause an autosuspend or if the core > > decided to throttle while the device was autosuspended and hence idle. > > So you say that throttle() should do an autopm_put? The way you've coded the sierra and option drivers, it's not necessary. Those drivers do an autopm_get_async during submission and an autopm_put_async after the completion of every output URB (and they update the last_busy time in the completion of every input URB). When the driver is throttled no URBs will be submitted, so the usage count will remain at 0 with no effort on the part of throttle(). For other drivers that use the simpler "autoresume on tty install, autosuspend on tty cleanup" approach provided by usb-serial.c, the throttle routines obviously don't need to worry about runtime PM. 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/