linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-ide@vger.kernel.org, Forrest Zhao <forrest.zhao@gmail.com>
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 14/15] ahci: separate out ahci_do_softreset()
Date: Sun, 1 Jul 2007 19:54:16 +0900	[thread overview]
Message-ID: <11832872562351-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1183287253677-git-send-email-htejun@gmail.com>

Separate out ahci_do_softreset() which takes @pmp as its last
argument.  This will be used to implement ahci_pmp_softreset().

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/ahci.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index d25cee8..94bb767 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -998,8 +998,8 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
 	return 0;
 }
 
-static int ahci_softreset(struct ata_link *link, unsigned int *class,
-			  unsigned long deadline)
+static int ahci_do_softreset(struct ata_link *link, unsigned int *class,
+			     int pmp, unsigned long deadline)
 {
 	struct ata_port *ap = link->ap;
 	const char *reason = NULL;
@@ -1030,7 +1030,7 @@ static int ahci_softreset(struct ata_link *link, unsigned int *class,
 		msecs = jiffies_to_msecs(deadline - now);
 
 	tf.ctl |= ATA_SRST;
-	if (ahci_exec_polled_cmd(ap, 0, &tf, 0,
+	if (ahci_exec_polled_cmd(ap, pmp, &tf, 0,
 				 AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) {
 		rc = -EIO;
 		reason = "1st FIS failed";
@@ -1042,7 +1042,7 @@ static int ahci_softreset(struct ata_link *link, unsigned int *class,
 
 	/* issue the second D2H Register FIS */
 	tf.ctl &= ~ATA_SRST;
-	ahci_exec_polled_cmd(ap, 0, &tf, 0, 0, 0);
+	ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);
 
 	/* spec mandates ">= 2ms" before checking status.
 	 * We wait 150ms, because that was the magic delay used for
@@ -1070,6 +1070,17 @@ static int ahci_softreset(struct ata_link *link, unsigned int *class,
 	return rc;
 }
 
+static int ahci_softreset(struct ata_link *link, unsigned int *class,
+			  unsigned long deadline)
+{
+	int pmp = 0;
+
+	if (link->ap->flags & ATA_FLAG_PMP)
+		pmp = SATA_PMP_CTRL_PORT;
+
+	return ahci_do_softreset(link, class, pmp, deadline);
+}
+
 static int ahci_hardreset(struct ata_link *link, unsigned int *class,
 			  unsigned long deadline)
 {
-- 
1.5.0.3



  parent reply	other threads:[~2007-07-01 10:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01 10:54 [PATCHSET 4/4] implement PMP support, take 4 Tejun Heo
2007-07-01 10:54 ` [PATCH 01/15] libata-pmp: update ata_eh_reset() for PMP Tejun Heo
2007-07-01 10:54 ` [PATCH 02/15] libata-pmp: implement Port Multiplier support Tejun Heo
2007-07-01 10:54 ` [PATCH 03/15] libata-pmp: hook PMP support and enable it Tejun Heo
2007-07-01 10:54 ` [PATCH 04/15] libata-pmp: extend ACPI support to cover PMP Tejun Heo
2007-07-12 20:24   ` Jeff Garzik
2007-07-13  3:05     ` Tejun Heo
2007-07-01 10:54 ` [PATCH 09/15] sata_sil24: implement PORT_RST Tejun Heo
2007-07-01 10:54 ` [PATCH 08/15] sata_sil24: implement PMP support Tejun Heo
2007-07-01 10:54 ` [PATCH 07/15] sata_sil24: separate out sil24_do_softreset() Tejun Heo
2007-07-12 20:26   ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 06/15] sata_sil24: separate out sil24_exec_polled_cmd() Tejun Heo
2007-07-12 20:25   ` Jeff Garzik
2007-07-13  3:06     ` Tejun Heo
2007-07-01 10:54 ` [PATCH 05/15] sata_sil24: replace sil24_update_tf() with sil24_read_tf() Tejun Heo
2007-07-01 10:54 ` Tejun Heo [this message]
2007-07-12 20:26   ` [PATCH 14/15] ahci: separate out ahci_do_softreset() Jeff Garzik
2007-07-01 10:54 ` [PATCH 12/15] ahci: separate out ahci_kick_engine() Tejun Heo
2007-07-12 20:26   ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 10/15] libata-pmp: implement qc_defer for command switching PMP support Tejun Heo
2007-07-01 10:54 ` [PATCH 11/15] ahci: use deadline instead of fixed timeout for 1st FIS for SRST Tejun Heo
2007-07-01 10:54 ` [PATCH 13/15] ahci: separate out ahci_exec_polled_cmd() Tejun Heo
2007-07-12 20:26   ` Jeff Garzik
2007-07-01 10:54 ` [PATCH 15/15] ahci: implement PMP support Tejun Heo
2007-07-03  7:39 ` [PATCHSET 4/4] implement PMP support, take 4 Jim Paris
2007-07-03  9:34   ` Tejun Heo
2007-07-03 19:40     ` Jim Paris
2007-07-12 20:27 ` Jeff Garzik

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=11832872562351-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=forrest.zhao@gmail.com \
    --cc=jeff@garzik.org \
    --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 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).