power reset by cli

 

 


 

lsusb

Bus 004 Device 002: ID 152d:9561 JMicron Technology Corp. / JMicron USA Technology Corp. JMS56x Series

lsusb -t

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M

dmesg | grep usb | tail -n 20

[283231.776989] usb 4-1: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[283231.799859] usb 4-1: New USB device found, idVendor=152d, idProduct=9561, bcdDevice= 1.02
[283231.799864] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[283231.799865] usb 4-1: Product: JMS56x Series
[283231.799867] usb 4-1: Manufacturer: JMicron
[283231.799868] usb 4-1: SerialNumber: 00000000000000000000

1. verify hub info.

cd /sys/bus/usb/drivers/usb

ls

usb4 -> ../../../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb4/
4-1 -> ../../../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb4/4-1/

cat 4-1/idVendor          # 152d

cat 4-1/idProduct         # 9561

2.To turn off power on all USB ports of a hub

echo "4-1" > unbind

3. To turn power back on - you may bind it back using

 

情況2

lsusb -t

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 4: Dev 8, If 0, Class=Mass Storage, Driver=uas, 480M
        |__ Port 6: Dev 9, If 0, Class=Hub, Driver=hub/6p, 480M

ls /sys/bus/usb/drivers/usb

lrwxrwxrwx 1 root root    0 Jun  9 13:25 1-1 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1
lrwxrwxrwx 1 root root    0 Jun  9 13:25 1-1.4 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4
lrwxrwxrwx 1 root root    0 Jun  9 13:25 1-1.6 -> ../../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6

# reset Hub 上其中一個 device, "1-1.4" 的 soft-link 會消失

echo "1-1.4" > unbind

# 成隻 Hub reset, "1-1", "1-1.4", "1-1.6" 的 soft-link 會消失

echo "1-1" > unbind