libata: async resume
authorTodd Brandt <todd.e.brandt@linux.intel.com>
Fri, 14 Mar 2014 20:52:54 +0000 (13:52 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 18 Mar 2014 20:08:38 +0000 (16:08 -0400)
Improve overall system resume time by making libata link recovery
actions asynchronous relative to other resume events.

Link resume operations are performed using the scsi_eh thread, so
commands, particularly the sd resume start/stop command, will be held
off until the device exits error handling.  Libata already flushes eh
with ata_port_wait_eh() in the port teardown paths, so there are no
concerns with async operation colliding with the end-of-life of the
ata_port object.  Also, libata-core is already careful to flush
in-flight pm operations before another round of pm starts on the given
ata_port.

Reference: https://01.org/suspendresume/blogs/tebrandt/2013/hard-disk-resume-optimization-simpler-approach

Cc: Len Brown <len.brown@intel.com>
Cc: Phillip Susi <psusi@ubuntu.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
[djbw: rebase on cleanup patch, changelog wordsmithing]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-core.c

index 66110ed2c1c09afd36967f834381386839956402..c37eb02c7136e19bab2b3f29eb472db2ccfc1ed9 100644 (file)
@@ -5450,7 +5450,7 @@ static void ata_port_resume_async(struct ata_port *ap, pm_message_t mesg)
 
 static int ata_port_pm_resume(struct device *dev)
 {
-       ata_port_resume(to_ata_port(dev), PMSG_RESUME);
+       ata_port_resume_async(to_ata_port(dev), PMSG_RESUME);
        pm_runtime_disable(dev);
        pm_runtime_set_active(dev);
        pm_runtime_enable(dev);