Commit f58db802 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: fix revalidation issuing after configuration commands

After commands which can change device configuration, EH is scheduled
to revalidate and reconfigure the device.  Host link was incorrectly
used unconditionally when scheduling EH action.  This resulted in
bogus revalidation request and mismatched configuration between device
and driver.  Fix it.

This bug was reported by Igor Durdanovic.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Cc: Igor Durdanovic <idurdanovic@comcast.net>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f140f0f1
...@@ -1363,6 +1363,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc) ...@@ -1363,6 +1363,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc)
static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
{ {
struct ata_port *ap = qc->ap; struct ata_port *ap = qc->ap;
struct ata_eh_info *ehi = &qc->dev->link->eh_info;
struct scsi_cmnd *cmd = qc->scsicmd; struct scsi_cmnd *cmd = qc->scsicmd;
u8 *cdb = cmd->cmnd; u8 *cdb = cmd->cmnd;
int need_sense = (qc->err_mask != 0); int need_sense = (qc->err_mask != 0);
...@@ -1376,14 +1377,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) ...@@ -1376,14 +1377,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
case ATA_CMD_SET_FEATURES: case ATA_CMD_SET_FEATURES:
if ((qc->tf.feature == SETFEATURES_WC_ON) || if ((qc->tf.feature == SETFEATURES_WC_ON) ||
(qc->tf.feature == SETFEATURES_WC_OFF)) { (qc->tf.feature == SETFEATURES_WC_OFF)) {
ap->link.eh_info.action |= ATA_EH_REVALIDATE; ehi->action |= ATA_EH_REVALIDATE;
ata_port_schedule_eh(ap); ata_port_schedule_eh(ap);
} }
break; break;
case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */ case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */
case ATA_CMD_SET_MULTI: /* multi_count changed */ case ATA_CMD_SET_MULTI: /* multi_count changed */
ap->link.eh_info.action |= ATA_EH_REVALIDATE; ehi->action |= ATA_EH_REVALIDATE;
ata_port_schedule_eh(ap); ata_port_schedule_eh(ap);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment