port power is on again after turning off by user space

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

 



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
 





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

  Powered by Linux