diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libsas/sas_scsi_host.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 3701ff7e7267..fd3291337c1b 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -521,8 +521,7 @@ try_bus_reset: | |||
521 | return FAILED; | 521 | return FAILED; |
522 | } | 522 | } |
523 | 523 | ||
524 | static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, | 524 | static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *work_q) |
525 | struct list_head *work_q) | ||
526 | { | 525 | { |
527 | struct scsi_cmnd *cmd, *n; | 526 | struct scsi_cmnd *cmd, *n; |
528 | enum task_disposition res = TASK_IS_DONE; | 527 | enum task_disposition res = TASK_IS_DONE; |
@@ -658,7 +657,7 @@ static int sas_eh_handle_sas_errors(struct Scsi_Host *shost, | |||
658 | out: | 657 | out: |
659 | list_splice_tail(&done, work_q); | 658 | list_splice_tail(&done, work_q); |
660 | list_splice_tail_init(&ha->eh_ata_q, work_q); | 659 | list_splice_tail_init(&ha->eh_ata_q, work_q); |
661 | return list_empty(work_q); | 660 | return; |
662 | 661 | ||
663 | clear_q: | 662 | clear_q: |
664 | SAS_DPRINTK("--- Exit %s -- clear_q\n", __func__); | 663 | SAS_DPRINTK("--- Exit %s -- clear_q\n", __func__); |
@@ -682,10 +681,13 @@ void sas_scsi_recover_host(struct Scsi_Host *shost) | |||
682 | __func__, shost->host_busy, shost->host_failed); | 681 | __func__, shost->host_busy, shost->host_failed); |
683 | /* | 682 | /* |
684 | * Deal with commands that still have SAS tasks (i.e. they didn't | 683 | * Deal with commands that still have SAS tasks (i.e. they didn't |
685 | * complete via the normal sas_task completion mechanism) | 684 | * complete via the normal sas_task completion mechanism), |
685 | * SAS_HA_FROZEN gives eh dominion over all sas_task completion. | ||
686 | */ | 686 | */ |
687 | set_bit(SAS_HA_FROZEN, &ha->state); | 687 | set_bit(SAS_HA_FROZEN, &ha->state); |
688 | if (sas_eh_handle_sas_errors(shost, &eh_work_q)) | 688 | sas_eh_handle_sas_errors(shost, &eh_work_q); |
689 | clear_bit(SAS_HA_FROZEN, &ha->state); | ||
690 | if (list_empty(&eh_work_q)) | ||
689 | goto out; | 691 | goto out; |
690 | 692 | ||
691 | /* | 693 | /* |
@@ -699,7 +701,6 @@ void sas_scsi_recover_host(struct Scsi_Host *shost) | |||
699 | scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q); | 701 | scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q); |
700 | 702 | ||
701 | out: | 703 | out: |
702 | clear_bit(SAS_HA_FROZEN, &ha->state); | ||
703 | if (ha->lldd_max_execute_num > 1) | 704 | if (ha->lldd_max_execute_num > 1) |
704 | wake_up_process(ha->core.queue_thread); | 705 | wake_up_process(ha->core.queue_thread); |
705 | 706 | ||