All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@suse.cz>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Tejun Heo <tj@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Jeff Garzik <jeff@garzik.org>
Subject: [PATCH -mm 2/8] AHCI: Speed-up resume
Date: Thu, 10 Jul 2008 01:58:48 +0200	[thread overview]
Message-ID: <200807100158.49341.rjw@sisk.pl> (raw)
In-Reply-To: <200807100152.17755.rjw@sisk.pl>

From: Zhang Rui <rui.zhang@intel.com>
Subject: AHCI: Speed-up resume

During resume, sleep 1 second to wait for the HBA reset
to finish is a waste of time.

According to the AHCI 1.2 spec,
We should poll the HOST_CTL register,
and return error if the host reset is not
finished within 1 second.

Test results show that the HBA reset can be done quickly(in usecs).
And this patch may save nearly 1 second during resume.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
--
 drivers/ata/ahci.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-next/drivers/ata/ahci.c
===================================================================
--- linux-next.orig/drivers/ata/ahci.c
+++ linux-next/drivers/ata/ahci.c
@@ -1142,12 +1142,15 @@ static int ahci_reset_controller(struct 
 			readl(mmio + HOST_CTL); /* flush */
 		}
 
-		/* reset must complete within 1 second, or
+		/*
+		 * to perform host reset, OS should set HOST_RESET
+		 * and poll until this bit is read to be "0".
+		 * reset must complete within 1 second, or
 		 * the hardware should be considered fried.
 		 */
-		ssleep(1);
+		tmp = ata_wait_register(mmio + HOST_CTL, HOST_RESET,
+					HOST_RESET, 10, 1000);
 
-		tmp = readl(mmio + HOST_CTL);
 		if (tmp & HOST_RESET) {
 			dev_printk(KERN_ERR, host->dev,
 				   "controller reset failed (0x%x)\n", tmp);


  parent reply	other threads:[~2008-07-10  0:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 23:52 [PATCH -mm 0/8] PM patches for 2.6.27 Rafael J. Wysocki
2008-07-09 23:55 ` [PATCH -mm 1/8] PM: Add new PM_EVENT codes for runtime power transitions Rafael J. Wysocki
2008-07-09 23:55 ` Rafael J. Wysocki
2008-07-10 11:34   ` Pavel Machek
2008-07-10 11:34   ` Pavel Machek
2008-07-09 23:58 ` Rafael J. Wysocki [this message]
2008-07-10 11:34   ` [PATCH -mm 2/8] AHCI: Speed-up resume Pavel Machek
2008-07-10 11:34   ` Pavel Machek
2008-07-09 23:58 ` Rafael J. Wysocki
2008-07-10  0:00 ` [PATCH -mm 3/8] Hibernation: Simplify memory bitmap Rafael J. Wysocki
2008-07-10 11:34   ` Pavel Machek
2008-07-10 11:34   ` Pavel Machek
2008-07-10  0:00 ` Rafael J. Wysocki
2008-07-10  0:01 ` [PATCH -mm 4/8] serio: Speed-up resume Rafael J. Wysocki
2008-07-10  0:01 ` Rafael J. Wysocki
2008-07-10 11:35   ` Pavel Machek
2008-07-10 15:11     ` Dmitry Torokhov
2008-07-10 15:11     ` Dmitry Torokhov
2008-07-10 11:35   ` Pavel Machek
2008-07-10  0:03 ` [PATCH -mm 5/8] Introduce new interface schedule_work_on Rafael J. Wysocki
2008-07-10  0:03 ` Rafael J. Wysocki
2008-07-10 11:36   ` Pavel Machek
2008-07-10 11:36   ` Pavel Machek
2008-07-10  0:04 ` [PATCH -mm 6/8] Schedule sysrq poweroff on boot cpu Rafael J. Wysocki
2008-07-10 11:36   ` Pavel Machek
2008-07-10 11:36   ` Pavel Machek
2008-07-10  0:04 ` Rafael J. Wysocki
2008-07-10  0:05 ` [PATCH -mm 7/8] ACPI hibernation: Utilize hardware signature Rafael J. Wysocki
2008-07-10  0:05 ` Rafael J. Wysocki
2008-07-10  8:34   ` Pavel Machek
2008-07-10  8:34   ` Pavel Machek
2008-07-10  0:07 ` [PATCH -mm 8/8] ACPI PM: Add DMI quirk list for ACPI 1.0 suspend ordering Rafael J. Wysocki
2008-07-10  0:07 ` Rafael J. Wysocki
2008-07-10 11:37   ` Pavel Machek
2008-07-10 11:37   ` Pavel Machek

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=200807100158.49341.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@suse.cz \
    --cc=rui.zhang@intel.com \
    --cc=tj@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.