Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1400756

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on
Date 2016-05-13 14:20 +0200
Message-ID <rykeu-343-23@gated-at.bofh.it> (permalink)
References <ryiw2-1pE-13@gated-at.bofh.it> <ryiPo-1yp-9@gated-at.bofh.it> <ryjBM-2nm-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-13 12:30 +0200
  Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-13 12:50 +0200
    Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-13 13:40 +0200
      Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-13 14:20 +0200
        Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-13 14:40 +0200
          Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-13 14:50 +0200
            Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-16 04:10 +0200
            Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-17 10:00 +0200
              Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-17 10:10 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-17 10:50 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-17 11:30 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-17 12:50 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-18 12:00 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-18 12:20 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-18 12:20 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-18 12:30 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-18 13:10 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until  gadget is power on Baolin Wang <baolin.wang@linaro.org> - 2016-05-18 13:30 +0200
                Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on Felipe Balbi <balbi@kernel.org> - 2016-05-18 13:30 +0200

csiph-web