diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-11-29 17:54:28 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 15:09:02 -0500 |
commit | 3a2cdf391b62919d3d2862cdce3d70b9a7a99673 (patch) | |
tree | 8064bea5987445b88b074c02cf65cc5ac1b2ce98 | |
parent | 3944f50995f947558c35fb16ae0288354756762c (diff) |
[SCSI] libsas: defer SAS_TASK_NEED_DEV_RESET commands to libata
lldds use the SAS_TASK_NEED_DEV_RESET interface to request that eh
perform a reset. In the sata device case defer the commands that
triggered the reset to libata-eh context so it can perform its pre and
post reset management.
In the sas_ata_post_internal() case the reset request is falling on deaf
ears as the sas_task is immediately destroyed without any reset action.
Since it is currently a nop, and likely superfluous given the conversion
to new-style libata-eh, just drop the request.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 14 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_scsi_host.c | 4 |
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 4c2a1402373c..a8ace8d24e66 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -411,18 +411,12 @@ static void sas_ata_post_internal(struct ata_queued_cmd *qc) | |||
411 | * ourselves. | 411 | * ourselves. |
412 | */ | 412 | */ |
413 | struct sas_task *task = qc->lldd_task; | 413 | struct sas_task *task = qc->lldd_task; |
414 | unsigned long flags; | ||
415 | 414 | ||
416 | qc->lldd_task = NULL; | 415 | qc->lldd_task = NULL; |
417 | if (task) { | 416 | if (!task) |
418 | /* Should this be a AT(API) device reset? */ | 417 | return; |
419 | spin_lock_irqsave(&task->task_state_lock, flags); | 418 | task->uldd_task = NULL; |
420 | task->task_state_flags |= SAS_TASK_NEED_DEV_RESET; | 419 | sas_ata_internal_abort(task); |
421 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
422 | |||
423 | task->uldd_task = NULL; | ||
424 | sas_ata_internal_abort(task); | ||
425 | } | ||
426 | } | 420 | } |
427 | } | 421 | } |
428 | 422 | ||
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index e02ca3d570f5..af71a6d0edae 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -288,7 +288,7 @@ static void sas_scsi_clear_queue_lu(struct list_head *error_q, struct scsi_cmnd | |||
288 | list_for_each_entry_safe(cmd, n, error_q, eh_entry) { | 288 | list_for_each_entry_safe(cmd, n, error_q, eh_entry) { |
289 | if (cmd->device->sdev_target == my_cmd->device->sdev_target && | 289 | if (cmd->device->sdev_target == my_cmd->device->sdev_target && |
290 | cmd->device->lun == my_cmd->device->lun) | 290 | cmd->device->lun == my_cmd->device->lun) |
291 | sas_eh_finish_cmd(cmd); | 291 | sas_eh_defer_cmd(cmd); |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
@@ -594,7 +594,7 @@ Again: | |||
594 | "recovered\n", | 594 | "recovered\n", |
595 | SAS_ADDR(task->dev), | 595 | SAS_ADDR(task->dev), |
596 | cmd->device->lun); | 596 | cmd->device->lun); |
597 | sas_eh_finish_cmd(cmd); | 597 | sas_eh_defer_cmd(cmd); |
598 | sas_scsi_clear_queue_lu(work_q, cmd); | 598 | sas_scsi_clear_queue_lu(work_q, cmd); |
599 | goto Again; | 599 | goto Again; |
600 | } | 600 | } |