PCI: pciehp: Use link change notifications for hot-plug and removal
authorRajat Jain <rajatxjain@gmail.com>
Wed, 5 Feb 2014 02:29:10 +0000 (18:29 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 11 Feb 2014 01:12:44 +0000 (18:12 -0700)
commite48f1b67f668762003e8888eccd7acb71109e874
treed8b98a5fd5c5a2ba1340558a59467f31499a971c
parent4703389f7df70518cc4ea584f3e64cb11f28aa7c
PCI: pciehp: Use link change notifications for hot-plug and removal

A lot of systems do not have the fancy buttons and LEDs, and instead
want to rely only on the Link state change events to drive the hotplug
and removal state machinery.
(http://www.spinics.net/lists/hotplug/msg05802.html)

This patch adds support for that functionality. Here are the details
about the patch itself:

* Define and use interrupt events for linkup / linkdown.

* Make the pcie_isr() also look at link events, and direct control to
  corresponding (new) link state change handler function.

* Introduce the functions to handle link-up and link-down events and
  queue the add / removal work in the slot->wq to be processed by
  pciehp_power_thread()

As a side note, this patch also fixes the bug
https://bugzilla.kernel.org/show_bug.cgi?id=65521 "pciehp ignores Data Link
Layer State Changed bit."

Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
Signed-off-by: Rajat Jain <rajatjain@juniper.net>
Signed-off-by: Guenter Roeck <groeck@juniper.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_ctrl.c
drivers/pci/hotplug/pciehp_hpc.c