diff options
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index ea890911d4fa..01831312c360 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -547,7 +547,7 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
547 | 547 | ||
548 | /* For new EH, all qcs are finished in one of three ways - | 548 | /* For new EH, all qcs are finished in one of three ways - |
549 | * normal completion, error completion, and SCSI timeout. | 549 | * normal completion, error completion, and SCSI timeout. |
550 | * Both cmpletions can race against SCSI timeout. When normal | 550 | * Both completions can race against SCSI timeout. When normal |
551 | * completion wins, the qc never reaches EH. When error | 551 | * completion wins, the qc never reaches EH. When error |
552 | * completion wins, the qc has ATA_QCFLAG_FAILED set. | 552 | * completion wins, the qc has ATA_QCFLAG_FAILED set. |
553 | * | 553 | * |
@@ -562,7 +562,19 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
562 | int nr_timedout = 0; | 562 | int nr_timedout = 0; |
563 | 563 | ||
564 | spin_lock_irqsave(ap->lock, flags); | 564 | spin_lock_irqsave(ap->lock, flags); |
565 | 565 | ||
566 | /* This must occur under the ap->lock as we don't want | ||
567 | a polled recovery to race the real interrupt handler | ||
568 | |||
569 | The lost_interrupt handler checks for any completed but | ||
570 | non-notified command and completes much like an IRQ handler. | ||
571 | |||
572 | We then fall into the error recovery code which will treat | ||
573 | this as if normal completion won the race */ | ||
574 | |||
575 | if (ap->ops->lost_interrupt) | ||
576 | ap->ops->lost_interrupt(ap); | ||
577 | |||
566 | list_for_each_entry_safe(scmd, tmp, &host->eh_cmd_q, eh_entry) { | 578 | list_for_each_entry_safe(scmd, tmp, &host->eh_cmd_q, eh_entry) { |
567 | struct ata_queued_cmd *qc; | 579 | struct ata_queued_cmd *qc; |
568 | 580 | ||
@@ -606,6 +618,9 @@ void ata_scsi_error(struct Scsi_Host *host) | |||
606 | ap->eh_tries = ATA_EH_MAX_TRIES; | 618 | ap->eh_tries = ATA_EH_MAX_TRIES; |
607 | } else | 619 | } else |
608 | spin_unlock_wait(ap->lock); | 620 | spin_unlock_wait(ap->lock); |
621 | |||
622 | /* If we timed raced normal completion and there is nothing to | ||
623 | recover nr_timedout == 0 why exactly are we doing error recovery ? */ | ||
609 | 624 | ||
610 | repeat: | 625 | repeat: |
611 | /* invoke error handler */ | 626 | /* invoke error handler */ |