From 87fb6c31b9ef9ccab9a822b01fc3911f026a29bb Mon Sep 17 00:00:00 2001 From: Marc Carino Date: Sat, 24 Aug 2013 23:22:51 -0700 Subject: libata: Add support for queued DSM TRIM Some new SSDs support the queued version of the DSM TRIM command. Let the driver use the new command if supported. Signed-off-by: Marc Carino Signed-off-by: Tejun Heo --- include/linux/libata.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/libata.h') diff --git a/include/linux/libata.h b/include/linux/libata.h index a988c2d7d0e8..0e23c26485f4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1606,6 +1606,13 @@ static inline int ata_ncq_enabled(struct ata_device *dev) ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; } +static inline bool ata_fpdma_dsm_supported(struct ata_device *dev) +{ + return (dev->flags & ATA_DFLAG_NCQ_SEND_RECV) && + (dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] & + ATA_LOG_NCQ_SEND_RECV_DSM_TRIM); +} + static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) { qc->tf.ctl |= ATA_NIEN; -- cgit v1.2.3