diff options
-rw-r--r-- | drivers/ata/libata-scsi.c | 9 | ||||
-rw-r--r-- | include/linux/libata.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 07b5a3d4ed21..b6a1de8fad5b 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -967,6 +967,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) | |||
967 | * for more info. | 967 | * for more info. |
968 | */ | 968 | */ |
969 | if (ata_spindown_compat && | 969 | if (ata_spindown_compat && |
970 | (qc->dev->flags & ATA_DFLAG_SPUNDOWN) && | ||
970 | (system_state == SYSTEM_HALT || | 971 | (system_state == SYSTEM_HALT || |
971 | system_state == SYSTEM_POWER_OFF)) { | 972 | system_state == SYSTEM_POWER_OFF)) { |
972 | static unsigned long warned = 0; | 973 | static unsigned long warned = 0; |
@@ -1394,6 +1395,14 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1394 | } | 1395 | } |
1395 | } | 1396 | } |
1396 | 1397 | ||
1398 | /* XXX: track spindown state for spindown_compat */ | ||
1399 | if (unlikely(qc->tf.command == ATA_CMD_STANDBY || | ||
1400 | qc->tf.command == ATA_CMD_STANDBYNOW1)) | ||
1401 | qc->dev->flags |= ATA_DFLAG_SPUNDOWN; | ||
1402 | else if (likely(system_state != SYSTEM_HALT && | ||
1403 | system_state != SYSTEM_POWER_OFF)) | ||
1404 | qc->dev->flags &= ~ATA_DFLAG_SPUNDOWN; | ||
1405 | |||
1397 | if (need_sense && !ap->ops->error_handler) | 1406 | if (need_sense && !ap->ops->error_handler) |
1398 | ata_dump_status(ap->print_id, &qc->result_tf); | 1407 | ata_dump_status(ap->print_id, &qc->result_tf); |
1399 | 1408 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 9b2122db30ff..666592ef0b25 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -140,6 +140,7 @@ enum { | |||
140 | 140 | ||
141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ | 141 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ | 142 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ |
143 | ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */ | ||
143 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 144 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
144 | 145 | ||
145 | ATA_DFLAG_DETACH = (1 << 16), | 146 | ATA_DFLAG_DETACH = (1 << 16), |