Skip to content
TheChatArchiveThe Chat Archive
Perplexitysonar· PerplexityHugging Face LMArena Search Arena 24K

How do I power cycle a usb port on Fedora? I want to turn off power for a specific USB…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.0-flash-grounding’s answer.
  1. User

    How do I power cycle a usb port on Fedora? I want to turn off power for a specific USB port and then enable it again.

  2. Perplexity Assistant

    To power cycle a specific USB port on Fedora, use these methods:


    1. Using hub-ctrl Utility

    For USB hubs with power control capabilities:

    # Install hub-ctrl (compile from source if not available)
    sudo ./hub-ctrl -B <bus> -D <device> -P <port> -p 0  # Disable power
    sudo ./hub-ctrl -B <bus> -D <device> -P <port> -p 1  # Enable power
    

    Identify <bus>, <device>, and <port> using lsusb or usb-devices[1].


    2. Direct Kernel Power Control

    Manipulate the power/control file for the USB device:

    # Find the device path (e.g., /sys/bus/usb/devices/3-1)
    echo "0" &gt; /sys/bus/usb/devices/<device>/power/control  # Disable
    echo "1" &gt; /sys/bus/usb/devices/<device>/power/control  # Enable
    

    Use lsusb -t to locate the device path[1][6].


    3. Disable USB Device via udev

    Create a script to disable/enable devices by vendor/product ID:

    # Example script (requires root)
    #!/bin/bash
    echo "0" &gt; /sys/bus/usb/devices/<device>/authorized  # Disable
    echo "1" &gt; /sys/bus/usb/devices/<device>/authorized  # Enable
    

    Identify <device> using lsusb and usb-devices[2][6].


    4. Reset USB Controller (Advanced)

    For persistent issues, reset the entire USB stack:

    # Find USB controller PCI address
    DEVICE=$(lspci -Dm | grep "USB controller" | cut -f1 -d' ')
    
    # Unbind and rebind
    echo "$DEVICE" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
    echo "$DEVICE" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind
    

    This resets all USB ports[5].


    Note: For Fedora-specific issues like periodic USB disablement, check power management tools like powertop or disable TLP if installed[3][7].

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.