Re: [PATCH v3 3/3] libata: Add support for queued DSM TRIM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Thu, Aug 08, 2013 at 09:49:12PM -0700, Marc C wrote:
> +	if (ata_ncq_enabled(dev) &&
> +	    (dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] &
> +	     ATA_LOG_NCQ_SEND_RECV_DSM_TRIM)) {

Can you add a feature test macro for this?

> +		/* Newer devices support queued TRIM commands */
> +		tf->protocol = ATA_PROT_NCQ;
> +		tf->command = ATA_CMD_FPDMA_SEND;
> +		tf->hob_nsect = ATA_SUBCMD_FPDMA_SEND_DSM & 0x1f;
> +		tf->nsect = qc->tag << 3;
> +		tf->hob_feature = (size / 512) >> 8;
> +		tf->feature = size / 512;
> +
> +		qc->auxiliary = 1;
> +	} else {
> +		tf->protocol = ATA_PROT_DMA;
> +		tf->hob_feature = 0;
> +		tf->feature = ATA_DSM_TRIM;
> +		tf->hob_nsect = (size / 512) >> 8;
> +		tf->nsect = size / 512;
> +		tf->command = ATA_CMD_DSM;

So, there are controllers which actually look at the command code and
thus will choke on new commands and just looking at whether the device
supports the new commands is likely to be insufficient.  Have you
tested this?  If so, on which controllers / devices?  We're likely to
need whitelisting on controller side, I think.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux