Re: Discrete Nvidia GPU shutdown with recent kernel / BIOS (on T440s laptop) - Should be automatic with runtime pm now ?
From: Sylvain Munaut <hidden>
Date: 2015-07-22 06:15:22
Also in:
linux-acpi
Hi Alan, Thanks for the details.
quoted
tl;dr : Should device allowed to do runtime pm that have no driver go to D3 on their own ?Quick answer: See the comments at the start of local_pci_probe() in drivers/pci/pci-driver.c. PCI devices without a kernel driver are always left in D0, regardless of the runtime PM status. This is because userspace may try to use the device, and the kernel wouldn't know to take the device out of D3 when that happens.
Does linux expose some way for userspace to transition the device to another power state without the need for a driver ? I looked at the docs and tried poking some of the sysfs files, but except enabling/disabling the runtme pm, I couldn't really change anything, but maybe I missed something.
quoted
And should pci root bridge go to D3 when all the device on them are on D3 ?I don't know the answer to that. It's probably closely related to the issue of whether PCI bridges need to have a kernel driver.
OK. Do you know if there could be any adverse effect of transitioning it myself ? Basically I'm doing this when turning off the card : struct pci_dev *port_dev = pci_upstream_bridge(pdev); pci_save_state(port_dev); pci_clear_master(port_dev); pci_disable_device(port_dev); pci_set_power_state(port_dev, PCI_D3hot); And this when waking it up : pci_set_power_state(port_dev, PCI_D0); pci_restore_state(port_dev); pci_enable_device(port_dev); pci_set_master(port_dev); (I removed the return value checking to make the code more concise here). Cheers, Sylvain