diff options
| -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 | ||
