This is work in progress, I intend to merge the bbswitch_dev code into
the main module. Some comments in README and bbswitch.c might be stale.
Create a PCI driver such that runtime PM works. Without a bound driver,
the kernel assumes that the device is D0 state during suspend (which
therefore needs the notifier hack in bbswitch) but more importantly, it
will prevent the PCIe port from going to sleep in Linux v4.7.
Currently I use this to debug an infinite loop on my Clevo P651RA
laptop, it can be loaded as follows:
make modname=bbswitch_dev
insmod bbswitch_dev.ko
echo > /sys/bus/pci/drivers/bbswitch/new_id 10de 13d9
Needs Mika's pci/pm series ("PCI: Put PCIe ports into D3 during
suspend"), qeued for v4.7 via
https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?h=pci/pm
The Optimus _DSM function would prepare a device to be put in D3cold
state when _PS3 is called. Newer laptops should not use this since
Windows 8 introduced a new method to put devices in D3cold state[1].
Hopefully this fixes an infinite loop on a Clevo P651RA. Actually
putting the parent device (PCIe port) is not done in this patch.
[1]: https://msdn.microsoft.com/windows/hardware/drivers/bringup/firmware-requirements-for-d3cold
2016-05-13 21:35:54 +02:00
Proudly self-hosted by Cole Deck. Fast loading powered by Turbo.