static void set_slot_off(struct controller *ctrl, struct slot * pslot)
{
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
/* turn off slot, turn on Amber LED, turn off Green LED if supported*/
if (POWER_CTRL(ctrl->ctrlcap)) {
if (pslot->hpc_ops->power_off_slot(pslot)) {
err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
return;
}
wait_for_ctrl_irq (ctrl);
if (ATTN_LED(ctrl->ctrlcap)) {
if (pslot->hpc_ops->set_attention_status(pslot, 1)) {
err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
return;
}
wait_for_ctrl_irq (ctrl);
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
}
/**
ctrl->slot_device_offset, hp_slot);
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
if (POWER_CTRL(ctrl->ctrlcap)) {
/* Power on slot */
rc = p_slot->hpc_ops->power_on_slot(p_slot);
if (rc) {
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
return -1;
}
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
/* Wait for ~1 second */
wait_for_ctrl_irq (ctrl);
pci_fixup_device(pci_fixup_final, ctrl->pci_dev);
if (PWR_LED(ctrl->ctrlcap)) {
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
p_slot->hpc_ops->green_led_on(p_slot);
wait_for_ctrl_irq (ctrl);
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
}
return 0;
dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
if (POWER_CTRL(ctrl->ctrlcap)) {
/* power off slot */
rc = p_slot->hpc_ops->power_off_slot(p_slot);
if (rc) {
err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
return rc;
}
/* Wait for the command to complete */
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
return 0;
}
if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
/* Wait for exclusive access to hardware */
- mutex_lock(&p_slot->ctrl->crit_sect);
+ down(&p_slot->ctrl->crit_sect);
p_slot->hpc_ops->green_led_off(p_slot);
wait_for_ctrl_irq (p_slot->ctrl);
/* Done with exclusive hardware access */
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
}
p_slot->state = STATIC_STATE;
}
if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {
/* Wait for exclusive access to hardware */
- mutex_lock(&p_slot->ctrl->crit_sect);
+ down(&p_slot->ctrl->crit_sect);
p_slot->hpc_ops->green_led_off(p_slot);
wait_for_ctrl_irq (p_slot->ctrl);
/* Done with exclusive hardware access */
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
}
p_slot->state = STATIC_STATE;
}
switch (p_slot->state) {
case BLINKINGOFF_STATE:
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
if (PWR_LED(ctrl->ctrlcap)) {
p_slot->hpc_ops->green_led_on(p_slot);
wait_for_ctrl_irq (ctrl);
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
break;
case BLINKINGON_STATE:
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
if (PWR_LED(ctrl->ctrlcap)) {
p_slot->hpc_ops->green_led_off(p_slot);
wait_for_ctrl_irq (ctrl);
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
break;
default:
}
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
/* blink green LED and turn off amber */
if (PWR_LED(ctrl->ctrlcap)) {
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
init_timer(&p_slot->task_event);
p_slot->task_event.expires = jiffies + 5 * HZ; /* 5 second delay */
if (POWER_CTRL(ctrl->ctrlcap)) {
dbg("power fault\n");
/* Wait for exclusive access to hardware */
- mutex_lock(&ctrl->crit_sect);
+ down(&ctrl->crit_sect);
if (ATTN_LED(ctrl->ctrlcap)) {
p_slot->hpc_ops->set_attention_status(p_slot, 1);
}
/* Done with exclusive hardware access */
- mutex_unlock(&ctrl->crit_sect);
+ up(&ctrl->crit_sect);
}
}
/***********SURPRISE REMOVAL********************/
int rc;
/* Check to see if (latch closed, card present, power off) */
- mutex_lock(&p_slot->ctrl->crit_sect);
+ down(&p_slot->ctrl->crit_sect);
rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (rc || !getstatus) {
info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
if (MRL_SENS(p_slot->ctrl->ctrlcap)) {
rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
if (rc || getstatus) {
info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
}
rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
if (rc || getstatus) {
info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
}
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
return 1;
/* Check to see if (latch closed, card present, power on) */
- mutex_lock(&p_slot->ctrl->crit_sect);
+ down(&p_slot->ctrl->crit_sect);
if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) {
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (ret || !getstatus) {
info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
}
ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
if (ret || getstatus) {
info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
}
ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
if (ret || !getstatus) {
info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
return 1;
}
}
- mutex_unlock(&p_slot->ctrl->crit_sect);
+ up(&p_slot->ctrl->crit_sect);
ret = remove_board(p_slot);
update_slot_info(p_slot);