diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 20:34:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 20:34:15 -0400 |
commit | c70b5296e775cde46cfcb2d860ba160108a5ec7a (patch) | |
tree | 30419cb982acca44499236adcca65f2f87698c74 /drivers/scsi/qla2xxx/qla_init.c | |
parent | 80c226fbef56576946c9655fcb2ab62e63404d12 (diff) | |
parent | 58ff4bd042adf8013c8f70fd03c2c0f8d022e387 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits)
[SCSI] be2iscsi: SGE Len == 64K
[SCSI] be2iscsi: Remove premature free of cid
[SCSI] be2iscsi: More time for FW
[SCSI] libsas: fix bug for vacant phy
[SCSI] sd: Fix overflow with big physical blocks
[SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer
[SCSI] libsas: Don't issue commands to devices that have been hot-removed
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive
[SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17
[SCSI] lpfc 8.3.17: Replace function reset methodology
[SCSI] lpfc 8.3.17: SCSI fixes
[SCSI] lpfc 8.3.17: BSG fixes
[SCSI] lpfc 8.3.17: SLI Additions and Fixes
[SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes
[SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces
[SCSI] ipr: fix array error logging
[SCSI] aha152x: enable PCMCIA on 64bit
[SCSI] scsi_dh_alua: Handle all states correctly
[SCSI] cxgb4i: connection and ddp setting update
[SCSI] cxgb3i: fixed connection over vlan
...
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 54 |
1 files changed, 45 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 9c383baebe27..3cafbef40737 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -954,6 +954,19 @@ qla2x00_reset_chip(scsi_qla_host_t *vha) | |||
954 | } | 954 | } |
955 | 955 | ||
956 | /** | 956 | /** |
957 | * qla81xx_reset_mpi() - Reset's MPI FW via Write MPI Register MBC. | ||
958 | * | ||
959 | * Returns 0 on success. | ||
960 | */ | ||
961 | int | ||
962 | qla81xx_reset_mpi(scsi_qla_host_t *vha) | ||
963 | { | ||
964 | uint16_t mb[4] = {0x1010, 0, 1, 0}; | ||
965 | |||
966 | return qla81xx_write_mpi_register(vha, mb); | ||
967 | } | ||
968 | |||
969 | /** | ||
957 | * qla24xx_reset_risc() - Perform full reset of ISP24xx RISC. | 970 | * qla24xx_reset_risc() - Perform full reset of ISP24xx RISC. |
958 | * @ha: HA context | 971 | * @ha: HA context |
959 | * | 972 | * |
@@ -967,6 +980,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha) | |||
967 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | 980 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; |
968 | uint32_t cnt, d2; | 981 | uint32_t cnt, d2; |
969 | uint16_t wd; | 982 | uint16_t wd; |
983 | static int abts_cnt; /* ISP abort retry counts */ | ||
970 | 984 | ||
971 | spin_lock_irqsave(&ha->hardware_lock, flags); | 985 | spin_lock_irqsave(&ha->hardware_lock, flags); |
972 | 986 | ||
@@ -1000,6 +1014,23 @@ qla24xx_reset_risc(scsi_qla_host_t *vha) | |||
1000 | barrier(); | 1014 | barrier(); |
1001 | } | 1015 | } |
1002 | 1016 | ||
1017 | /* If required, do an MPI FW reset now */ | ||
1018 | if (test_and_clear_bit(MPI_RESET_NEEDED, &vha->dpc_flags)) { | ||
1019 | if (qla81xx_reset_mpi(vha) != QLA_SUCCESS) { | ||
1020 | if (++abts_cnt < 5) { | ||
1021 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | ||
1022 | set_bit(MPI_RESET_NEEDED, &vha->dpc_flags); | ||
1023 | } else { | ||
1024 | /* | ||
1025 | * We exhausted the ISP abort retries. We have to | ||
1026 | * set the board offline. | ||
1027 | */ | ||
1028 | abts_cnt = 0; | ||
1029 | vha->flags.online = 0; | ||
1030 | } | ||
1031 | } | ||
1032 | } | ||
1033 | |||
1003 | WRT_REG_DWORD(®->hccr, HCCRX_SET_RISC_RESET); | 1034 | WRT_REG_DWORD(®->hccr, HCCRX_SET_RISC_RESET); |
1004 | RD_REG_DWORD(®->hccr); | 1035 | RD_REG_DWORD(®->hccr); |
1005 | 1036 | ||
@@ -2799,6 +2830,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
2799 | if (!IS_IIDMA_CAPABLE(ha)) | 2830 | if (!IS_IIDMA_CAPABLE(ha)) |
2800 | return; | 2831 | return; |
2801 | 2832 | ||
2833 | if (atomic_read(&fcport->state) != FCS_ONLINE) | ||
2834 | return; | ||
2835 | |||
2802 | if (fcport->fp_speed == PORT_SPEED_UNKNOWN || | 2836 | if (fcport->fp_speed == PORT_SPEED_UNKNOWN || |
2803 | fcport->fp_speed > ha->link_data_rate) | 2837 | fcport->fp_speed > ha->link_data_rate) |
2804 | return; | 2838 | return; |
@@ -3878,17 +3912,19 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) | |||
3878 | LOOP_DOWN_TIME); | 3912 | LOOP_DOWN_TIME); |
3879 | } | 3913 | } |
3880 | 3914 | ||
3881 | /* Make sure for ISP 82XX IO DMA is complete */ | 3915 | if (!ha->flags.eeh_busy) { |
3882 | if (IS_QLA82XX(ha)) { | 3916 | /* Make sure for ISP 82XX IO DMA is complete */ |
3883 | if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, | 3917 | if (IS_QLA82XX(ha)) { |
3884 | WAIT_HOST) == QLA_SUCCESS) { | 3918 | if (qla2x00_eh_wait_for_pending_commands(vha, 0, 0, |
3885 | DEBUG2(qla_printk(KERN_INFO, ha, | 3919 | WAIT_HOST) == QLA_SUCCESS) { |
3886 | "Done wait for pending commands\n")); | 3920 | DEBUG2(qla_printk(KERN_INFO, ha, |
3921 | "Done wait for pending commands\n")); | ||
3922 | } | ||
3887 | } | 3923 | } |
3888 | } | ||
3889 | 3924 | ||
3890 | /* Requeue all commands in outstanding command list. */ | 3925 | /* Requeue all commands in outstanding command list. */ |
3891 | qla2x00_abort_all_cmds(vha, DID_RESET << 16); | 3926 | qla2x00_abort_all_cmds(vha, DID_RESET << 16); |
3927 | } | ||
3892 | } | 3928 | } |
3893 | 3929 | ||
3894 | /* | 3930 | /* |