linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Mark Lord <mlord@pobox.com>
Cc: IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: What's needed for PMP support?
Date: Tue, 13 Nov 2007 10:09:09 +0900	[thread overview]
Message-ID: <4738F935.1000708@gmail.com> (raw)
In-Reply-To: <4738827D.9060405@pobox.com>

(cc'd linux-ide and changed subject a bit)

Hello,

Mark Lord wrote:
> Can you spare a minute to udpate me on what is typically needed to get
> a SATA driver to support port multipliers ?

Sure thing.

> And which LLDs currently have it already?
> I have a sata_sil24 driven ExpressCard (for notebook) here that I may
> try out..

Currently only two driver support PMP.  One is sata_sil24 and the other
is ahci.  sata_sil24 supports FIS-based switching while ahci only
supports command based switching.

The following things are needed for a LLD to support PMP.

1. PMP aware reset sequence.  The controller must issue hardreset first,
followed by softreset with PMP==15.  The first part is automatically
done if the LLD tells libata that you support PMP by setting ATA_FLAG_PMP.

2. Reset methods for downstream ports.  A LLD needs prereset, hardreset,
softreset and postreset for downstream ports.  sata_pmp_std_prereset(),
sata_pmp_std_hardreset() and sata_pmp_std_postreset() can be used
without any modification unless the controller is really weird.  The
only thing a LLD has to implement is pmp_softreset method which does the
same SRST protocol as regular softreset but with SRST set to link->pmp.

3. An error handler to combine all methods from #1 and #2.  The error
handler should call sata_pmp_do_eh() with methods from #1 and #2.

4. PMP aware command issue.  qc_prep and qc_issue should be modified
such that when it issues commands via H2D Reg FIS, it sets the PMP field
according to qc->dev->link->pmp.

5. qc_defer method.  Use sata_pmp_qc_defer_cmd_switch() if it's command
based switching.  ata_std_qc_defer() can be used if the controller is
FIS based switching without any further restriction.

6. PMP aware irq / error handling.  The irq handler should be able to
handle completions for different ports.  There doesn't need to be much
change for command switching.  Error triggering / handling needs to be
updated too.  Again, cmd-based switching won't need too much change.
One thing to note is to attribute errors to the correct link (e.g. link
errors detected by host should be recorded to ehi of the upstream link
while any error condition triggered by the device should probably be
attributed to downstream link.)

I think that's about it.  Feel free to ask if something isn't clear.

Thanks.

-- 
tejun

  parent reply	other threads:[~2007-11-13  1:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 21:56 only one drive in a port multiplier system is being recognized Greg Hennessy
2007-11-12  2:58 ` Tejun Heo
     [not found]   ` <4738827D.9060405@pobox.com>
2007-11-13  1:09     ` Tejun Heo [this message]
2008-02-20 19:03       ` What's needed for PMP support? Mark Lord
2008-02-21  3:39         ` Tejun Heo
2008-02-21 15:07           ` Mark Lord
2008-02-21 20:52             ` [PATCH] libata-pmp: clear hob for pmp register accesses Mark Lord
2008-02-21 21:51               ` saeed bishara
2008-02-22  1:40               ` Tejun Heo
2008-02-24  5:29               ` Jeff Garzik
2008-02-22  0:31         ` What's needed for PMP support? Mark Lord
2008-02-22  0:32           ` Mark Lord
2008-02-22  1:57             ` Tejun Heo
2008-02-22  2:04               ` Mark Lord
2008-02-22  2:12                 ` Tejun Heo
2008-02-22  2:25                   ` Mark Lord
2008-02-22  2:27                     ` Mark Lord
2008-02-22  3:52                       ` Mark Lord
2008-02-22  4:22                         ` new ata_port_operations for .pmp_{read,write} ? Mark Lord
2008-02-22 14:23                           ` Mark Lord
2008-02-22 14:28                             ` Mark Lord
2008-02-23  0:38                               ` Mark Lord
2008-02-23  2:49                                 ` Tejun Heo
2008-02-23  2:43                             ` Tejun Heo
2008-02-23  2:59                               ` Jeff Garzik
2008-02-23  5:15                             ` Mark Lord
2008-02-24  7:03                               ` Tejun Heo
2008-02-24  7:14                                 ` Jeff Garzik
2008-02-25  4:34                                   ` Mark Lord
2008-02-25  4:46                                     ` Jeff Garzik
2008-02-25  4:31                                 ` Mark Lord
2008-02-25  4:49                                 ` Mark Lord
2008-02-25  4:56                                   ` Jeff Garzik
2008-02-25  5:20                                   ` Tejun Heo
2008-02-25 16:55                                     ` Mark Lord
2008-02-25 23:44                                       ` Tejun Heo
2008-02-26  0:12                                         ` Mark Lord
2008-02-26  2:01                                           ` Tejun Heo
2008-02-22  9:57             ` What's needed for PMP support? Alan Cox

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=4738F935.1000708@gmail.com \
    --to=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=mlord@pobox.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).