From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754883AbcEQH4q (ORCPT ); Tue, 17 May 2016 03:56:46 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:36731 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbcEQH4o (ORCPT ); Tue, 17 May 2016 03:56:44 -0400 MIME-Version: 1.0 In-Reply-To: <871t56qg67.fsf@linux.intel.com> References: <4d6528e4b742cacf34f384b766a7c3296dfe9dbf.1463134786.git.baolin.wang@linaro.org> <87oa8aqlzh.fsf@linux.intel.com> <87d1oqqhvs.fsf@linux.intel.com> <871t56qg67.fsf@linux.intel.com> Date: Tue, 17 May 2016 15:56:43 +0800 Message-ID: Subject: Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on From: Baolin Wang To: Felipe Balbi Cc: Greg KH , Mark Brown , USB , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Felipe, On 13 May 2016 at 20:46, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>> >>>> Because when the dwc3 Vbus is off (no cable pluging in now), >>>> especially for some mobile device, the system need to power off the >>>> dwc3 to save power in this situation. >>> >>> but dwc3 doesn't do this by itself, so who's doing it? >> >> Yes, the dwc3 clock is controlled by the Soc system, so the Soc system >> can disable the dwc3 clock when there is no cable plugging in. > > understood. > >>>>> This looks like a *really* bad power management implementation. Do you >>>>> have hibernation enabled? Do you have Clock gating enabled? Which dwc3 >>>>> version are you using? How was it configured? >>>> >>>> This is not hibernation, we want to power off the dwc3 to save power >>>> when no cable plugging in. Yes, we have clock gating, at this >>>> situation we will disable the clock and shutdown the phy to save >>>> power. For mobile device, most time no cable plugging in, so we need >>>> to think about the power consuming. How do you think this requirement? >>> >>> Well, seems like you're missing *proper* runtime PM. I've been meaning >>> to work on it for weeks, but I still have a few other things to do >>> before I get to that. In any case, we don't need to do what you did >>> here. There are better ways. >> >> Make sense. > > cool, if you wanna work on it, let me know and I can give some details > of what I have in mind. Could you explain details to me, and I wanna continue to optimize the power management things. Thanks. > > -- > balbi -- Baolin.wang Best Regards