From patchwork Mon Jun 23 09:53:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Tripathi X-Patchwork-Id: 362731 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 9259D1400A7 for ; Mon, 23 Jun 2014 19:54:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbaFWJyV (ORCPT ); Mon, 23 Jun 2014 05:54:21 -0400 Received: from denmail01-v4020.amcc.com ([192.195.68.30]:44218 "EHLO denmail01.apm.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752490AbaFWJyV (ORCPT ); Mon, 23 Jun 2014 05:54:21 -0400 Received: from apm.com (pnqlwv037.amcc.com [10.48.19.137]) by denmail01.apm.com (8.13.8/8.13.8) with ESMTP id s5N9rtJI007425; Mon, 23 Jun 2014 03:53:56 -0600 Received: (from stripath@localhost) by apm.com (8.13.8/8.13.8/Submit) id s5N9rsll029808; Mon, 23 Jun 2014 15:23:54 +0530 From: Suman Tripathi To: olof@lixom.net, tj@kernel.org, arnd@arndb.de Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ddutile@redhat.com, jcm@redhat.com, patches@apm.com, Suman Tripathi , Loc Ho Subject: [PATCH v4 1/2] libahci: Implement the function ahci_restart_engine to restart the port dma engine. Date: Mon, 23 Jun 2014 15:23:12 +0530 Message-Id: <1403517193-29776-2-git-send-email-stripathi@apm.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1403517193-29776-1-git-send-email-stripathi@apm.com> References: <1403517193-29776-1-git-send-email-stripathi@apm.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch adds an function to restart the port dma engine. Signed-off-by: Loc Ho Signed-off-by: Suman Tripathi --- drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) -- 1.8.2.1 -- 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/ahci.h b/drivers/ata/ahci.h index af63c75..3c1760e 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -372,6 +372,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, int ahci_stop_engine(struct ata_port *ap); void ahci_start_engine(struct ata_port *ap); +int ahci_restart_engine(struct ata_port *ap); int ahci_check_ready(struct ata_link *link); int ahci_kick_engine(struct ata_port *ap); int ahci_port_resume(struct ata_port *ap); diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index b986145..d1c9122 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -742,6 +742,18 @@ static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, return 0; } +int ahci_restart_engine(struct ata_port *ap) +{ + struct ahci_host_priv *hpriv = ap->host->private_data; + + ahci_stop_engine(ap); + ahci_start_fis_rx(ap); + hpriv->start_engine(ap); + + return 0; +} +EXPORT_SYMBOL_GPL(ahci_restart_engine); + #ifdef CONFIG_PM static void ahci_power_down(struct ata_port *ap) {