All of lore.kernel.org
 help / color / mirror / Atom feed
* port power is on again after turning off by user space
@ 2020-12-15  3:31 Peter Chen
  2020-12-15  5:02 ` Jun Li
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Chen @ 2020-12-15  3:31 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-usb

Hi Alan,

I use one HUB power control application (https://github.com/mvp/uhubctl) to investigate power switchable HUB, and
find the kernel turns port power on again at drivers/usb/core/hub.c, after port power is turned off by user space.

5122                 if (hub_is_port_power_switchable(hub)
5123                                 && !port_is_power_on(hub, portstatus)
5124                                 && !port_dev->port_owner)
5125                         set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);

The main sequence for testing turn port power off like below:

- uhubctl sends command to turn specifc port (eg, 2-1.4) power off.
- devio at kernel gets that command, and send to hub.
- port power is off, the hub_event is triggered due to port status is changed.
- usb_disconnect is called, but port power is on again by kernel at function hub_port_connect.

I can't find the code history why the port power needs to turn on after device is disconnected, do you know why?
Any sugguestions to fix it? Thanks.

Best regards,
Peter Chen
 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-12-22  2:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15  3:31 port power is on again after turning off by user space Peter Chen
2020-12-15  5:02 ` Jun Li
2020-12-15  5:14   ` Peter Chen
2020-12-15  9:57     ` Peter Chen
2020-12-15 15:55       ` Alan Stern
2020-12-16  2:56         ` Peter Chen
2020-12-16 15:51           ` Alan Stern
2020-12-21  5:37             ` Peter Chen
2020-12-21 16:25               ` Alan Stern
2020-12-22  2:02                 ` Peter Chen
2020-12-22  2:35                   ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.