From: Yang, Bo Date: Tue, 6 Oct 2009 20:12:21 +0000 (-0600) Subject: [SCSI] megaraid_sas: tape drive support fix X-Git-Tag: v2.6.33-rc1~344^2~201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d56825321339f0ef7ad08eb58332e1836881e3b;p=profile%2Fivi%2Fkernel-x86-ivi.git [SCSI] megaraid_sas: tape drive support fix Add the Tape drive fix to the megaraid_sas driver: If the command is for the tape device, set the FW pthru timeout to the os layer timeout value. Signed-off-by Bo Yang Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index a39addc..6fd1e17 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -687,6 +687,17 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp, memcpy(pthru->cdb, scp->cmnd, scp->cmd_len); /* + * If the command is for the tape device, set the + * pthru timeout to the os layer timeout value. + */ + if (scp->device->type == TYPE_TAPE) { + if ((scp->request->timeout / HZ) > 0xFFFF) + pthru->timeout = 0xFFFF; + else + pthru->timeout = scp->request->timeout / HZ; + } + + /* * Construct SGL */ if (IS_DMA64) {