linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Marc C <marc.ceeeee@gmail.com>
Cc: linux-ide@vger.kernel.org, sergei.shtylyov@cogentembedded.com
Subject: Re: [PATCH v3 3/3] libata: Add support for queued DSM TRIM
Date: Fri, 9 Aug 2013 10:08:40 -0400	[thread overview]
Message-ID: <20130809140840.GC20515@mtj.dyndns.org> (raw)
In-Reply-To: <1376023752-3105-4-git-send-email-marc.ceeeee@gmail.com>

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

  parent reply	other threads:[~2013-08-09 14:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  4:49 [PATCH v3 0/3] Introduce new SATA queued commands Marc C
2013-08-09  4:49 ` [PATCH v3 1/3] libata: Populate host-to-device FIS "auxiliary" field Marc C
2013-08-09 14:03   ` Tejun Heo
2013-08-09 14:36     ` Sergei Shtylyov
2013-08-09 14:53       ` Tejun Heo
2013-08-09 21:39         ` Sergei Shtylyov
2013-08-09 21:51           ` Tejun Heo
2013-08-09 22:17             ` Sergei Shtylyov
2013-08-09 22:26               ` Tejun Heo
2013-08-10 21:59                 ` Sergei Shtylyov
2013-08-12 13:58                   ` Tejun Heo
2013-08-09 21:24     ` Sergei Shtylyov
2013-08-09 14:17   ` Sergei Shtylyov
2013-08-09 14:29     ` Sergei Shtylyov
2013-08-09 14:26   ` Sergei Shtylyov
2013-08-09  4:49 ` [PATCH v3 2/3] libata: Add support for SEND/RECEIVE FPDMA QUEUED Marc C
2013-08-09 14:05   ` Tejun Heo
2013-08-10  2:10     ` Marc C
2013-08-09  4:49 ` [PATCH v3 3/3] libata: Add support for queued DSM TRIM Marc C
2013-08-09 14:07   ` Sergei Shtylyov
2013-08-09 14:08   ` Tejun Heo [this message]
2013-08-10  2:14     ` Marc C
2013-08-10 15:11       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130809140840.GC20515@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=marc.ceeeee@gmail.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).