From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 19:50:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D2114D5; Wed, 23 Apr 2014 19:50:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6E710C2; Wed, 23 Apr 2014 19:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NJoaHj008461; Wed, 23 Apr 2014 19:50:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NJoaxw008460; Wed, 23 Apr 2014 19:50:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404231950.s3NJoaxw008460@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Apr 2014 19:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264834 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 19:50:36 -0000 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(