From: Sumit.Saxena@lsi.com Date: Wed, 22 May 2013 07:01:18 +0000 (+0530) Subject: [SCSI] megaraid_sas: Set IO request timeout value provided by OS timeout for Tape... X-Git-Tag: firefly_0821_release~176^2~5775^2~66 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=32d8745c88a08edaef1c35fcbf2ce3b6804b92d8;p=firefly-linux-kernel-4.4.55.git [SCSI] megaraid_sas: Set IO request timeout value provided by OS timeout for Tape devices Signed-off-by: Sumit Saxena Signed-off-by: Kashyap Desai Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a7d56687bfca..750cbdfedd66 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -1527,6 +1527,18 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance, MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); cmd->request_desc->SCSIIO.DevHandle = local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; + /* + * If the command is for the tape device, set the + * FP timeout to the os layer timeout value. + */ + if (scmd->device->type == TYPE_TAPE) { + if ((scmd->request->timeout / HZ) > 0xFFFF) + io_request->RaidContext.timeoutValue = + 0xFFFF; + else + io_request->RaidContext.timeoutValue = + scmd->request->timeout / HZ; + } } else { io_request->Function = MEGASAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id;