diff options
author | Matt Bondurant <Matthew.dav.bondurant@hp.com> | 2012-05-01 12:42:35 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-10 04:12:10 -0400 |
commit | 852af20aa64ef34ab07de978c676e1e8860dca2e (patch) | |
tree | 7855d0e5c657b68390336e3cca8dc33dd51aea2f /drivers/scsi/hpsa.c | |
parent | 2c17d2da8c9ef2c5be5077d3995041791e38094d (diff) |
[SCSI] hpsa: retry driver initiated commands on busy status
In shared SAS configurations we might get a busy status
during driver initiated commands (e.g. during rescan for
devices). We should retry the command in such cases rather
than giving up.
Signed-off-by: Matt Bondurant <Matthew.dav.bondurant@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 5e8c7ca02be8..cc586972dd9c 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -234,6 +234,16 @@ static int check_for_unit_attention(struct ctlr_info *h, | |||
234 | return 1; | 234 | return 1; |
235 | } | 235 | } |
236 | 236 | ||
237 | static int check_for_busy(struct ctlr_info *h, struct CommandList *c) | ||
238 | { | ||
239 | if (c->err_info->CommandStatus != CMD_TARGET_STATUS || | ||
240 | (c->err_info->ScsiStatus != SAM_STAT_BUSY && | ||
241 | c->err_info->ScsiStatus != SAM_STAT_TASK_SET_FULL)) | ||
242 | return 0; | ||
243 | dev_warn(&h->pdev->dev, HPSA "device busy"); | ||
244 | return 1; | ||
245 | } | ||
246 | |||
237 | static ssize_t host_store_rescan(struct device *dev, | 247 | static ssize_t host_store_rescan(struct device *dev, |
238 | struct device_attribute *attr, | 248 | struct device_attribute *attr, |
239 | const char *buf, size_t count) | 249 | const char *buf, size_t count) |
@@ -1379,7 +1389,8 @@ static void hpsa_scsi_do_simple_cmd_with_retry(struct ctlr_info *h, | |||
1379 | memset(c->err_info, 0, sizeof(*c->err_info)); | 1389 | memset(c->err_info, 0, sizeof(*c->err_info)); |
1380 | hpsa_scsi_do_simple_cmd_core(h, c); | 1390 | hpsa_scsi_do_simple_cmd_core(h, c); |
1381 | retry_count++; | 1391 | retry_count++; |
1382 | } while (check_for_unit_attention(h, c) && retry_count <= 3); | 1392 | } while ((check_for_unit_attention(h, c) || |
1393 | check_for_busy(h, c)) && retry_count <= 3); | ||
1383 | hpsa_pci_unmap(h->pdev, c, 1, data_direction); | 1394 | hpsa_pci_unmap(h->pdev, c, 1, data_direction); |
1384 | } | 1395 | } |
1385 | 1396 | ||