Update ata_scsi_error() such that ->error_handler is invoked if implemented. ata_scsi_error() also takes care of merging ATA_QCFLAG_TIMEOUT into qc->err_mask and clearing SCSI EH conditions. Signed-off-by: Tejun Heo <htejun@xxxxxxxxx> --- drivers/scsi/libata-eh.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) 3548a7477edb501d6680730c69f5a5913b81af8b diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index 0a3d832..dfbb8c4 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c @@ -130,12 +130,29 @@ int ata_scsi_error(struct Scsi_Host *hos spin_unlock_wait(&ap->host_set->lock); ata_port_flush_task(ap); - WARN_ON(ata_qc_from_tag(ap, ap->active_tag) == NULL); + /* invoke error handler */ + if (ap->ops->error_handler) { + int i; + + /* for new EH, all the qc's are ours now */ + for (i = 0; i < ATA_MAX_QUEUE; i++) { + struct ata_queued_cmd *qc; + qc = __ata_qc_from_tag(ap, i); + if (qc->flags & ATA_QCFLAG_TIMEOUT) + qc->err_mask |= AC_ERR_TIMEOUT;; + } - ap->ops->eng_timeout(ap); + ap->ops->error_handler(ap); + } else { + WARN_ON(ata_qc_from_tag(ap, ap->active_tag) == NULL); + ap->ops->eng_timeout(ap); + } WARN_ON(host->host_failed || !list_empty(&host->eh_cmd_q)); + /* finish or retry handled qc's and clean up */ + host->host_eh_scheduled = 0; + scsi_eh_flush_done_q(&ap->eh_done_q); DPRINTK("EXIT\n"); -- 1.2.4 - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html