Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2014 19:50:36 +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: r264834 - head/sys/cam/scsi
Message-ID:  <201404231950.s3NJoaxw008460@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Apr 23 19:50:35 2014
New Revision: 264834
URL: http://svnweb.freebsd.org/changeset/base/264834

Log:
  Disable UNMAP support for STEC 842 SSDs.
  
  In some unknown cases UNMAP commands make device firmware stuck.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Wed Apr 23 19:35:55 2014	(r264833)
+++ head/sys/cam/scsi/scsi_da.c	Wed Apr 23 19:50:35 2014	(r264834)
@@ -99,7 +99,8 @@ typedef enum {
 	DA_Q_NO_6_BYTE		= 0x02,
 	DA_Q_NO_PREVENT		= 0x04,
 	DA_Q_4K			= 0x08,
-	DA_Q_NO_RC16		= 0x10
+	DA_Q_NO_RC16		= 0x10,
+	DA_Q_NO_UNMAP		= 0x20
 } da_quirks;
 
 #define DA_Q_BIT_STRING		\
@@ -349,6 +350,13 @@ static struct da_quirk_entry da_quirk_ta
 		{T_DIRECT, SIP_MEDIA_FIXED, "COMPAQ", "RAID*", "*"},
 		/*quirks*/ DA_Q_NO_SYNC_CACHE
 	},
+	{
+		/*
+		 * The STEC 842 sometimes hang on UNMAP.
+		 */
+		{T_DIRECT, SIP_MEDIA_FIXED, "STEC", "S842E800M2", "*"},
+		/*quirks*/ DA_Q_NO_UNMAP
+	},
 	/* USB mass storage devices supported by umass(4) */
 	{
 		/*
@@ -3202,7 +3210,7 @@ dadone(struct cam_periph *periph, union 
 
 		/* Ensure re-probe doesn't see old delete. */
 		softc->delete_available = 0;
-		if (lbp) {
+		if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) {
 			/*
 			 * Based on older SBC-3 spec revisions
 			 * any of the UNMAP methods "may" be
@@ -3412,7 +3420,8 @@ dadone(struct cam_periph *periph, union 
 
 			for (i = 0; i < sizeof(*ata_params) / 2; i++)
 				ptr[i] = le16toh(ptr[i]);
-			if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM) {
+			if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM &&
+			    (softc->quirks & DA_Q_NO_UNMAP) == 0) {
 				dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1);
 				if (ata_params->max_dsm_blocks != 0)
 					softc->trim_max_ranges = min(



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