* power fault Cleared
*/
info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot);
- p_slot->status = 0x00;
taskInfo->event_type = INT_POWER_FAULT_CLEAR;
} else {
/*
*/
info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot);
taskInfo->event_type = INT_POWER_FAULT;
- /* set power fault status for this board */
- p_slot->status = 0xFF;
info("power fault bit %x set\n", hp_slot);
}
if (rc)
return rc;
}
- dbg("%s: slot status = %x\n", __FUNCTION__, p_slot->status);
-
/* Check for a power fault */
- if (p_slot->status == 0xFF) {
- /* power fault occurred, but it was benign */
+ if (p_slot->hpc_ops->query_power_fault(p_slot)) {
+ dbg("%s: power fault detected\n", __FUNCTION__);
rc = POWER_FAILURE;
- p_slot->status = 0;
goto err_exit;
}
goto err_exit;
}
- p_slot->status = 0;
-
/*
* Some PCI Express root ports require fixup after hot-plug operation.
*/
dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
- /* Change status to shutdown */
- p_slot->status = 0x01;
-
/* Wait for exclusive access to hardware */
down(&ctrl->crit_sect);
{
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;
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) {