Commit Graph

4 Commits (acpi-pr3)

Author SHA1 Message Date
Peter Wu fe3f58c15f bbswitch_dev: disable runtime PM on removal
Call pm_runtime_forbid() to balance it with pm_runtime_allow(), this
ensures that the runtime usage counter before loading and after
unloading match.
9 years ago
Peter Wu fb3d5a614a bbswitch_dev: use autosuspend to avoid sleeping too fast 9 years ago
Peter Wu fd774b1f5e bbswitch_dev: remove artificial delays
These delays were added as attempt to rule out the possibility that the
hardware was accessed too fast, but it does not seem to help. Remove it.
9 years ago
Peter Wu daa6411911 [DO NOT MERGE] [WIP] Add PCI driver
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
9 years ago