lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMz4kuJjxXOdh61kHgjR0hxS3bEdnugdEwnf0RVdia2RnjXv9Q@mail.gmail.com>
Date:	Tue, 17 May 2016 16:45:01 +0800
From:	Baolin Wang <baolin.wang@...aro.org>
To:	Felipe Balbi <balbi@...nel.org>
Cc:	Greg KH <gregkh@...uxfoundation.org>,
	Mark Brown <broonie@...nel.org>,
	USB <linux-usb@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dwc3: gadget: Defer starting the gadget device until
 gadget is power on

On 17 May 2016 at 16:00, Felipe Balbi <balbi@...nel.org> wrote:
>
> Hi
>
> Baolin Wang <baolin.wang@...aro.org> writes:
>> Hi Felipe,
>>
>> On 13 May 2016 at 20:46, Felipe Balbi <balbi@...nel.org> wrote:
>>>
>>> Hi,
>>>
>>> Baolin Wang <baolin.wang@...aro.org> 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.
>
> I have it half-way done. Have a look at my dwc3-fix-suspend branch on
> k.org. I haven't sent because I'm not getting a PME event. Can you test
> on your end and let me know what happens?

OK. I try to test on my platform to see what will happen.

>
> Note that if cable is disconnected, we will drop RUN/STOP bit. On
> runtime_resume, we will restart the controller from scratch (skipping
> memory allocations, of course)
>
> --
> balbi



-- 
Baolin.wang
Best Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ