public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Mark Brown <broonie@kernel.org>, USB <linux-usb@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on
Date: Fri, 13 May 2016 15:09:27 +0300	[thread overview]
Message-ID: <87d1oqqhvs.fsf@linux.intel.com> (raw)
In-Reply-To: <CAMz4kuKO9zRT-G4APPba5YpYxgmPHDR01EX0SJpseKg958UVUw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]


Hi,

Baolin Wang <baolin.wang@linaro.org> 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 plug 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

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2016-05-13 12:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 10:24 [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Baolin Wang
2016-05-13 10:40 ` Felipe Balbi
2016-05-13 11:34   ` Baolin Wang
2016-05-13 12:09     ` Felipe Balbi [this message]
2016-05-13 12:35       ` Baolin Wang
2016-05-13 12:46         ` Felipe Balbi
2016-05-15  5:24           ` Baolin Wang
2016-05-17  7:56           ` Baolin Wang
2016-05-17  8:00             ` Felipe Balbi
2016-05-17  8:45               ` Baolin Wang
2016-05-17  9:25                 ` Felipe Balbi
2016-05-17 10:47                   ` Baolin Wang
2016-05-18  9:59                     ` Baolin Wang
2016-05-18 10:12                       ` Felipe Balbi
2016-05-18 10:17                         ` Baolin Wang
2016-05-18 10:22                           ` Felipe Balbi
2016-05-18 11:06                             ` Baolin Wang
2016-05-18 11:21                               ` Felipe Balbi
2016-05-18 11:26                                 ` Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1oqqhvs.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox