From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752969AbcEMMLj (ORCPT ); Fri, 13 May 2016 08:11:39 -0400 Received: from mga02.intel.com ([134.134.136.20]:30868 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752058AbcEMMLi (ORCPT ); Fri, 13 May 2016 08:11:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,614,1455004800"; d="asc'?scan'208";a="979738677" From: Felipe Balbi To: Baolin Wang Cc: Greg KH , Mark Brown , USB , LKML Subject: Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on In-Reply-To: References: <4d6528e4b742cacf34f384b766a7c3296dfe9dbf.1463134786.git.baolin.wang@linaro.org> <87oa8aqlzh.fsf@linux.intel.com> User-Agent: Notmuch/0.22+11~g124a67e (http://notmuchmail.org) Emacs/25.0.93.2 (x86_64-pc-linux-gnu) Date: Fri, 13 May 2016 15:09:27 +0300 Message-ID: <87d1oqqhvs.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Baolin Wang writes: >>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>> index 6254b2f..dada5c6 100644 >>> --- a/drivers/usb/dwc3/core.h >>> +++ b/drivers/usb/dwc3/core.h >>> @@ -734,6 +734,9 @@ struct dwc3_scratchpad_array { >>> * 1 - -3.5dB de-emphasis >>> * 2 - No de-emphasis >>> * 3 - Reserved >>> + * @can_save_power: set if the gadget will power off when no cable plu= g in. >> >> nope >> >>> + * @need_restart: set if we need to restart the gadget. >> >> 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? >> 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. >> Anyway, which platform are you dealing with? Why is dwc3 off while VBUS >> is off? How do you handle host mode? > > On Spreadtrum platform, for thinking about some mobile devices with I meant the SoC ;-) It's their own SoC? Are we getting glue-layer patches any time soon? > strict power management. This is just for gadget mode, we don't power > off the dwc3 when it is host mode. Thanks. okay, thanks =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXNcP3AAoJEIaOsuA1yqREygAQAKA1G30vi4o+jePdsCFLHjUl adPb5vcSb+Q+Dcd5VwT5exUKhGLdwOuwKhXYmd2+YH7AKzvgDNkeUsRigI4zr0A5 nulECapLYSvT8Ri5lWUBM52P1n9SBNudoLeJcWtasCilzAUrGkewLmaurVqhMAHP x5GE/mBIeNNE6TL+ufBpz8AJ1HMPT2wC4FzGv+bJvaNxaBZk9mhjo3QN2bJqDed1 HSCABbuFGoXEXiTlBWkgEYzUNzAGkkgHi1ucLpiwGFgOKXSghtrsylvedfcIW01n rXJ+T5JoSJWDhuMvjCFwqvtxftpYMMuEP4r9M51bjoVuvBb7uyRdHECzd77LcNXM Yc2LasKGPVAWAMAfSZi09joBD1i1s3x2tCllfFRb228iRJHsTVOaQV5qmr1To26R k0vxppq1l1OYPzlA4Jfjuff7uHVaQ8M6QyLD0Gattv6eLj4RUD6jEtXVG0AFPzcg MIu7CaQUPbOq0YHEmtTSNlB+VVWy5lzBc/JF0elXQ0staQeydfjExI9oyWIqAIn4 58RW5uWjKPyocfGMD8phprOjWUvNhLcY6YqTe0LkVuFYkkttvzDT6Mdc24qzpeDG hILhLNodPw3REDR1oHNWInS3oStMAHLZXxvuucUBGkoQCVIEInkgioYojmzmzjh/ S3ocoV8TVCuueHnbeOBM =0F8o -----END PGP SIGNATURE----- --=-=-=--