aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi/ibmvscsi.c
diff options
context:
space:
mode:
authorRobert Jennings <rcj@linux.vnet.ibm.com>2009-06-08 17:19:03 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-08 19:05:16 -0400
commite1a5ce5b88d06344caec0c71b4ee33e7296358dd (patch)
treef07bcf69a40a26222565027903c53d3d84ad6d45 /drivers/scsi/ibmvscsi/ibmvscsi.c
parentfbc56f0801f58041a4372a030933bac076b46aad (diff)
[SCSI] ibmvscsi: Add specific timeouts for operations
Previously we had one timeout that was used for all types of operations. This adds specific timeout values for different operations (init, login, adapter info MAD, abort task, and LUN reset). Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 9804b42dcd9..6038c0491f8 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -87,7 +87,11 @@
87 */ 87 */
88static int max_id = 64; 88static int max_id = 64;
89static int max_channel = 3; 89static int max_channel = 3;
90static int init_timeout = 5; 90static int init_timeout = 300;
91static int login_timeout = 60;
92static int info_timeout = 30;
93static int abort_timeout = 60;
94static int reset_timeout = 60;
91static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT; 95static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT;
92static int max_events = IBMVSCSI_MAX_REQUESTS_DEFAULT + 2; 96static int max_events = IBMVSCSI_MAX_REQUESTS_DEFAULT + 2;
93 97
@@ -849,7 +853,7 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
849 init_event_struct(evt_struct, 853 init_event_struct(evt_struct,
850 adapter_info_rsp, 854 adapter_info_rsp,
851 VIOSRP_MAD_FORMAT, 855 VIOSRP_MAD_FORMAT,
852 init_timeout); 856 info_timeout);
853 857
854 req = &evt_struct->iu.mad.adapter_info; 858 req = &evt_struct->iu.mad.adapter_info;
855 memset(req, 0x00, sizeof(*req)); 859 memset(req, 0x00, sizeof(*req));
@@ -871,7 +875,7 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
871 } 875 }
872 876
873 spin_lock_irqsave(hostdata->host->host_lock, flags); 877 spin_lock_irqsave(hostdata->host->host_lock, flags);
874 if (ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2)) { 878 if (ibmvscsi_send_srp_event(evt_struct, hostdata, info_timeout * 2)) {
875 dev_err(hostdata->dev, "couldn't send ADAPTER_INFO_REQ!\n"); 879 dev_err(hostdata->dev, "couldn't send ADAPTER_INFO_REQ!\n");
876 dma_unmap_single(hostdata->dev, 880 dma_unmap_single(hostdata->dev,
877 addr, 881 addr,
@@ -944,7 +948,7 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata)
944 init_event_struct(evt_struct, 948 init_event_struct(evt_struct,
945 login_rsp, 949 login_rsp,
946 VIOSRP_SRP_FORMAT, 950 VIOSRP_SRP_FORMAT,
947 init_timeout); 951 login_timeout);
948 952
949 login = &evt_struct->iu.srp.login_req; 953 login = &evt_struct->iu.srp.login_req;
950 memset(login, 0x00, sizeof(struct srp_login_req)); 954 memset(login, 0x00, sizeof(struct srp_login_req));
@@ -959,7 +963,7 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata)
959 */ 963 */
960 atomic_set(&hostdata->request_limit, 0); 964 atomic_set(&hostdata->request_limit, 0);
961 965
962 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2); 966 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, login_timeout * 2);
963 spin_unlock_irqrestore(hostdata->host->host_lock, flags); 967 spin_unlock_irqrestore(hostdata->host->host_lock, flags);
964 dev_info(hostdata->dev, "sent SRP login\n"); 968 dev_info(hostdata->dev, "sent SRP login\n");
965 return rc; 969 return rc;
@@ -1026,7 +1030,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1026 init_event_struct(evt, 1030 init_event_struct(evt,
1027 sync_completion, 1031 sync_completion,
1028 VIOSRP_SRP_FORMAT, 1032 VIOSRP_SRP_FORMAT,
1029 init_timeout); 1033 abort_timeout);
1030 1034
1031 tsk_mgmt = &evt->iu.srp.tsk_mgmt; 1035 tsk_mgmt = &evt->iu.srp.tsk_mgmt;
1032 1036
@@ -1040,7 +1044,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1040 evt->sync_srp = &srp_rsp; 1044 evt->sync_srp = &srp_rsp;
1041 1045
1042 init_completion(&evt->comp); 1046 init_completion(&evt->comp);
1043 rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, init_timeout * 2); 1047 rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, abort_timeout * 2);
1044 1048
1045 if (rsp_rc != SCSI_MLQUEUE_HOST_BUSY) 1049 if (rsp_rc != SCSI_MLQUEUE_HOST_BUSY)
1046 break; 1050 break;
@@ -1149,7 +1153,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1149 init_event_struct(evt, 1153 init_event_struct(evt,
1150 sync_completion, 1154 sync_completion,
1151 VIOSRP_SRP_FORMAT, 1155 VIOSRP_SRP_FORMAT,
1152 init_timeout); 1156 reset_timeout);
1153 1157
1154 tsk_mgmt = &evt->iu.srp.tsk_mgmt; 1158 tsk_mgmt = &evt->iu.srp.tsk_mgmt;
1155 1159
@@ -1162,7 +1166,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1162 evt->sync_srp = &srp_rsp; 1166 evt->sync_srp = &srp_rsp;
1163 1167
1164 init_completion(&evt->comp); 1168 init_completion(&evt->comp);
1165 rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, init_timeout * 2); 1169 rsp_rc = ibmvscsi_send_srp_event(evt, hostdata, reset_timeout * 2);
1166 1170
1167 if (rsp_rc != SCSI_MLQUEUE_HOST_BUSY) 1171 if (rsp_rc != SCSI_MLQUEUE_HOST_BUSY)
1168 break; 1172 break;
@@ -1394,7 +1398,7 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
1394 init_event_struct(evt_struct, 1398 init_event_struct(evt_struct,
1395 sync_completion, 1399 sync_completion,
1396 VIOSRP_MAD_FORMAT, 1400 VIOSRP_MAD_FORMAT,
1397 init_timeout); 1401 info_timeout);
1398 1402
1399 host_config = &evt_struct->iu.mad.host_config; 1403 host_config = &evt_struct->iu.mad.host_config;
1400 1404
@@ -1416,7 +1420,7 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
1416 1420
1417 init_completion(&evt_struct->comp); 1421 init_completion(&evt_struct->comp);
1418 spin_lock_irqsave(hostdata->host->host_lock, flags); 1422 spin_lock_irqsave(hostdata->host->host_lock, flags);
1419 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2); 1423 rc = ibmvscsi_send_srp_event(evt_struct, hostdata, info_timeout * 2);
1420 spin_unlock_irqrestore(hostdata->host->host_lock, flags); 1424 spin_unlock_irqrestore(hostdata->host->host_lock, flags);
1421 if (rc == 0) 1425 if (rc == 0)
1422 wait_for_completion(&evt_struct->comp); 1426 wait_for_completion(&evt_struct->comp);
@@ -1441,7 +1445,7 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev)
1441 spin_lock_irqsave(shost->host_lock, lock_flags); 1445 spin_lock_irqsave(shost->host_lock, lock_flags);
1442 if (sdev->type == TYPE_DISK) { 1446 if (sdev->type == TYPE_DISK) {
1443 sdev->allow_restart = 1; 1447 sdev->allow_restart = 1;
1444 blk_queue_rq_timeout(sdev->request_queue, 60 * HZ); 1448 blk_queue_rq_timeout(sdev->request_queue, 120 * HZ);
1445 } 1449 }
1446 scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); 1450 scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
1447 spin_unlock_irqrestore(shost->host_lock, lock_flags); 1451 spin_unlock_irqrestore(shost->host_lock, lock_flags);