Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Disable PCI-E device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Belliash
Advocate
Advocate


Joined: 24 Nov 2004
Posts: 2455
Location: Wroclaw, Poland

PostPosted: Fri Jul 26, 2019 5:24 pm    Post subject: Disable PCI-E device Reply with quote

Hello,

Could you tell me how an I completely turn off a PCI-E device and turn it on again?
I have mostly unused device that I would like to turn off to save energy and turn it on only when I need it. Can this be done via ACPI? I found acpi_call, but I cannot find a way to use it with my card. Seems its dedicated to use with DGPU on laptops, or at least I have not found other commands or the way to get a list of available commands...
_________________
Asio Software Technologies
Belliash IT Weblog
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1990
Location: Frankfurt, Germany

PostPosted: Fri Jul 26, 2019 5:39 pm    Post subject: Reply with quote

Does this help? https://stackoverflow.com/questions/4117465/can-i-completely-disable-a-pci-slot-in-linux
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4402
Location: Dallas area

PostPosted: Fri Jul 26, 2019 5:44 pm    Post subject: Reply with quote

You can "disable" the device, as far as linux is concerned,
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6351

PostPosted: Fri Jul 26, 2019 6:36 pm    Post subject: Reply with quote

If you build the driver as a kernel module and then unload it, it should automatically put the device into power saving mode.
Back to top
View user's profile Send private message
Belliash
Advocate
Advocate


Joined: 24 Nov 2004
Posts: 2455
Location: Wroclaw, Poland

PostPosted: Fri Jul 26, 2019 6:42 pm    Post subject: Reply with quote

Ant P. wrote:
If you build the driver as a kernel module and then unload it, it should automatically put the device into power saving mode.


How can I check if device is in power saving mode?
_________________
Asio Software Technologies
Belliash IT Weblog
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1990
Location: Frankfurt, Germany

PostPosted: Fri Jul 26, 2019 7:00 pm    Post subject: Reply with quote

Anon-E-moose wrote:
You can "disable" the device, as far as linux is concerned,

Is there a generic way to disable any arbitrary device on the PCI bus?

Ant. P wrote:
If you build the driver as a kernel module and then unload it, it should automatically put the device into power saving mode.

Is that true?

I ask, because I have a notebook with an nVidia graphics controller. I don't need the nVidia graphics controller and I don't want it. I use bbswitch to disable it. As soon as I run bbswitch to turn the nVidia graphics controller off, power consumption of my notebook goes down by 4 Watts, which is more than welcome.

But it's not sufficient to 'not load' or to 'unload' the Nvidia graphics module to reach this low power consumption state. I really have to turn the nVidia graphics controller off using bbswitch.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4402
Location: Dallas area

PostPosted: Fri Jul 26, 2019 7:14 pm    Post subject: Reply with quote

mike155 wrote:
Anon-E-moose wrote:
You can "disable" the device, as far as linux is concerned,

Is there a generic way to disable an arbitary device on the PCI bus?


It depends on the device, you'd have to look in /sys find the device and see if there's an entry for it to manipulate, could be called disable or enable or something else. Naming between devices is not consistent.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6351

PostPosted: Fri Jul 26, 2019 8:30 pm    Post subject: Reply with quote

Belliash wrote:
Ant P. wrote:
If you build the driver as a kernel module and then unload it, it should automatically put the device into power saving mode.


How can I check if device is in power saving mode?

It'll usually print something in dmesg about disconnecting the PCIe device. It's possible it might not, depends entirely on the driver to implement it correctly.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5908

PostPosted: Fri Jul 26, 2019 8:44 pm    Post subject: Reply with quote

afaik you can also disable pcie slots in the efi/bios, if your bios isn't completely stripped down (like on some laptops)
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5438

PostPosted: Sat Jul 27, 2019 8:21 am    Post subject: Reply with quote

you can try via sysfs, see:
Code:

dagg@NCC-5001D ~ $ ll /sys/devices/pci0000\:00/0000\:00\:03.0/enable
-rw-r--r-- 1 root root 4096 Jul 27 11:20 /sys/devices/pci0000:00/0000:00:03.0/enable
dagg@NCC-5001D ~ $ lspci | grep 03:00.0
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 16)


just run echo 0 > /sys/devices/pci0000\:00/0000\:00\:03.0/enable
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum