Disable UNMAP support for STEC 842 SSDs.

In some unknown cases UNMAP commands make device firmware stuck.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2014-04-23 19:50:35 +00:00
parent abe917ad4c
commit 0fa3cb336b

View File

@ -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_table[] =
{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 ccb *done_ccb)
/* 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 ccb *done_ccb)
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(