Re: [RFC PATCH 0/1] hibernate and roothub port power

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8.6.2022 11.19, Oliver Neukum wrote:


On 07.06.22 15:58, Mathias Nyman wrote:

Hi,

In shutdown (S5), with xHCI as host, this can be solved fairly easily
by turning off roothub port power in the .shutdown path.

That would suck for the people who charge their phone from their
computer.

Good point.
My guess is that xHC port power bits won't actually turn off VBus for those
Sleep-and-charge, or Always-on ports.
VBus is allowed to be on even if port is in power-off state, but usb link state
should be forced to ss.Disabled from other states, like U3.

Need to try it out, it's possible this turns off VBus for some usb-A ports
on some older systems that earlier (accidentally?) supplied VBus on
"normal" ports after shutdown.


This is discussed in xhci spec 4.19.4 for driver unload:
"Before the xHC driver is unloaded, the driver should clear the
Port Power (PP) flag of all Root Hub ports to place them into
the Disabled state and reduce port power consumption."

Yes, you could say that the standard calls for this.

But I can't come up with a better solution, so this RFC patch
does exactly that. It turns off port power for xHC roothub ports
in the hibernate poweroff_late stage, but only if the host isn't set
to wake up the system from S4.

In general this looks like the sane strategy.
However, what will this do if the port is in an alternate mode
or if this is the port the system's battery is to be charged through?

I have to double check this, but my understanding is that xHC port power bits
don't have any impact here. These cases are handled by other parts like the
power delivery controller before the connector may even be muxed to a xHC.
Most likely turning off xHC port power bits here will only force a connected
usb device link state to ss.Disabled (or usb2 equivalent state).

Thanks for the feedback

-Mathias



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux