diff options
author | Jeff Skirvin <jeffrey.d.skirvin@intel.com> | 2011-10-27 18:05:11 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-31 05:17:04 -0400 |
commit | db49c2d037d50dfc67b29a4e013d6250ca97c3aa (patch) | |
tree | c95a2d7dcb7976a44ed798b3f5b3fd49450df095 /drivers/scsi | |
parent | b343dff1a269bcc0eac123ef541c5476b03d52c1 (diff) |
[SCSI] isci: No task_done callbacks in error handler paths.
libsas will cleanup pending sas_tasks after error handler
path functions are called; do not call task_done callbacks.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/isci/task.c | 69 |
1 files changed, 14 insertions, 55 deletions
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 4175f173868e..c1f439bed717 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -585,53 +585,6 @@ static enum isci_request_status isci_task_validate_request_to_abort( | |||
585 | return old_state; | 585 | return old_state; |
586 | } | 586 | } |
587 | 587 | ||
588 | /** | ||
589 | * isci_request_cleanup_completed_loiterer() - This function will take care of | ||
590 | * the final cleanup on any request which has been explicitly terminated. | ||
591 | * @isci_host: This parameter specifies the ISCI host object | ||
592 | * @isci_device: This is the device to which the request is pending. | ||
593 | * @isci_request: This parameter specifies the terminated request object. | ||
594 | * @task: This parameter is the libsas I/O request. | ||
595 | */ | ||
596 | static void isci_request_cleanup_completed_loiterer( | ||
597 | struct isci_host *isci_host, | ||
598 | struct isci_remote_device *isci_device, | ||
599 | struct isci_request *isci_request, | ||
600 | struct sas_task *task) | ||
601 | { | ||
602 | unsigned long flags; | ||
603 | |||
604 | dev_dbg(&isci_host->pdev->dev, | ||
605 | "%s: isci_device=%p, request=%p, task=%p\n", | ||
606 | __func__, isci_device, isci_request, task); | ||
607 | |||
608 | if (task != NULL) { | ||
609 | |||
610 | spin_lock_irqsave(&task->task_state_lock, flags); | ||
611 | task->lldd_task = NULL; | ||
612 | |||
613 | task->task_state_flags &= ~SAS_TASK_NEED_DEV_RESET; | ||
614 | |||
615 | isci_set_task_doneflags(task); | ||
616 | |||
617 | /* If this task is not in the abort path, call task_done. */ | ||
618 | if (!(task->task_state_flags & SAS_TASK_STATE_ABORTED)) { | ||
619 | |||
620 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
621 | task->task_done(task); | ||
622 | } else | ||
623 | spin_unlock_irqrestore(&task->task_state_lock, flags); | ||
624 | } | ||
625 | |||
626 | if (isci_request != NULL) { | ||
627 | spin_lock_irqsave(&isci_host->scic_lock, flags); | ||
628 | isci_free_tag(isci_host, isci_request->io_tag); | ||
629 | isci_request_change_state(isci_request, unallocated); | ||
630 | list_del_init(&isci_request->dev_node); | ||
631 | spin_unlock_irqrestore(&isci_host->scic_lock, flags); | ||
632 | } | ||
633 | } | ||
634 | |||
635 | static int isci_request_is_dealloc_managed(enum isci_request_status stat) | 588 | static int isci_request_is_dealloc_managed(enum isci_request_status stat) |
636 | { | 589 | { |
637 | switch (stat) { | 590 | switch (stat) { |
@@ -666,7 +619,6 @@ static void isci_terminate_request_core(struct isci_host *ihost, | |||
666 | unsigned long flags; | 619 | unsigned long flags; |
667 | unsigned long termination_completed = 1; | 620 | unsigned long termination_completed = 1; |
668 | struct completion *io_request_completion; | 621 | struct completion *io_request_completion; |
669 | struct sas_task *task; | ||
670 | 622 | ||
671 | dev_dbg(&ihost->pdev->dev, | 623 | dev_dbg(&ihost->pdev->dev, |
672 | "%s: device = %p; request = %p\n", | 624 | "%s: device = %p; request = %p\n", |
@@ -676,10 +628,6 @@ static void isci_terminate_request_core(struct isci_host *ihost, | |||
676 | 628 | ||
677 | io_request_completion = isci_request->io_request_completion; | 629 | io_request_completion = isci_request->io_request_completion; |
678 | 630 | ||
679 | task = (isci_request->ttype == io_task) | ||
680 | ? isci_request_access_task(isci_request) | ||
681 | : NULL; | ||
682 | |||
683 | /* Note that we are not going to control | 631 | /* Note that we are not going to control |
684 | * the target to abort the request. | 632 | * the target to abort the request. |
685 | */ | 633 | */ |
@@ -783,9 +731,20 @@ static void isci_terminate_request_core(struct isci_host *ihost, | |||
783 | spin_unlock_irqrestore(&isci_request->state_lock, flags); | 731 | spin_unlock_irqrestore(&isci_request->state_lock, flags); |
784 | 732 | ||
785 | } | 733 | } |
786 | if (needs_cleanup_handling) | 734 | if (needs_cleanup_handling) { |
787 | isci_request_cleanup_completed_loiterer( | 735 | |
788 | ihost, idev, isci_request, task); | 736 | dev_dbg(&ihost->pdev->dev, |
737 | "%s: cleanup isci_device=%p, request=%p\n", | ||
738 | __func__, idev, isci_request); | ||
739 | |||
740 | if (isci_request != NULL) { | ||
741 | spin_lock_irqsave(&ihost->scic_lock, flags); | ||
742 | isci_free_tag(ihost, isci_request->io_tag); | ||
743 | isci_request_change_state(isci_request, unallocated); | ||
744 | list_del_init(&isci_request->dev_node); | ||
745 | spin_unlock_irqrestore(&ihost->scic_lock, flags); | ||
746 | } | ||
747 | } | ||
789 | } | 748 | } |
790 | } | 749 | } |
791 | 750 | ||