All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Mark Lord <liml@rtr.ca>
Cc: Jeff Garzik <jgarzik@pobox.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Alan Cox <alan@redhat.com>
Subject: Re: ata_std_qc_defer not good enough for FIS-based switching ?
Date: Tue, 29 Apr 2008 08:11:49 +0900	[thread overview]
Message-ID: <481659B5.7090703@gmail.com> (raw)
In-Reply-To: <48164AE8.4070106@rtr.ca>

Hello, Mark.

Mark Lord wrote:
>> Are there controllers which *can* handle such a mix (ahci, sil24 ?)

Yeap, sil24 can.  ahci can currently only do device based switching but 
ahci 2.0 can do it too.

>> So it looks like a I need a .qc_defer() function which examines all links
>> from the common host port for activity, and then asks for command 
>> deferral
>> when the new command has a different protocol than those that are 
>> outstanding.
>>
>> Weird that none of the other LLDs need this.  Or do they?

So, none of the others needs this.

> This seems (below) to work for sata_mv.  But I still wonder about other 
> LLDs.
> 
> 
> static int mv_qc_defer (struct ata_queued_cmd *qc)
> {
>     struct ata_link *link = qc->dev->link;
>     struct ata_port *ap = link->ap;
>     struct mv_port_priv *pp;
>     int port_is_using_ncq;
> 
>     if (ap->nr_active_links == 0)
>         return 0;
>     pp = ap->private_data;
>     port_is_using_ncq = ((pp->pp_flags & MV_PP_FLAG_NCQ_EN) != 0);
>     if (qc->tf.protocol == ATA_PROT_NCQ) {
>         if (port_is_using_ncq)
>             return ata_std_qc_defer(qc);
>     } else {
>         if (!port_is_using_ncq)
>             return sata_pmp_qc_defer_cmd_switch(qc);
>     }
>     return ATA_DEFER_LINK;
> }

Looks good to me.

Thanks.

-- 
tejun

  reply	other threads:[~2008-04-28 23:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 21:06 ata_std_qc_defer not good enough for FIS-based switching ? Mark Lord
2008-04-28 22:08 ` Mark Lord
2008-04-28 23:11   ` Tejun Heo [this message]
2008-04-28 23:42     ` Mark Lord
2008-04-29  1:18       ` Tejun Heo
2008-04-29  2:26         ` Mark Lord
2008-05-14 14:11           ` Tejun Heo
2008-05-14 14:45             ` Mark Lord
2008-05-14 14:53               ` Mark Lord
2008-05-14 15:50                 ` Mark Lord
2008-05-14 15:59                   ` Mark Lord
2008-05-15  7:12                     ` Tejun Heo
2008-05-15  6:51                 ` Tejun Heo
2008-04-29 17:09     ` Mark Lord
2008-04-29 17:17       ` Mark Lord
2008-04-30  9:38       ` Tejun Heo
2008-04-30 14:02       ` Mark Lord

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=481659B5.7090703@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.