[PATCH] PCI Express Hotplug: clear sticky power-fault bit
Per the PCI Express spec, the power-fault-detected bit in the slot status register can be set anytime hardware detects a power fault, regardless of whether the slot has a device populated in it or not. This bit is sticky and must be explicitly cleared. This patch is needed to allow hot-add after such a power fault has been detected. Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
dcb890749b
commit
5a49f2036a
@@ -750,7 +750,7 @@ static int hpc_power_on_slot(struct slot * slot)
|
||||
{
|
||||
struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle;
|
||||
u16 slot_cmd;
|
||||
u16 slot_ctrl;
|
||||
u16 slot_ctrl, slot_status;
|
||||
|
||||
int retval = 0;
|
||||
|
||||
@@ -767,6 +767,14 @@ static int hpc_power_on_slot(struct slot * slot)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Clear sticky power-fault bit from previous power failures */
|
||||
hp_register_read_word(php_ctlr->pci_dev,
|
||||
SLOT_STATUS(slot->ctrl->cap_base), slot_status);
|
||||
slot_status &= PWR_FAULT_DETECTED;
|
||||
if (slot_status)
|
||||
hp_register_write_word(php_ctlr->pci_dev,
|
||||
SLOT_STATUS(slot->ctrl->cap_base), slot_status);
|
||||
|
||||
retval = hp_register_read_word(php_ctlr->pci_dev, SLOT_CTRL(slot->ctrl->cap_base), slot_ctrl);
|
||||
|
||||
if (retval) {
|
||||
|
Reference in New Issue
Block a user