diff options
author | Manoj Kumar <kumarmn@us.ibm.com> | 2015-10-21 22:11:10 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-10-30 08:58:09 +0100 |
commit | 471a5a60aaf13b2323d2b63d212bbdd6ce2bef28 (patch) | |
tree | a2b2778ede4b8b257f4e8665d3b84060df258c5f /drivers/scsi/cxlflash/superpipe.c | |
parent | cxlflash: Replace magic numbers with literals (diff) | |
download | linux-471a5a60aaf13b2323d2b63d212bbdd6ce2bef28.tar.xz linux-471a5a60aaf13b2323d2b63d212bbdd6ce2bef28.zip |
cxlflash: Fix read capacity timeout
The timeout value for read capacity is too small. Certain devices
may take longer to respond and thus the command may prematurely
timeout. Additionally the literal used for the timeout is stale.
Update the timeout to 30 seconds (matches the value used in sd.c)
and rework the timeout literal to a more appropriate description.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash/superpipe.c')
-rw-r--r-- | drivers/scsi/cxlflash/superpipe.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index 7df985d7830c..c3c229ec7d0c 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -296,7 +296,7 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) int rc = 0; int result = 0; int retry_cnt = 0; - u32 tout = (MC_DISCOVERY_TIMEOUT * HZ); + u32 to = CMD_TIMEOUT * HZ; retry: cmd_buf = kzalloc(CMD_BUFSIZE, GFP_KERNEL); @@ -315,8 +315,7 @@ retry: retry_cnt ? "re" : "", scsi_cmd[0]); result = scsi_execute(sdev, scsi_cmd, DMA_FROM_DEVICE, cmd_buf, - CMD_BUFSIZE, sense_buf, tout, CMD_RETRIES, - 0, NULL); + CMD_BUFSIZE, sense_buf, to, CMD_RETRIES, 0, NULL); if (driver_byte(result) == DRIVER_SENSE) { result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ @@ -1376,8 +1375,8 @@ out_attach: attach->block_size = gli->blk_len; attach->mmio_size = sizeof(afu->afu_map->hosts[0].harea); attach->last_lba = gli->max_lba; - attach->max_xfer = (sdev->host->max_sectors * MAX_SECTOR_UNIT) / - gli->blk_len; + attach->max_xfer = sdev->host->max_sectors * MAX_SECTOR_UNIT; + attach->max_xfer /= gli->blk_len; out: attach->adap_fd = fd; |