Date: Thu, 8 May 2014 07:05:19 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r265638 - stable/10/sys/cam/scsi Message-ID: <201405080705.s4875J7J050081@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu May 8 07:05:19 2014 New Revision: 265638 URL: http://svnweb.freebsd.org/changeset/base/265638 Log: MFC r264834: Disable UNMAP support for STEC 842 SSDs. In some unknown cases UNMAP commands make device firmware stuck. Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:04:13 2014 (r265637) +++ stable/10/sys/cam/scsi/scsi_da.c Thu May 8 07:05:19 2014 (r265638) @@ -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) */ { /* @@ -3205,7 +3213,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 @@ -3404,7 +3412,8 @@ dadone(struct cam_periph *periph, union if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { 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?201405080705.s4875J7J050081>