Skip to content

Commit

Permalink
scsi: aacraid: setting different timeout for src and thor
Browse files Browse the repository at this point in the history
Set 180 second timeout for thor and 60 seconds for src controllers.

Link: https://lore.kernel.org/r/1571120524-6037-5-git-send-email-balsundar.p@microsemi.com
Signed-off-by: Balsundar P <balsundar.p@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Balsundar P authored and Martin K. Petersen committed Oct 18, 2019
1 parent c02a334 commit e2fd90d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion drivers/scsi/aacraid/aachba.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd
struct aac_srb * srbcmd;
u32 flag;
u32 timeout;
struct aac_dev *dev = fib->dev;

aac_fib_init(fib);
switch(cmd->sc_data_direction){
Expand All @@ -1503,7 +1504,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd
srbcmd->flags = cpu_to_le32(flag);
timeout = cmd->request->timeout/HZ;
if (timeout == 0)
timeout = 1;
timeout = (dev->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT);
srbcmd->timeout = cpu_to_le32(timeout); // timeout in seconds
srbcmd->retry_limit = 0; /* Obsolete parameter */
srbcmd->cdb_size = cpu_to_le32(cmd->cmd_len);
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/aacraid/aacraid.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ enum {
#define AAC_BUS_TARGET_LOOP (AAC_MAX_BUSES * AAC_MAX_TARGETS)
#define AAC_MAX_NATIVE_SIZE 2048
#define FW_ERROR_BUFFER_SIZE 512
#define AAC_SA_TIMEOUT 180
#define AAC_ARC_TIMEOUT 60

#define get_bus_number(x) (x/AAC_MAX_TARGETS)
#define get_target_number(x) (x%AAC_MAX_TARGETS)
Expand Down
10 changes: 7 additions & 3 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ static int aac_slave_configure(struct scsi_device *sdev)
int chn, tid;
unsigned int depth = 0;
unsigned int set_timeout = 0;
int timeout = 0;
bool set_qd_dev_type = false;
u8 devtype = 0;

Expand Down Expand Up @@ -483,10 +484,13 @@ static int aac_slave_configure(struct scsi_device *sdev)

/*
* Firmware has an individual device recovery time typically
* of 35 seconds, give us a margin.
* of 35 seconds, give us a margin. Thor devices can take longer in
* error recovery, hence different value.
*/
if (set_timeout && sdev->request_queue->rq_timeout < (45 * HZ))
blk_queue_rq_timeout(sdev->request_queue, 45*HZ);
if (set_timeout) {
timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT;
blk_queue_rq_timeout(sdev->request_queue, timeout * HZ);
}

if (depth > 256)
depth = 256;
Expand Down

0 comments on commit e2fd90d

Please sign in to comment.