linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: jgarzik@pobox.com, linux-ide@vger.kernel.org
Subject: Re: libata NCQ implementation questions
Date: Tue, 13 May 2008 17:40:21 +0900	[thread overview]
Message-ID: <482953F5.1020503@gmail.com> (raw)
In-Reply-To: <18471.32504.953679.399689@harpo.it.uu.se>

Hello,

Mikael Pettersson wrote:
> I've started working on NCQ support for sata_promise,
> and I have a few questions regarding NCQ and libata:

Great.

> 1. Can I rely not seeing any non-NCQ commands while there
>    are uncompleted NCQ commands on a port?
> 
>    I _believe_, from the comment at ata_std_qc_defer(), that
>    this is the case, but I'd like to get that confirmed.

Yes, you can rely on that.

> 2. Assuming NCQ and non-NCQ commands cannot be mixed, is there
>    a defined way to detect when a port transitions from non-NCQ
>    to NCQ mode and vice versa, or do I have to detect that myself?
> 
>    The mode affects the programming of the Promise SATA "sequence
>    counter control" registers.

There's no defined way.  You'll probably need to add ->last_protocol or 
->was_ncq in LLD private structure.

> 3. Is qc->tag defined (to zero for instance) for non-NCQ commands?
> 
>    For sata_promise NCQ I need to allocate packets and prds from
>    per-port pools indexed by tag. To handle non-NCQ commands it's
>    easiest to assume they map to tag 0, but the code to set a tag
>    conditionally based on qc->tf.protocol is a bit ugly.

For all non-NCQ, non-EH commands, the tag is fixed at 0.

> 4. What are these "internal commands" that map to ATA_TAG_INTERNAL?
>    Are they NCQ or not?
>    Does the existence of ATA_TAG_INTERNAL limit queue depth for NCQ?

Yeah, it reserves tag 31 for EH commands.  We might as well use tag 32 
for EH commands and let LLD map it to whatever tag it can use for EH 
commands but Jeff didn't like using all the tags as it makes 0xffffffff 
a valid status value.

Note that depending on LLD implementation, you might want to remap tag 
31 to different hardware tag.  sata_sil24 does this mainly because it 
made polled execution implementation easier.

Thanks.

-- 
tejun

  parent reply	other threads:[~2008-05-13  8:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 23:19 libata NCQ implementation questions Mikael Pettersson
2008-05-12  4:05 ` Grant Grundler
2008-05-12 12:22   ` Mikael Pettersson
2008-05-12 15:58 ` Mark Lord
2008-05-12 19:17   ` Mikael Pettersson
2008-05-13  8:32     ` Tejun Heo
2008-05-13 21:01       ` Mark Lord
2008-05-13  8:40 ` Tejun Heo [this message]
2008-05-13  9:25   ` Mikael Pettersson

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=482953F5.1020503@gmail.com \
    --to=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    /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).