diff options
author | Tejun Heo <htejun@gmail.com> | 2006-11-21 22:39:43 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-11-28 03:45:13 -0500 |
commit | c31f571d9f42fa2e89148811730fe3dc64943a6e (patch) | |
tree | 0b2be4fe17824d8dc89e9c838e9f8ff934472504 | |
parent | 2ea5814472c3c910aed5c5b60f1f3b1000e353f1 (diff) |
[PATCH] libata: don't schedule EH on wcache on/off if old EH
Do not schedule EH for revalidation on wcache on/off if old EH. Old
EH cannot handle it and will result in WARN_ON()'s and oops.
This closes bug #7412.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-scsi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 5c1fc467fc7f..22643c0d9a56 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1451,6 +1451,7 @@ nothing_to_do: | |||
1451 | 1451 | ||
1452 | static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | 1452 | static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) |
1453 | { | 1453 | { |
1454 | struct ata_port *ap = qc->ap; | ||
1454 | struct scsi_cmnd *cmd = qc->scsicmd; | 1455 | struct scsi_cmnd *cmd = qc->scsicmd; |
1455 | u8 *cdb = cmd->cmnd; | 1456 | u8 *cdb = cmd->cmnd; |
1456 | int need_sense = (qc->err_mask != 0); | 1457 | int need_sense = (qc->err_mask != 0); |
@@ -1459,11 +1460,12 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1459 | * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE | 1460 | * schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE |
1460 | * cache | 1461 | * cache |
1461 | */ | 1462 | */ |
1462 | if (!need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) && | 1463 | if (ap->ops->error_handler && |
1464 | !need_sense && (qc->tf.command == ATA_CMD_SET_FEATURES) && | ||
1463 | ((qc->tf.feature == SETFEATURES_WC_ON) || | 1465 | ((qc->tf.feature == SETFEATURES_WC_ON) || |
1464 | (qc->tf.feature == SETFEATURES_WC_OFF))) { | 1466 | (qc->tf.feature == SETFEATURES_WC_OFF))) { |
1465 | qc->ap->eh_info.action |= ATA_EH_REVALIDATE; | 1467 | ap->eh_info.action |= ATA_EH_REVALIDATE; |
1466 | ata_port_schedule_eh(qc->ap); | 1468 | ata_port_schedule_eh(ap); |
1467 | } | 1469 | } |
1468 | 1470 | ||
1469 | /* For ATA pass thru (SAT) commands, generate a sense block if | 1471 | /* For ATA pass thru (SAT) commands, generate a sense block if |
@@ -1490,8 +1492,8 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1490 | } | 1492 | } |
1491 | } | 1493 | } |
1492 | 1494 | ||
1493 | if (need_sense && !qc->ap->ops->error_handler) | 1495 | if (need_sense && !ap->ops->error_handler) |
1494 | ata_dump_status(qc->ap->id, &qc->result_tf); | 1496 | ata_dump_status(ap->id, &qc->result_tf); |
1495 | 1497 | ||
1496 | qc->scsidone(cmd); | 1498 | qc->scsidone(cmd); |
1497 | 1499 | ||