[SCSI] megaraid_sas: Set IO request timeout value provided by OS timeout for Tape...
authorSumit.Saxena@lsi.com <Sumit.Saxena@lsi.com>
Wed, 22 May 2013 07:01:18 +0000 (12:31 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 25 Jun 2013 00:34:38 +0000 (17:34 -0700)
Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/megaraid/megaraid_sas_fusion.c

index a7d56687bfcabd8f565b7edbdfb17418cce700aa..750cbdfedd666f989e5fe502ca580e41d3a0259b 100644 (file)
@@ -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;