Last active
March 23, 2024 21:26
-
-
Save janmisek/4f156d0a6122b6d0c74f5843cf19f388 to your computer and use it in GitHub Desktop.
PCI and USB power management in linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If usb hdd is made sleeping using hdparm or unbind. The usb device still consumes about 1W. | |
# This power consumtpion could be spared removing whole usb hub from pci bus | |
# Make sleep using hdparm | |
########################################## | |
hdparm -y /dev/sdb | |
# Connect / disconnect usb device | |
########################################### | |
# list device | |
lsusb -t | |
# unbind device | |
echo '2-3' | sudo tee /sys/bus/usb/drivers/usb/unbind | |
# rebind device | |
echo '2-3' | sudo tee /sys/bus/usb/drivers/usb/bind | |
# remove/rescan pci device - whole usb hub | |
########################################### | |
# Sideeffect is that whole usb hub is sleeping | |
#list devices | |
lspci -t | |
#disable | |
echo 1 | sudo tee /sys/devices/pci0000\:00/0000\:00\:14.0/remove | |
# reenable | |
echo 1 | sudo tee /sys/bus/pci/devices/0000\:00\:00.0/rescan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment