mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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 <marc.ceeeee@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
ed36911c74
commit
87fb6c31b9
2 changed files with 26 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue