aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index a1a6e6298c33..b9747fa59e54 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -46,6 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47#include <linux/hdreg.h> 47#include <linux/hdreg.h>
48#include <linux/uaccess.h> 48#include <linux/uaccess.h>
49#include <linux/suspend.h>
49 50
50#include "libata.h" 51#include "libata.h"
51 52
@@ -414,6 +415,7 @@ int ata_std_bios_param(struct scsi_device *sdev, struct block_device *bdev,
414 415
415/** 416/**
416 * ata_get_identity - Handler for HDIO_GET_IDENTITY ioctl 417 * ata_get_identity - Handler for HDIO_GET_IDENTITY ioctl
418 * @ap: target port
417 * @sdev: SCSI device to get identify data for 419 * @sdev: SCSI device to get identify data for
418 * @arg: User buffer area for identify data 420 * @arg: User buffer area for identify data
419 * 421 *
@@ -1303,6 +1305,17 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
1303 1305
1304 tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ 1306 tf->command = ATA_CMD_VERIFY; /* READ VERIFY */
1305 } else { 1307 } else {
1308 /* Some odd clown BIOSen issue spindown on power off (ACPI S4
1309 * or S5) causing some drives to spin up and down again.
1310 */
1311 if ((qc->ap->flags & ATA_FLAG_NO_POWEROFF_SPINDOWN) &&
1312 system_state == SYSTEM_POWER_OFF)
1313 goto skip;
1314
1315 if ((qc->ap->flags & ATA_FLAG_NO_HIBERNATE_SPINDOWN) &&
1316 system_entering_hibernation())
1317 goto skip;
1318
1306 /* XXX: This is for backward compatibility, will be 1319 /* XXX: This is for backward compatibility, will be
1307 * removed. Read Documentation/feature-removal-schedule.txt 1320 * removed. Read Documentation/feature-removal-schedule.txt
1308 * for more info. 1321 * for more info.
@@ -1326,8 +1339,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
1326 scmd->scsi_done = qc->scsidone; 1339 scmd->scsi_done = qc->scsidone;
1327 qc->scsidone = ata_delayed_done; 1340 qc->scsidone = ata_delayed_done;
1328 } 1341 }
1329 scmd->result = SAM_STAT_GOOD; 1342 goto skip;
1330 return 1;
1331 } 1343 }
1332 1344
1333 /* Issue ATA STANDBY IMMEDIATE command */ 1345 /* Issue ATA STANDBY IMMEDIATE command */
@@ -1343,10 +1355,13 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc)
1343 1355
1344 return 0; 1356 return 0;
1345 1357
1346invalid_fld: 1358 invalid_fld:
1347 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0); 1359 ata_scsi_set_sense(scmd, ILLEGAL_REQUEST, 0x24, 0x0);
1348 /* "Invalid field in cbd" */ 1360 /* "Invalid field in cbd" */
1349 return 1; 1361 return 1;
1362 skip:
1363 scmd->result = SAM_STAT_GOOD;
1364 return 1;
1350} 1365}
1351 1366
1352 1367