From patchwork Thu Mar 11 02:40:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 47298 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 89D46B7D1D for ; Thu, 11 Mar 2010 13:40:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753476Ab0CKCkY (ORCPT ); Wed, 10 Mar 2010 21:40:24 -0500 Received: from hera.kernel.org ([140.211.167.34]:35392 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753361Ab0CKCkY (ORCPT ); Wed, 10 Mar 2010 21:40:24 -0500 Received: from htj.dyndns.org (localhost [127.0.0.1]) by hera.kernel.org (8.14.3/8.14.3) with ESMTP id o2B2eFkF031865 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 11 Mar 2010 02:40:17 GMT X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.95.2 at hera.kernel.org Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id 85C8E1006F80B; Thu, 11 Mar 2010 11:40:15 +0900 (KST) Message-ID: <4B98580F.8010908@kernel.org> Date: Thu, 11 Mar 2010 11:40:15 +0900 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100228 SUSE/3.0.3-1.1.1 Thunderbird/3.0.3 MIME-Version: 1.0 To: Jeff Garzik , "linux-ide@vger.kernel.org" , pchen@nvidia.com, kernel-bugzilla.20.drkshadow@spamgourmet.com Subject: [PATCH #upstream-fixes 3/3] ahci: implement AHCI_HFLAG_NO_FPDMA_AA and update NV quirks References: <4B98575C.5050508@kernel.org> <4B9857EA.5090101@kernel.org> In-Reply-To: <4B9857EA.5090101@kernel.org> X-Enigmail-Version: 1.0.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Thu, 11 Mar 2010 02:40:17 +0000 (UTC) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org It turns out different generations of MCPs have differing quirks. * MCP 65-73 : FPDMA AA broken, lies about PMP support, forgets to report NCQ * MCP 77-79 : FPDMA AA broken, lies about PMP support * MCP 89 : FPDMA AA broken Instead of turngin off FPDMA AA on all NVIDIAs, implement HFLAG_NO_FPDMA_AA, define additional board IDs and apply necessary quirks. This fixes bko#15481 and the list of quirks is verified by Peer Chen. http://bugzilla.kernel.org/show_bug.cgi?id=15481 Signed-off-by: Tejun Heo Cc: Peer Chen --- drivers/ata/ahci.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 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 Index: ata/drivers/ata/ahci.c =================================================================== --- ata.orig/drivers/ata/ahci.c +++ ata/drivers/ata/ahci.c @@ -239,6 +239,7 @@ enum { AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = (1 << 11), /* treat SRST timeout as link offline */ AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */ + AHCI_HFLAG_NO_FPDMA_AA = (1 << 13), /* no FPDMA AA */ /* ap->flags bits */ @@ -267,6 +268,8 @@ enum board_ids { /* board IDs for specific chipsets in alphabetical order */ board_ahci_mcp65, + board_ahci_mcp77, + board_ahci_mcp89, board_ahci_mv, board_ahci_sb600, board_ahci_sb700, /* for SB700 and SB800 */ @@ -276,9 +279,7 @@ enum board_ids { board_ahci_mcp_linux = board_ahci_mcp65, board_ahci_mcp67 = board_ahci_mcp65, board_ahci_mcp73 = board_ahci_mcp65, - board_ahci_mcp77 = board_ahci, - board_ahci_mcp79 = board_ahci, - board_ahci_mcp89 = board_ahci, + board_ahci_mcp79 = board_ahci_mcp77, }; struct ahci_cmd_hdr { @@ -500,7 +501,24 @@ static const struct ata_port_info ahci_p /* by chipsets */ [board_ahci_mcp65] = { - AHCI_HFLAGS (AHCI_HFLAG_YES_NCQ), + AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP | + AHCI_HFLAG_YES_NCQ), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, + [board_ahci_mcp77] = + { + AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP), + .flags = AHCI_FLAG_COMMON, + .pio_mask = ATA_PIO4, + .udma_mask = ATA_UDMA6, + .port_ops = &ahci_ops, + }, + [board_ahci_mcp89] = + { + AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA), .flags = AHCI_FLAG_COMMON, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, @@ -3287,12 +3305,13 @@ static int ahci_init_one(struct pci_dev /* prepare host */ if (hpriv->cap & HOST_CAP_NCQ) { pi.flags |= ATA_FLAG_NCQ; - /* Auto-activate optimization is supposed to be supported on - all AHCI controllers indicating NCQ support, but it seems - to be broken at least on some NVIDIA MCP79 chipsets. - Until we get info on which NVIDIA chipsets don't have this - issue, if any, disable AA on all NVIDIA AHCIs. */ - if (pdev->vendor != PCI_VENDOR_ID_NVIDIA) + /* + * Auto-activate optimization is supposed to be + * supported on all AHCI controllers indicating NCQ + * capability, but it seems to be broken on some + * chipsets including NVIDIAs. + */ + if (!(hpriv->flags & AHCI_HFLAG_NO_FPDMA_AA)) pi.flags |= ATA_FLAG_FPDMA_AA; }