Skip to content

Commit

Permalink
[PATCH] libata: enforce default EH actions
Browse files Browse the repository at this point in the history
LLDDs rely on libata that certain EH actions are automatically taken
on some errors.  If the port is frozen or one or more qc's have failed
with HSM violation or timeout, softreset is enforced (LLDD can ask for
storonger EH action at will).  If any other error condition exists,
libata EH always revalidates.

This behavior existed in earlier revisions of new EH but lost during
development process.  This patch restores it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed May 20, 2006
1 parent eec4c3f commit a20f33f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/scsi/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,6 @@ static void ata_eh_autopsy(struct ata_port *ap)
/* inherit upper level err_mask */
qc->err_mask |= ehc->i.err_mask;

if (qc->err_mask & AC_ERR_TIMEOUT)
action |= ATA_EH_SOFTRESET;

/* analyze TF */
action |= ata_eh_analyze_tf(qc, &qc->result_tf);

Expand Down Expand Up @@ -1201,9 +1198,14 @@ static void ata_eh_autopsy(struct ata_port *ap)
if (failed_dev)
action |= ata_eh_speed_down(failed_dev, is_io, all_err_mask);

if (all_err_mask)
/* enforce default EH actions */
if (ap->flags & ATA_FLAG_FROZEN ||
all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
action |= ATA_EH_SOFTRESET;
else if (all_err_mask)
action |= ATA_EH_REVALIDATE;

/* record autopsy result */
ehc->i.dev = failed_dev;
ehc->i.action = action;

Expand Down

0 comments on commit a20f33f

Please sign in to comment.