aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c60
1 files changed, 49 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index da804f487f21..f76424ef05b0 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -564,6 +564,7 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj,
564 struct qla_hw_data *ha = vha->hw; 564 struct qla_hw_data *ha = vha->hw;
565 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); 565 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
566 int type; 566 int type;
567 uint32_t idc_control;
567 568
568 if (off != 0) 569 if (off != 0)
569 return -EINVAL; 570 return -EINVAL;
@@ -587,22 +588,36 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj,
587 scsi_unblock_requests(vha->host); 588 scsi_unblock_requests(vha->host);
588 break; 589 break;
589 case 0x2025d: 590 case 0x2025d:
590 if (!IS_QLA81XX(ha) || !IS_QLA8031(ha)) 591 if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha))
591 return -EPERM; 592 return -EPERM;
592 593
593 ql_log(ql_log_info, vha, 0x706f, 594 ql_log(ql_log_info, vha, 0x706f,
594 "Issuing MPI reset.\n"); 595 "Issuing MPI reset.\n");
595 596
596 /* Make sure FC side is not in reset */ 597 if (IS_QLA83XX(ha)) {
597 qla2x00_wait_for_hba_online(vha); 598 uint32_t idc_control;
598 599
599 /* Issue MPI reset */ 600 qla83xx_idc_lock(vha, 0);
600 scsi_block_requests(vha->host); 601 __qla83xx_get_idc_control(vha, &idc_control);
601 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS) 602 idc_control |= QLA83XX_IDC_GRACEFUL_RESET;
602 ql_log(ql_log_warn, vha, 0x7070, 603 __qla83xx_set_idc_control(vha, idc_control);
603 "MPI reset failed.\n"); 604 qla83xx_wr_reg(vha, QLA83XX_IDC_DEV_STATE,
604 scsi_unblock_requests(vha->host); 605 QLA8XXX_DEV_NEED_RESET);
605 break; 606 qla83xx_idc_audit(vha, IDC_AUDIT_TIMESTAMP);
607 qla83xx_idc_unlock(vha, 0);
608 break;
609 } else {
610 /* Make sure FC side is not in reset */
611 qla2x00_wait_for_hba_online(vha);
612
613 /* Issue MPI reset */
614 scsi_block_requests(vha->host);
615 if (qla81xx_restart_mpi_firmware(vha) != QLA_SUCCESS)
616 ql_log(ql_log_warn, vha, 0x7070,
617 "MPI reset failed.\n");
618 scsi_unblock_requests(vha->host);
619 break;
620 }
606 case 0x2025e: 621 case 0x2025e:
607 if (!IS_QLA82XX(ha) || vha != base_vha) { 622 if (!IS_QLA82XX(ha) || vha != base_vha) {
608 ql_log(ql_log_info, vha, 0x7071, 623 ql_log(ql_log_info, vha, 0x7071,
@@ -616,6 +631,29 @@ qla2x00_sysfs_write_reset(struct file *filp, struct kobject *kobj,
616 qla2xxx_wake_dpc(vha); 631 qla2xxx_wake_dpc(vha);
617 qla2x00_wait_for_fcoe_ctx_reset(vha); 632 qla2x00_wait_for_fcoe_ctx_reset(vha);
618 break; 633 break;
634 case 0x2025f:
635 if (!IS_QLA8031(ha))
636 return -EPERM;
637 ql_log(ql_log_info, vha, 0x70bc,
638 "Disabling Reset by IDC control\n");
639 qla83xx_idc_lock(vha, 0);
640 __qla83xx_get_idc_control(vha, &idc_control);
641 idc_control |= QLA83XX_IDC_RESET_DISABLED;
642 __qla83xx_set_idc_control(vha, idc_control);
643 qla83xx_idc_unlock(vha, 0);
644 break;
645 case 0x20260:
646 if (!IS_QLA8031(ha))
647 return -EPERM;
648 ql_log(ql_log_info, vha, 0x70bd,
649 "Enabling Reset by IDC control\n");
650 qla83xx_idc_lock(vha, 0);
651 __qla83xx_get_idc_control(vha, &idc_control);
652 idc_control &= ~QLA83XX_IDC_RESET_DISABLED;
653 __qla83xx_set_idc_control(vha, idc_control);
654 qla83xx_idc_unlock(vha, 0);
655 break;
656
619 } 657 }
620 return count; 658 return count;
621} 659}