Cannot put card in D3 state after loading and then unloading the nvidia kernel driver (driver versio

I am trying to fix a non-working bumblebee on recent thinkpads (ThinkPad T440p,
Lenovo UEFI firmward revision 2.28).

I’ve managed to get some power savings when not using the card. This hinges on
the possibility to put the card in PCI D3 state, which works fine until the
nvidia kernel module gets loaded and then unloaded.

After that, trying to put the card in D3 yields

pci 0000:02:00.0: Refused to change power state, currently in D0

And lspci indeed reports that the card is still in D0. Looking at the kernel
code, this message is displayed when the kernel really tries to put the card in
D3 if the card does not switch, i.e. at the point where the PCI config space is


for my last related comment on a long long thread of issues on this machine.

I am attaching the logs generated by using the nvidia driver v340, after the following scenario (in a booted Xorg as requested by the permapost on how to report bugs, but symptoms can be reproduced without X)

1 - just after boot, using the intel card as primary card. bbswitch is unloaded at this point to avoid interference.
2 - after loading the nvidia kernel module
3 - after unloading the nvidia kernel module
4 - after switching the card to D3 and then back to D0 using bbswitch (at this point, it works !)
5 - after loading the nvidia kernel module
6 - after unloading the nvidia kernel module
7 - after a failed attempt to switch the card to D3 using bbswitch

1-after-boot.log.gz (50.3 KB)
2-after-loading.gz (51.8 KB)
3-after-unloading.gz (50.6 KB)
4-after-off-on-cycle.gz (51 KB)
5-after-loading.gz (52.3 KB)
6-after-unloading.gz (51.2 KB)
7-failed-attempt-to-off.gz (51.2 KB)