Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Feb 2011 07:06:40 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218596 - head/sys/dev/ahci
Message-ID:  <201102120706.p1C76eLP088428@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Feb 12 07:06:40 2011
New Revision: 218596
URL: http://svn.freebsd.org/changeset/base/218596

Log:
  Disable NCQ for multiport Marvell 88SX61XX SATA controllers. Simultaneous
  active I/O to several disks (copying large file on ZFS) causes timeout after
  just a few seconds of run. Single port 88SX6111 seems like not affected.
  
  Skip reading transferred bytes count for these controllers. It works for
  88SX6111, but 88SX6145 always returns zero there. Haven't tested others,
  but better to be safe.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Sat Feb 12 06:22:23 2011	(r218595)
+++ head/sys/dev/ahci/ahci.c	Sat Feb 12 07:06:40 2011	(r218596)
@@ -114,6 +114,7 @@ static struct {
 #define AHCI_Q_SATA2	128
 #define AHCI_Q_NOBSYRES	256
 #define AHCI_Q_NOAA	512
+#define AHCI_Q_NOCOUNT	1024
 } ahci_ids[] = {
 	{0x43801002, 0x00, "ATI IXP600",	0},
 	{0x43901002, 0x00, "ATI IXP700",	0},
@@ -161,19 +162,19 @@ static struct {
 	{0x1c038086, 0x00, "Intel Cougar Point",	0},
 	{0x1c048086, 0x00, "Intel Cougar Point",	0},
 	{0x1c058086, 0x00, "Intel Cougar Point",	0},
-	{0x23238086, 0x00, "Intel DH89xxCC",	0},
-	{0x1d028086, 0x00, "Intel Patsburg",	0},
-	{0x1d048086, 0x00, "Intel Patsburg",	0},
-	{0x1d068086, 0x00, "Intel Patsburg",	0},
 	{0x2361197b, 0x00, "JMicron JMB361",	AHCI_Q_NOFORCE},
 	{0x2363197b, 0x00, "JMicron JMB363",	AHCI_Q_NOFORCE},
 	{0x2365197b, 0x00, "JMicron JMB365",	AHCI_Q_NOFORCE},
 	{0x2366197b, 0x00, "JMicron JMB366",	AHCI_Q_NOFORCE},
 	{0x2368197b, 0x00, "JMicron JMB368",	AHCI_Q_NOFORCE},
-	{0x611111ab, 0x00, "Marvell 88SX6111",	AHCI_Q_NOFORCE|AHCI_Q_1CH|AHCI_Q_EDGEIS},
-	{0x612111ab, 0x00, "Marvell 88SX6121",	AHCI_Q_NOFORCE|AHCI_Q_2CH|AHCI_Q_EDGEIS},
-	{0x614111ab, 0x00, "Marvell 88SX6141",	AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS},
-	{0x614511ab, 0x00, "Marvell 88SX6145",	AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS},
+	{0x611111ab, 0x00, "Marvell 88SX6111",	AHCI_Q_NOFORCE | AHCI_Q_1CH |
+	    AHCI_Q_EDGEIS},
+	{0x612111ab, 0x00, "Marvell 88SX6121",	AHCI_Q_NOFORCE | AHCI_Q_2CH |
+	    AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
+	{0x614111ab, 0x00, "Marvell 88SX6141",	AHCI_Q_NOFORCE | AHCI_Q_4CH |
+	    AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
+	{0x614511ab, 0x00, "Marvell 88SX6145",	AHCI_Q_NOFORCE | AHCI_Q_4CH |
+	    AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
 	{0x91231b4b, 0x11, "Marvell 88SE912x",	AHCI_Q_NOBSYRES},
 	{0x91231b4b, 0x00, "Marvell 88SE912x",	AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES},
 	{0x06201103, 0x00, "HighPoint RocketRAID 620",	AHCI_Q_NOBSYRES},
@@ -1908,12 +1909,14 @@ ahci_end_transaction(struct ahci_slot *s
 		} else
 			bzero(res, sizeof(*res));
 		if ((ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) == 0 &&
-		    (ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
+		    (ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE &&
+		    (ch->quirks & AHCI_Q_NOCOUNT) == 0) {
 			ccb->ataio.resid =
 			    ccb->ataio.dxfer_len - le32toh(clp->bytecount);
 		}
 	} else {
-		if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
+		if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE &&
+		    (ch->quirks & AHCI_Q_NOCOUNT) == 0) {
 			ccb->csio.resid =
 			    ccb->csio.dxfer_len - le32toh(clp->bytecount);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102120706.p1C76eLP088428>