From patchwork Tue Jul 26 09:20:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rameshwar Prasad Sahu X-Patchwork-Id: 9247951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 07D67607D8 for ; Tue, 26 Jul 2016 09:23:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB39C26AE3 for ; Tue, 26 Jul 2016 09:23:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF67C26C72; Tue, 26 Jul 2016 09:23:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 22DD926AE3 for ; Tue, 26 Jul 2016 09:23:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bRyYd-00056g-3t; Tue, 26 Jul 2016 09:21:47 +0000 Received: from [198.137.200.161] (helo=denmail01.amcc.com) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bRyYa-00051P-6t for linux-arm-kernel@lists.infradead.org; Tue, 26 Jul 2016 09:21:45 +0000 Received: from apm.com (pnqlwv041.amcc.com [10.48.19.141]) by denmail01.amcc.com (8.13.8/8.13.8) with ESMTP id u6Q9LGZ0031311; Tue, 26 Jul 2016 03:21:17 -0600 Received: (from rsahu@localhost) by apm.com (8.14.4/8.14.4/Submit) id u6Q9LAX0003826; Tue, 26 Jul 2016 14:51:10 +0530 From: Rameshwar Prasad Sahu To: olof@lixom.net, tj@kernel.org, arnd@arndb.de Subject: [PATCH] ata: xgene: Enable NCQ support for APM X-Gene SATA controller hardware v1.1 Date: Tue, 26 Jul 2016 14:50:57 +0530 Message-Id: <1469524857-3720-1-git-send-email-rsahu@apm.com> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160726_022144_358984_AF4059AC X-CRM114-Status: UNSURE ( 9.00 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-scsi@vger.kernel.org, jcm@redhat.com, Rameshwar Prasad Sahu , patches@apm.com, linux-ide@vger.kernel.org, ddutile@redhat.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch enables NCQ support for APM X-Gene SATA controller hardware v1.1 that was broken with hardware v1.0. Signed-off-by: Rameshwar Prasad Sahu --- drivers/ata/ahci_xgene.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) -- 1.7.1 diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 73b19b2..8b88be9 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -87,6 +87,7 @@ enum xgene_ahci_version { XGENE_AHCI_V1 = 1, + XGENE_AHCI_V1_1, XGENE_AHCI_V2, }; @@ -734,6 +735,7 @@ static struct scsi_host_template ahci_platform_sht = { #ifdef CONFIG_ACPI static const struct acpi_device_id xgene_ahci_acpi_match[] = { { "APMC0D0D", XGENE_AHCI_V1}, + { "APMC0D67", XGENE_AHCI_V1_1}, { "APMC0D32", XGENE_AHCI_V2}, {}, }; @@ -742,6 +744,7 @@ MODULE_DEVICE_TABLE(acpi, xgene_ahci_acpi_match); static const struct of_device_id xgene_ahci_of_match[] = { {.compatible = "apm,xgene-ahci", .data = (void *) XGENE_AHCI_V1}, + {.compatible = "apm,xgene-ahci-v1-1", .data = (void *) XGENE_AHCI_V1_1}, {.compatible = "apm,xgene-ahci-v2", .data = (void *) XGENE_AHCI_V2}, {}, }; @@ -755,8 +758,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) struct resource *res; const struct of_device_id *of_devid; enum xgene_ahci_version version = XGENE_AHCI_V1; - const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info, - &xgene_ahci_v2_port_info }; + const struct ata_port_info *ppi; int rc; hpriv = ahci_platform_get_resources(pdev); @@ -821,8 +823,6 @@ static int xgene_ahci_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n", __func__); version = XGENE_AHCI_V1; - } else if (info->valid & ACPI_VALID_CID) { - version = XGENE_AHCI_V2; } } } @@ -858,18 +858,20 @@ skip_clk_phy: switch (version) { case XGENE_AHCI_V1: + ppi = &xgene_ahci_v1_port_info; hpriv->flags = AHCI_HFLAG_NO_NCQ; break; case XGENE_AHCI_V2: + ppi = &xgene_ahci_v2_port_info; hpriv->flags |= AHCI_HFLAG_YES_FBS; hpriv->irq_handler = xgene_ahci_irq_intr; break; default: + ppi = &xgene_ahci_v1_port_info; break; } - rc = ahci_platform_init_host(pdev, hpriv, ppi[version - 1], - &ahci_platform_sht); + rc = ahci_platform_init_host(pdev, hpriv, ppi, &ahci_platform_sht); if (rc) goto disable_resources;