svn commit: r255548 - stable/9/sys/cam/scsi
Alexander Motin
mav at FreeBSD.org
Sat Sep 14 09:10:01 UTC 2013
Author: mav
Date: Sat Sep 14 09:10:01 2013
New Revision: 255548
URL: http://svnweb.freebsd.org/changeset/base/255548
Log:
MFC r253803:
Add NO_RC16 quirk to make da driver avoid using READ CAPACITY(16) command
if possible. Use it for Kingston JetFlash USB sticks, that are known to
return garbage in response to that command.
Modified:
stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:06:32 2013 (r255547)
+++ stable/9/sys/cam/scsi/scsi_da.c Sat Sep 14 09:10:01 2013 (r255548)
@@ -99,7 +99,8 @@ typedef enum {
DA_Q_NO_SYNC_CACHE = 0x01,
DA_Q_NO_6_BYTE = 0x02,
DA_Q_NO_PREVENT = 0x04,
- DA_Q_4K = 0x08
+ DA_Q_4K = 0x08,
+ DA_Q_NO_RC16 = 0x10
} da_quirks;
#define DA_Q_BIT_STRING \
@@ -107,7 +108,8 @@ typedef enum {
"\001NO_SYNC_CACHE" \
"\002NO_6_BYTE" \
"\003NO_PREVENT" \
- "\0044K"
+ "\0044K" \
+ "\005NO_RC16"
typedef enum {
DA_CCB_PROBE_RC = 0x01,
@@ -681,6 +683,11 @@ static struct da_quirk_entry da_quirk_ta
{T_DIRECT, SIP_MEDIA_REMOVABLE, "Kingston", "DataTraveler G3",
"1.00"}, /*quirks*/ DA_Q_NO_PREVENT
},
+ {
+ /* At least several Transcent USB sticks lie on RC16. */
+ {T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*",
+ "*"}, /*quirks*/ DA_Q_NO_RC16
+ },
/* ATA/SATA devices over SAS/USB/... */
{
/* Hitachi Advanced Format (4k) drives */
@@ -2087,7 +2094,8 @@ daregister(struct cam_periph *periph, vo
softc->minimum_cmd_size = 16;
/* Predict whether device may support READ CAPACITY(16). */
- if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3) {
+ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 &&
+ (softc->quirks & DA_Q_NO_RC16) == 0) {
softc->flags |= DA_FLAG_CAN_RC16;
softc->state = DA_STATE_PROBE_RC16;
}
More information about the svn-src-stable-9
mailing list