From patchwork Wed Dec 17 17:27:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Tripathi X-Patchwork-Id: 422332 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 093FC1400B7 for ; Thu, 18 Dec 2014 04:28:58 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281AbaLQR2y (ORCPT ); Wed, 17 Dec 2014 12:28:54 -0500 Received: from denmail01-v4020.amcc.com ([192.195.68.30]:50046 "EHLO denmail01.apm.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750953AbaLQR2w (ORCPT ); Wed, 17 Dec 2014 12:28:52 -0500 Received: from apm.com (pnqlwv037.amcc.com [10.48.19.137]) by denmail01.apm.com (8.13.8/8.13.8) with ESMTP id sBHHSNoQ011043; Wed, 17 Dec 2014 10:28:23 -0700 Received: (from stripath@localhost) by apm.com (8.13.8/8.13.8/Submit) id sBHHSMwc023472; Wed, 17 Dec 2014 22:58:22 +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 Subject: [PATCH v1 2/2] ahci_xgene: Fix the DMA state machine lockup for the ATA_CMD_PACKET PIO mode command. Date: Wed, 17 Dec 2014 22:57:57 +0530 Message-Id: <1418837277-23260-3-git-send-email-stripathi@apm.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1418837277-23260-1-git-send-email-stripathi@apm.com> References: <1418837277-23260-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 addresses the issue with ATA_CMD_PACKET pio mode command for enumeration and device detection with ATAPI devices.It is the same issue as in patch www.spinics.net/lists/linux-ide/msg49092.html Signed-off-by: Suman Tripathi --- drivers/ata/ahci_xgene.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 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_xgene.c b/drivers/ata/ahci_xgene.c index 0ffd3c9..d332161 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -125,10 +125,11 @@ static int xgene_ahci_restart_engine(struct ata_port *ap) * xgene_ahci_qc_issue - Issue commands to the device * @qc: Command to issue * - * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot - * clear the BSY bit after receiving the PIO setup FIS. This results in the dma - * state machine goes into the CMFatalErrorUpdate state and locks up. By - * restarting the dma engine, it removes the controller out of lock up state. + * Due to Hardware errata for IDENTIFY DEVICE command and PACKET + * command of ATAPI protocol set, the controller cannot clear the BSY bit + * after receiving the PIO setup FIS. This results in the DMA state machine + * going into the CMFatalErrorUpdate state and locks up. By restarting the + * DMA engine, it removes the controller out of lock up state. */ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) { @@ -137,7 +138,8 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) struct xgene_ahci_context *ctx = hpriv->plat_data; int rc = 0; - if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA)) + if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) || + (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET))) xgene_ahci_restart_engine(ap); rc = ahci_qc_issue(qc);