Re: [PATCH RFC] usb: dwc2: power off during shutdown

From: Minas Harutyunyan
Date: Thu Sep 06 2018 - 02:33:14 EST


Hi Stefan,

On 9/5/2018 10:42 PM, Stefan Wahren wrote:
> Hi Minas,
>
>> Minas Harutyunyan <Minas.Harutyunyan@xxxxxxxxxxxx> hat am 5. September 2018 um 10:37 geschrieben:
>>
>>
>> Hi Stefan,
>>
>> On 9/1/2018 1:55 PM, Stefan Wahren wrote:
>>> Currently USB consumes a lot of power after shutting down a Raspberry Pi 3
>>> (example setup with Ethernet and a keyboard connected). So power off
>>> USB on shutdown.
>>>
>>> Measured on Raspberry Pi 3B with 4.19rc1/multi_v7_defconfig (HDMI, Ethernet
>>> and a keyboard connected)
>>>
>>> Before patch: 2.450 W
>>> After patch: 2.090 W
>>>
>>
>> Could you please elaborate. Power measurements done after shutdown?
>
> I did the following:
>
> sudo halt
> wait until "System halted" appears on the screen
> "measured" the current value displayed on my PSU
>
> You are right that not the same as poweroff. But in even in poweroff the board consumes 0.6 W, but in this case USB is powered down.
>
>> Why
>> your setup continue consume power after shutdown?
>
> The BCM2835 SoC has a GPU and a ARM core. Linux is running only on the ARM core. The GPU is usually running a close source firmware, which is started at first during boot und runs all the time.
>
>> Maybe its
>> sleep/hibernation mode?
>
> There isn't much implementation of power management for BCM2835 yet. So i wanted to start with USB.
> Even for sleep/hibernation the consumption is much too high. Because the system consumes in idle 1.6 W.
>
>>
>> dwc2 core in your platform which type of power optimization supports:
>> partial power down, hibernation or extended hibernation? Please provide
>> me GHWCFG4 register value of your core.
>
> AFAIK all RPis use the same USB IP core:
>
> GHWCFG4 = 0x1ff00020

Ok, your core doesn't support any power optimization mode.


>
> Stefan
>

1. Could you please explain what is real/physical cause of power saving
after your patch: VBUS off, PHY clock stop or any other?
2. Can USB detect remote wake-up signaling from connected
keyboard/ethernet before and after your patch?

Thanks,
Minas