Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751644AbdFIOuH (ORCPT ); Fri, 9 Jun 2017 10:50:07 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:59604 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751527AbdFIOsm (ORCPT ); Fri, 9 Jun 2017 10:48:42 -0400 Date: Fri, 9 Jun 2017 10:48:41 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Yueyao Zhu cc: Jiri Kosina , Benjamin Tissoires , Greg Kroah-Hartman , Jaroslav Kysela , Takashi Iwai , , , , Andrew Chant , Badhri Jagan Sridharan , Dmitry Torokhov , Yueyao Zhu Subject: Re: [PATCH 0/3] USB: add API for interface driver to vote for autosuspend In-Reply-To: <20170608215828.130455-1-yueyao.zhu@gmail.com> 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: 1148 Lines: 26 On Thu, 8 Jun 2017, Yueyao Zhu wrote: > From: Yueyao Zhu > > Currently, if a USB driver would like to enable autosuspend on the USB > device, usb_enable_autosuspend() seems to be the only option. However, > this acts on the device level, and other interfaces might not desire > to autosuspend the USB device. > > For example, for the usb digital audio driver to enable autosuspend on > a device, calling usb_enable_autosuspend() from the interface driver > might not be a good idea as the USB device might have a keyboard HID > interface which generally doesn't handle autosupend very well. > > This patch series introduces an API for interface driver to vote > for autosuspend on the interface, and when all interfaces agree to > it, autosuspend can then be enabled on the usb device. The whole idea of this seems questionable. USB interface drivers are generally not supposed to enable or disable autosuspend -- that is a policy decision left up to userspace. There are a few exceptions for things like hubs, but this is generally true. Why should the USB digital audio driver want to enable autosuspend? Alan Stern