From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754789AbcHVJFB (ORCPT ); Mon, 22 Aug 2016 05:05:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:52272 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765AbcHVJFA (ORCPT ); Mon, 22 Aug 2016 05:05:00 -0400 Message-ID: <1471856696.17783.6.camel@suse.com> Subject: Re: How the EHCI HC driver make the decision to suspend some USB devices? From: Oliver Neukum To: Alan Stern Cc: ludeng , Lipengcheng , "Device ChipSet) Zhangzhenxing (Christian" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Date: Mon, 22 Aug 2016 11:04:56 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-08-19 at 10:16 -0400, Alan Stern wrote: > On Fri, 19 Aug 2016, ludeng wrote: > > > Hi, > > How the EHCI HC driver make the decision to suspend some USB devices, > > but not to suspend some others? We notice that for some USB Video > > Cameras, when they are enumerated and there is no data to transfer, > > the EHCI HC driver will suspend them by setting the Suspend bit of > > the PORTSC register. But for some other Cameras, the EHCI HC driver > > will not suspend them. The drvier make the decision based on what > > kind of information of the device ? > > The EHCI driver does not make this decision. The decision is made by > the video camera driver and by the user. And the driver core in case of devices with multiple interfaces. But I guess, the question is also about how, not where the decision is made. Runtime suspend will be used if 1) every interface's driver has declared a) it supports autosuspend b) its interface is idle 2) every bus connected to an interface [SCSI] has only suspended devices 3) the requirements for remote wakeup are met on every interface. That means, either a) remote wakeup is not requested b) remote wakeup is requested and I) the device supports it II) the RESET_RESUME quirk is not set for the device 4) it is enabled in sysfs HTH Oliver