aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSaurav Kashyap <saurav.kashyap@qlogic.com>2011-11-18 12:02:09 -0500
committerJames Bottomley <JBottomley@Parallels.com>2011-12-12 03:31:34 -0500
commitad537689c30d8e35300dcc93a109a966b8a89478 (patch)
tree05d6836525cd9cc52540a8cbea0a19f68eaba9fe /drivers/scsi
parentf6a290b419a2675c4b77a6b0731cd2a64332365e (diff)
[SCSI] qla2xxx: Remove qla2x00_wait_for_loop_ready function.
This function can wait for 5min under certain scenarios. One of them is when the port is down from switch and bus reset is issued. The bus reset used to wait for 5 minutes for the loop and upper layer callers used to hang and give stack trace because of getting stuck for 120 sec. It is legacy code that was used when the driver used to do queuing of the commands. Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c70
1 files changed, 4 insertions, 66 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index fd14c7bfc626..93673d3094e8 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -814,49 +814,6 @@ qla2x00_wait_for_chip_reset(scsi_qla_host_t *vha)
814 return return_status; 814 return return_status;
815} 815}
816 816
817/*
818 * qla2x00_wait_for_loop_ready
819 * Wait for MAX_LOOP_TIMEOUT(5 min) value for loop
820 * to be in LOOP_READY state.
821 * Input:
822 * ha - pointer to host adapter structure
823 *
824 * Note:
825 * Does context switching-Release SPIN_LOCK
826 * (if any) before calling this routine.
827 *
828 *
829 * Return:
830 * Success (LOOP_READY) : 0
831 * Failed (LOOP_NOT_READY) : 1
832 */
833static inline int
834qla2x00_wait_for_loop_ready(scsi_qla_host_t *vha)
835{
836 int return_status = QLA_SUCCESS;
837 unsigned long loop_timeout ;
838 struct qla_hw_data *ha = vha->hw;
839 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
840
841 /* wait for 5 min at the max for loop to be ready */
842 loop_timeout = jiffies + (MAX_LOOP_TIMEOUT * HZ);
843
844 while ((!atomic_read(&base_vha->loop_down_timer) &&
845 atomic_read(&base_vha->loop_state) == LOOP_DOWN) ||
846 atomic_read(&base_vha->loop_state) != LOOP_READY) {
847 if (atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
848 return_status = QLA_FUNCTION_FAILED;
849 break;
850 }
851 msleep(1000);
852 if (time_after_eq(jiffies, loop_timeout)) {
853 return_status = QLA_FUNCTION_FAILED;
854 break;
855 }
856 }
857 return (return_status);
858}
859
860static void 817static void
861sp_get(struct srb *sp) 818sp_get(struct srb *sp)
862{ 819{
@@ -1035,12 +992,6 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type,
1035 "Wait for hba online failed for cmd=%p.\n", cmd); 992 "Wait for hba online failed for cmd=%p.\n", cmd);
1036 goto eh_reset_failed; 993 goto eh_reset_failed;
1037 } 994 }
1038 err = 1;
1039 if (qla2x00_wait_for_loop_ready(vha) != QLA_SUCCESS) {
1040 ql_log(ql_log_warn, vha, 0x800b,
1041 "Wait for loop ready failed for cmd=%p.\n", cmd);
1042 goto eh_reset_failed;
1043 }
1044 err = 2; 995 err = 2;
1045 if (do_reset(fcport, cmd->device->lun, cmd->request->cpu + 1) 996 if (do_reset(fcport, cmd->device->lun, cmd->request->cpu + 1)
1046 != QLA_SUCCESS) { 997 != QLA_SUCCESS) {
@@ -1137,10 +1088,9 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
1137 goto eh_bus_reset_done; 1088 goto eh_bus_reset_done;
1138 } 1089 }
1139 1090
1140 if (qla2x00_wait_for_loop_ready(vha) == QLA_SUCCESS) { 1091 if (qla2x00_loop_reset(vha) == QLA_SUCCESS)
1141 if (qla2x00_loop_reset(vha) == QLA_SUCCESS) 1092 ret = SUCCESS;
1142 ret = SUCCESS; 1093
1143 }
1144 if (ret == FAILED) 1094 if (ret == FAILED)
1145 goto eh_bus_reset_done; 1095 goto eh_bus_reset_done;
1146 1096
@@ -1206,15 +1156,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
1206 if (qla2x00_wait_for_reset_ready(vha) != QLA_SUCCESS) 1156 if (qla2x00_wait_for_reset_ready(vha) != QLA_SUCCESS)
1207 goto eh_host_reset_lock; 1157 goto eh_host_reset_lock;
1208 1158
1209 /*
1210 * Fixme-may be dpc thread is active and processing
1211 * loop_resync,so wait a while for it to
1212 * be completed and then issue big hammer.Otherwise
1213 * it may cause I/O failure as big hammer marks the
1214 * devices as lost kicking of the port_down_timer
1215 * while dpc is stuck for the mailbox to complete.
1216 */
1217 qla2x00_wait_for_loop_ready(vha);
1218 if (vha != base_vha) { 1159 if (vha != base_vha) {
1219 if (qla2x00_vp_abort_isp(vha)) 1160 if (qla2x00_vp_abort_isp(vha))
1220 goto eh_host_reset_lock; 1161 goto eh_host_reset_lock;
@@ -1297,16 +1238,13 @@ qla2x00_loop_reset(scsi_qla_host_t *vha)
1297 atomic_set(&vha->loop_state, LOOP_DOWN); 1238 atomic_set(&vha->loop_state, LOOP_DOWN);
1298 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME); 1239 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
1299 qla2x00_mark_all_devices_lost(vha, 0); 1240 qla2x00_mark_all_devices_lost(vha, 0);
1300 qla2x00_wait_for_loop_ready(vha);
1301 } 1241 }
1302 1242
1303 if (ha->flags.enable_lip_reset) { 1243 if (ha->flags.enable_lip_reset) {
1304 ret = qla2x00_lip_reset(vha); 1244 ret = qla2x00_lip_reset(vha);
1305 if (ret != QLA_SUCCESS) { 1245 if (ret != QLA_SUCCESS)
1306 ql_dbg(ql_dbg_taskm, vha, 0x802e, 1246 ql_dbg(ql_dbg_taskm, vha, 0x802e,
1307 "lip_reset failed (%d).\n", ret); 1247 "lip_reset failed (%d).\n", ret);
1308 } else
1309 qla2x00_wait_for_loop_ready(vha);
1310 } 1248 }
1311 1249
1312 /* Issue marker command only when we are going to start the I/O */ 1250 /* Issue marker command only when we are going to start the I/O */