linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 18/18] [PATCH] libata-link: update Power Management to handle PMP links
Date: Mon, 16 Oct 2006 07:54:42 +0900	[thread overview]
Message-ID: <11609528823596-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <1160952879581-git-send-email-htejun@gmail.com>

Update Power Management to consider PMP links.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-core.c |   20 +++++++++++++-------
 drivers/ata/libata-eh.c   |   16 ++++++++++------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index cc21698..0c94b65 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5195,6 +5195,7 @@ static int ata_host_request_pm(struct at
 
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
+		struct ata_link *link;
 
 		/* Previous resume operation might still be in
 		 * progress.  Wait for PM_PENDING to clear.
@@ -5214,8 +5215,10 @@ static int ata_host_request_pm(struct at
 		}
 
 		ap->pflags |= ATA_PFLAG_PM_PENDING;
-		ap->link.eh_info.action |= action;
-		ap->link.eh_info.flags |= ehi_flags;
+		__ata_port_for_each_link(link, ap) {
+			link->eh_info.action |= action;
+			link->eh_info.flags |= ehi_flags;
+		}
 
 		ata_port_schedule_eh(ap);
 
@@ -5262,15 +5265,18 @@ int ata_host_suspend(struct ata_host *ho
 	 */
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap = host->ports[i];
+		struct ata_link *link;
 		struct ata_device *dev;
 
-		ata_link_for_each_dev(dev, &ap->link) {
-			if (ata_dev_ready(dev)) {
-				ata_port_printk(ap, KERN_WARNING,
+		ata_port_for_each_link(link, ap) {
+			ata_link_for_each_dev(dev, link) {
+				if (ata_dev_ready(dev)) {
+					ata_port_printk(ap, KERN_WARNING,
 						"suspend failed, device %d "
 						"still active\n", dev->devno);
-				rc = -EBUSY;
-				goto fail;
+					rc = -EBUSY;
+					goto fail;
+				}
 			}
 		}
 	}
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 1389a1f..ead460b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2378,17 +2378,21 @@ static void ata_eh_handle_port_resume(st
 	/* give devices time to request EH */
 	timeout = jiffies + HZ; /* 1s max */
 	while (1) {
+		struct ata_link *link;
 		struct ata_device *dev;
 
-		ata_link_for_each_dev(dev, &ap->link) {
-			unsigned int action = ata_eh_dev_action(dev);
+		ata_port_for_each_link(link, ap) {
+			ata_link_for_each_dev(dev, link) {
+				unsigned int action = ata_eh_dev_action(dev);
 
-			if ((dev->flags & ATA_DFLAG_SUSPENDED) &&
-			    !(action & ATA_EH_RESUME))
-				break;
+				if ((dev->flags & ATA_DFLAG_SUSPENDED) &&
+				    !(action & ATA_EH_RESUME))
+					goto out_of_loop;
+			}
 		}
+	out_of_loop:
 
-		if (dev == NULL || time_after(jiffies, timeout))
+		if (link == NULL || time_after(jiffies, timeout))
 			break;
 		msleep(10);
 	}
-- 
1.4.2.3



  parent reply	other threads:[~2006-10-15 22:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-15 22:54 [PATCHSET] implement ata_link, take 3 Tejun Heo
2006-10-15 22:54 ` [PATCH 1/18] [PATCH] libata: generate hotplug event on SError read failure Tejun Heo
2006-10-15 22:54 ` [PATCH 5/18] [PATCH] libata-link: implement and use link/device iterators Tejun Heo
2006-10-15 22:54 ` [PATCH 3/18] [PATCH] libata-link: add PMP related ATA constants Tejun Heo
2006-10-15 22:54 ` [PATCH 9/18] [PATCH] libata-link: linkify config/EH related functions Tejun Heo
2006-10-15 22:54 ` [PATCH 6/18] [PATCH] libata-link: linkify PHY-related functions Tejun Heo
2006-10-15 22:54 ` [PATCH 10/18] [PATCH] libata-link: separate out link initialization functions Tejun Heo
2006-11-01  2:26   ` Jeff Garzik
2006-10-15 22:54 ` [PATCH 2/18] [PATCH] libata-link: separate out ata_eh_handle_dev_fail() Tejun Heo
2006-10-15 22:54 ` [PATCH 4/18] [PATCH] libata-link: introduce ata_link Tejun Heo
2006-10-15 22:54 ` [PATCH 8/18] [PATCH] libata-link: linkify reset Tejun Heo
2006-10-15 22:54 ` [PATCH 7/18] [PATCH] libata-link: linkify EH action helpers Tejun Heo
2006-10-15 22:54 ` [PATCH 11/18] [PATCH] libata-link: implement link->reset_tries Tejun Heo
2006-10-15 22:54 ` [PATCH 14/18] [PATCH] libata-link: update ata_scsi_error() to handle PMP links Tejun Heo
2006-10-15 22:54 ` [PATCH 13/18] [PATCH] libata-link: add " Tejun Heo
2006-10-15 22:54 ` [PATCH 12/18] [PATCH] libata-link: implement ata_link_abort() Tejun Heo
2006-10-15 22:54 ` Tejun Heo [this message]
2006-10-15 22:54 ` [PATCH 16/18] [PATCH] libata-link: update EH to deal with PMP links Tejun Heo
2006-10-15 22:54 ` [PATCH 17/18] [PATCH] libata-link: update hotplug to handle " Tejun Heo
2006-10-15 22:54 ` [PATCH 15/18] [PATCH] libata-link: update ata_dev_configure() to deal with " Tejun Heo
2006-10-15 22:56 ` [PATCHSET] implement ata_link, take 3 Tejun Heo
2006-11-01  2:26 ` 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=11609528823596-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jgarzik@pobox.com \
    --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).