From patchwork Fri Mar 14 20:52:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 330507 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 651352C00C6 for ; Sat, 15 Mar 2014 07:52:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755198AbaCNUw5 (ORCPT ); Fri, 14 Mar 2014 16:52:57 -0400 Received: from mga02.intel.com ([134.134.136.20]:15694 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754451AbaCNUw5 (ORCPT ); Fri, 14 Mar 2014 16:52:57 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 14 Mar 2014 13:52:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,657,1389772800"; d="scan'208";a="472779815" Received: from viggo.jf.intel.com ([10.23.232.61]) by orsmga001.jf.intel.com with ESMTP; 14 Mar 2014 13:52:54 -0700 Subject: [PATCH v6 2/3] libata: async resume From: Dan Williams To: tj@kernel.org, JBottomley@Parallels.com Cc: Len Brown , linux-scsi@vger.kernel.org, Phillip Susi , linux-ide@vger.kernel.org, Alan Stern , Todd Brandt Date: Fri, 14 Mar 2014 13:52:54 -0700 Message-ID: <20140314205254.1269.44479.stgit@viggo.jf.intel.com> In-Reply-To: <20140314205204.1269.44402.stgit@viggo.jf.intel.com> References: <20140314205204.1269.44402.stgit@viggo.jf.intel.com> User-Agent: StGit/0.17.1-5-g6888 MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Todd Brandt 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 Cc: Phillip Susi Cc: Alan Stern Signed-off-by: Todd Brandt [djbw: rebase on cleanup patch, changelog wordsmithing] Signed-off-by: Dan Williams --- drivers/ata/libata-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 66110ed2c1c0..c37eb02c7136 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -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);