summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2012-05-01 18:42:40 +0200
committerJames Bottomley <JBottomley@Parallels.com>2012-05-10 10:13:25 +0200
commit9c2fc1605fb917531f7dfb6fa2e84b56332a05b4 (patch)
treeb926f9593331e00d82c03534e105afb2ad945be8 /drivers/scsi/hpsa.c
parent[SCSI] hpsa: retry driver initiated commands on busy status (diff)
downloadlinux-9c2fc1605fb917531f7dfb6fa2e84b56332a05b4.tar.xz
linux-9c2fc1605fb917531f7dfb6fa2e84b56332a05b4.zip
[SCSI] hpsa: do not give up retry of driver cmds after only 3 retries
Instead of giving up after 3 immediate retries of driver initiated commands, back off the rate of retries and retry a bunch more times. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Reviewed-by: Andi Shyti <andi.shyti@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index cc586972dd9c..fd4b683d69e5 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -1380,17 +1380,24 @@ static void hpsa_scsi_do_simple_cmd_core_if_no_lockup(struct ctlr_info *h,
}
}
+#define MAX_DRIVER_CMD_RETRIES 25
static void hpsa_scsi_do_simple_cmd_with_retry(struct ctlr_info *h,
struct CommandList *c, int data_direction)
{
- int retry_count = 0;
+ int backoff_time = 10, retry_count = 0;
do {
memset(c->err_info, 0, sizeof(*c->err_info));
hpsa_scsi_do_simple_cmd_core(h, c);
retry_count++;
+ if (retry_count > 3) {
+ msleep(backoff_time);
+ if (backoff_time < 1000)
+ backoff_time *= 2;
+ }
} while ((check_for_unit_attention(h, c) ||
- check_for_busy(h, c)) && retry_count <= 3);
+ check_for_busy(h, c)) &&
+ retry_count <= MAX_DRIVER_CMD_RETRIES);
hpsa_pci_unmap(h->pdev, c, 1, data_direction);
}