PCI: pciehp: Don't re-read Slot Status when queuing hotplug event
authorMayurkumar Patel <mayurkumar.patel@intel.com>
Fri, 9 Sep 2016 14:10:17 +0000 (09:10 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 14 Sep 2016 19:24:40 +0000 (14:24 -0500)
commit0c923d1da394b96727b813d1e64412b72f1dc580
tree7a023b2ba1d8efbbb9a57c97ec40ff9a65a662d4
parentfad214b0aa726ee21adcac4308d388efcb89d6bd
PCI: pciehp: Don't re-read Slot Status when queuing hotplug event

Previously we read Slot Status to learn about hotplug events, then cleared
the events, then re-read Slot Status to find out what happened.  But Slot
Status might have changed before the second read.

Capture the Slot Status once before clearing the events.  Also capture the
Link Status if we had a link status change.

[bhelgaas: changelog, split to separate patch]
Tested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mayurkumar Patel <mayurkumar.patel@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pci/hotplug/pciehp_hpc.c