aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-scsi.c4
-rw-r--r--include/linux/ata.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index b9d3ba423cb2..054370700abf 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -977,6 +977,10 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
977 977
978 blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); 978 blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
979 } else { 979 } else {
980 if (ata_id_is_ssd(dev->id))
981 queue_flag_set_unlocked(QUEUE_FLAG_NONROT,
982 sdev->request_queue);
983
980 /* ATA devices must be sector aligned */ 984 /* ATA devices must be sector aligned */
981 blk_queue_update_dma_alignment(sdev->request_queue, 985 blk_queue_update_dma_alignment(sdev->request_queue,
982 ATA_SECT_SIZE - 1); 986 ATA_SECT_SIZE - 1);
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 8a12d718c169..c1c8b4a4ba26 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -88,6 +88,7 @@ enum {
88 ATA_ID_DLF = 128, 88 ATA_ID_DLF = 128,
89 ATA_ID_CSFO = 129, 89 ATA_ID_CSFO = 129,
90 ATA_ID_CFA_POWER = 160, 90 ATA_ID_CFA_POWER = 160,
91 ATA_ID_ROT_SPEED = 217,
91 ATA_ID_PIO4 = (1 << 1), 92 ATA_ID_PIO4 = (1 << 1),
92 93
93 ATA_ID_SERNO_LEN = 20, 94 ATA_ID_SERNO_LEN = 20,
@@ -691,6 +692,11 @@ static inline int ata_id_is_cfa(const u16 *id)
691 return 0; 692 return 0;
692} 693}
693 694
695static inline int ata_id_is_ssd(const u16 *id)
696{
697 return id[ATA_ID_ROT_SPEED] == 0x01;
698}
699
694static inline int ata_drive_40wire(const u16 *dev_id) 700static inline int ata_drive_40wire(const u16 *dev_id)
695{ 701{
696 if (ata_id_is_sata(dev_id)) 702 if (ata_id_is_sata(dev_id))