]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: pciehp: Track enable/disable status
authorLukas Wunner <lukas@wunner.de>
Thu, 19 Jul 2018 22:27:45 +0000 (17:27 -0500)
committerBjorn Helgaas <helgaas@kernel.org>
Mon, 23 Jul 2018 22:04:14 +0000 (17:04 -0500)
commit13e3695c7647c3649959a33fd5e9dac0ecacff8a
treeeabe29fdb92fcb3b936c0ef513eb07a904390c84
parentad9a2c34028e4f7215225b785d9f3d6c5713c61d
PCI: pciehp: Track enable/disable status

handle_button_press_event() currently determines whether the slot has
been turned on or off by looking at the Power Controller Control bit in
the Slot Control register.  This assumes that an attention button
implies presence of a power controller even though that's not mandated
by the spec.  Moreover the Power Controller Control bit is unreliable
when a power fault occurs (PCIe r4.0, sec 6.7.1.8).  This issue has
existed since the driver was introduced in 2004.

Fix by replacing STATIC_STATE with ON_STATE and OFF_STATE and tracking
whether the slot has been turned on or off.  This is also a required
ingredient to make pciehp resilient to missed events, which is the
object of an upcoming commit.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
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