disable specific PCI device at boot
I’ve just reinstalled Debian on my Sony VAIO laptop, and my dmesg and virtual consoles all get spammed with the same messages over and over again.
[ 59.662381] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 59.901732] usb 1-1.2: new high-speed USB device number 91 using ehci_hcd [ 59.917940] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 60.157256] usb 1-1.2: new high-speed USB device number 92 using ehci_hcd
I believe these messages are coming from an internally connected USB device, most likely the webcam (since that’s the only thing that doesn’t work). The only way I can seem to have it shut up (without killing my actually useful USB ports) is to disable one of the USB host controllers:
# echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci_hcd/unbind
This also takes down my Bluetooth interface, but I’m fine with that. I would like this setting to persist, so that I can painlessly use my virtual console again in case I need it. I want my operating system (Debian amd64) to never wake it up, but I don’t know how to do this. I’ve tried to blacklist the module alias for the PCI device, but it seems to be ignored:
$ cat /sys/bus/pci/devices/0000\:00\:1a.0/modalias pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20 $ cat /etc/modprobe.d/blacklist blacklist pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20
How do I ensure that this specific PCI device is never automatically activated, without disabling its driver altogether? -edit- The module was renamed recently, now the following works from userland:
echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci-pci/unbind
отключить определенное устройство PCI при загрузке
Я только что переустановил Debian на своем ноутбуке Sony VAIO, и мои dmesg и виртуальные консоли снова и снова получают спам с одними и теми же сообщениями.
[ 59.662381] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 59.901732] usb 1-1.2: new high-speed USB device number 91 using ehci_hcd [ 59.917940] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 60.157256] usb 1-1.2: new high-speed USB device number 92 using ehci_hcd
Я полагаю, что эти сообщения поступают с подключенного внутри устройства USB, скорее всего, с веб-камеры (поскольку это единственное, что не работает). Единственный способ, которым я могу закрыть его (не убивая мои действительно полезные порты USB), — отключить один из хост-контроллеров USB:
# echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci_hcd/unbind
Это также снимает мой интерфейс Bluetooth, но я в порядке с этим. Я бы хотел, чтобы эта настройка сохранялась, чтобы я мог безболезненно снова использовать свою виртуальную консоль в случае необходимости. Я хочу, чтобы моя операционная система (Debian amd64) никогда не просыпалась, но я не знаю, как это сделать. Я пытался занести в черный список псевдоним модуля для устройства PCI, но, похоже, он игнорируется:
$ cat /sys/bus/pci/devices/0000\:00\:1a.0/modalias pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20 $ cat /etc/modprobe.d/blacklist blacklist pci:v00008086d00003B3Csv0000104Dsd00009071bc0Csc03i20
Как я могу гарантировать, что это конкретное устройство PCI никогда не активируется автоматически, не отключая его драйвер вообще? -edit- Модуль был недавно переименован, теперь следующие работы из пользовательского пространства:
echo "0000:00:1a.0" > /sys/bus/pci/drivers/ehci-pci/unbind
How to disable PCIe device at boot?
I’m trying to debug an issue with resuming from suspend with an NVIDIA graphics card. This thread leads me to believe it’s an issue with the audio device from the card’s HDMI out. I want to disable the device, but udev rules and kernel parameters have no effect. How can I either troubleshoot these methods not working or use another way to disable the device so that I can absolutely rule out the possibility that it’s causing my issue? sudo lspci -vv output for my device in question (irrelevant fields removed):
58:00.1 Audio device: NVIDIA Corporation Device 10fa (rev a1) Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3800 Control: (. ) Status: (. ) Latency: 0 Interrupt: pin B routed to IRQ 18 IOMMU group: 19 Region 0: Memory at 61080000 (32-bit, non-prefetchable) [size=16K] Capabilities: (. ) Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel
58:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10fa] (rev a1)
cat /etc/udev/rules.d/10-remove-nvidia-audio.rules ACTION==“add”, KERNEL=="0000:58:00.1", SUBSYSTEM=="pci", RUN="/bin/sh -c ‘echo 1 > /sys/bus/pci/devices/0000:58:00.1/remove’"
Running the RUN command manually does disconnect the device but the suspend issue still exists, and I have no way of determining whether the device is reconnected on resume ( journalctl only logs up to the suspend operation, does not log anything about resume, assuming that’s because I have to force power off to use my computer again). Is there something else I need to do to have a udev rule take effect?
pcistub=pci-stub.ids=10de:10fa
I can’t use the other method outlined in the answer I looked at, because snd_hda_intel is used for my actual audio output as well.
Any suggestions are appreciated. Thanks!
How do I turn off PCI devices?
..without turning them off in my BIOS like they are now, if possible, because then I have to restart my computer to use any of them. As it stands, I still haven’t managed to power down:
Firewire USB connection to webcam sound card
How do I tell Linux to disable and power down these devices? Is it true that any PCI slot can be physically powered down?
My current idle power consumption is 7.9 watts plus the screen. (10.0W at min. brightness)
Also, how do I set the screen timeout to ten seconds? gconf editor isn’t honoring it when I set it to that. Will switching from nVidia to Nouveau save any significant amount of power?
2 Answers 2
Try echo 0 > /sys/bus/pci/slot/$N/power for appropriate slot.
lspci -vv may help to identify the device. This is not very well documented.
There’s /sys/bus/pci/slots available on Linux 4.0.x, so it might be a type or has changed. However, there doesn’t seem to be a power file by default.
@hanshenrik this REMOVES the device from view in the OS, but does not change the P state on the actual device. Your device might still be on and consuming power, sometimes even more than when loading its driver.
Linux kernel documentation states explicitly that the sysfs pci ‘remove’ file «does not involve any kind of hot-plug functionality, e.g. powering off the device» kernel.org/doc/Documentation/filesystems/sysfs-pci.txt
I could be wrong (if you think I am, just leave a comment) but I always thought that things that were plugged in (or soldered on, as is the case in most laptops) are always «on» and available unless disabled in the BIOS.
However most of these devices will only be using significant power when they’re actively being used. The only real exception to this is wireless but you have a hardware switch for this. USB ports also power their plugees so you need to unplug USB things but that doesn’t sound like an unreasonable request.
You can, of course, unload certain kernel modules which stops software having access to hardware but I doubt this would turn them off.
You use the word ‘significant’ and ‘reasonable’ but in my case, 1.3 watts mean one whole hour of battery life. And I need that hour, so I need those 1.3 watts.
If I can confirm that it is not physically possible I will stop pursuing it. but I’d prefer not to give up prematurely. Does the bios have access to hardware features that the operating system does not?
If hardware can be turned of (not just disabled) by BIOS it means that any software can do the same — however this might mean low-level memory manipulation if it is not supported via the standard ACPI interface for doing those things — there is multiple kernel modules available for such things for HP and Asus machines — however they are not always bug free to say the least.