cam(4): Add a quirk to turn off SYNC CACHE for mly(4).
authorSascha Wildner <saw@online.de>
Mon, 22 Aug 2011 20:22:41 +0000 (22:22 +0200)
committerSascha Wildner <saw@online.de>
Mon, 22 Aug 2011 20:23:53 +0000 (22:23 +0200)
This fixes mounting a HAMMER file system from an mly(4) disk on
the AcceleRAID 160 I tried this with.

I think it will also fix the following issue that was reported
for the AcceleRAID 170 on FreeBSD:

http://lists.freebsd.org/pipermail/freebsd-hardware/2008-December/005676.html

The problem with fixing this was that the mly(4) driver modifies
the SCSI inquiry data and uses it for its own purposes (to show
the disk type and status). So I had to make these fields a bit
more recognizable to the quirks code because the previous strings
were too generic for my taste.

sys/bus/cam/scsi/scsi_da.c
sys/dev/raid/mly/mly.c
sys/dev/raid/mly/mly_tables.h

index 48e3c73..3ac2cba 100644 (file)
@@ -26,7 +26,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.42.2.46 2003/10/21 22:18:19 thomas Exp $
- * $DragonFly: src/sys/bus/cam/scsi/scsi_da.c,v 1.59 2008/08/29 20:08:40 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -265,6 +264,13 @@ static struct da_quirk_entry da_quirk_table[] =
                {T_DIRECT, SIP_MEDIA_FIXED, "COMPAQ", "RAID*", "*"},
                /*quirks*/ DA_Q_NO_SYNC_CACHE
        },
+       {
+               /*
+                * The same goes for the mly(4) controllers
+                */
+               {T_DIRECT, SIP_MEDIA_FIXED, "MLY*", "*", "MYLX"},
+               /*quirks*/ DA_Q_NO_SYNC_CACHE
+       },
        /*
         * USB mass storage devices supported by umass(4)
         *
index 38d6e1f..f68b5e4 100644 (file)
@@ -2345,7 +2345,7 @@ mly_cam_complete(struct mly_command *mc)
                btl = &sc->mly_btl[bus][target];
                padstr(inq->vendor, mly_describe_code(mly_table_device_type, btl->mb_type), 8);
                padstr(inq->product, mly_describe_code(mly_table_device_state, btl->mb_state), 16);
-               padstr(inq->revision, "", 4);
+               padstr(inq->revision, "MYLX", 4);
            }
        }
 
index 2f04c87..5ea7f4e 100644 (file)
@@ -271,21 +271,21 @@ static struct mly_code_lookup mly_table_device_state[] = {
  * the 'vendor' field in the SCSI inquiry data.
  */
 static struct mly_code_lookup mly_table_device_type[] = {
-    {"RAID 0",         MLY_DEVICE_TYPE_RAID0},
-    {"RAID 1",         MLY_DEVICE_TYPE_RAID1},
-    {"RAID 3",         MLY_DEVICE_TYPE_RAID3},         /* right asymmetric parity */
-    {"RAID 5",         MLY_DEVICE_TYPE_RAID5},         /* right asymmetric parity */
-    {"RAID 6",         MLY_DEVICE_TYPE_RAID6},         /* Mylex RAID 6 */
-    {"RAID 7",         MLY_DEVICE_TYPE_RAID7},         /* JBOD */
-    {"SPAN",           MLY_DEVICE_TYPE_NEWSPAN},       /* New Mylex SPAN */
-    {"RAID 3",         MLY_DEVICE_TYPE_RAID3F},        /* fixed parity */
-    {"RAID 3",         MLY_DEVICE_TYPE_RAID3L},        /* left symmetric parity */
-    {"SPAN",           MLY_DEVICE_TYPE_SPAN},          /* current spanning implementation */
-    {"RAID 5",         MLY_DEVICE_TYPE_RAID5L},        /* left symmetric parity */
-    {"RAID E",         MLY_DEVICE_TYPE_RAIDE},         /* concatenation */
-    {"PHYSICAL",       MLY_DEVICE_TYPE_PHYSICAL},      /* physical device */
+    {"MLYRAID0",       MLY_DEVICE_TYPE_RAID0},
+    {"MLYRAID1",       MLY_DEVICE_TYPE_RAID1},
+    {"MLYRAID3",       MLY_DEVICE_TYPE_RAID3},         /* right asymmetric parity */
+    {"MLYRAID5",       MLY_DEVICE_TYPE_RAID5},         /* right asymmetric parity */
+    {"MLYRAID6",       MLY_DEVICE_TYPE_RAID6},         /* Mylex RAID 6 */
+    {"MLYRAID7",       MLY_DEVICE_TYPE_RAID7},         /* JBOD */
+    {"MLY SPAN",       MLY_DEVICE_TYPE_NEWSPAN},       /* New Mylex SPAN */
+    {"MLYRAID3",       MLY_DEVICE_TYPE_RAID3F},        /* fixed parity */
+    {"MLYRAID3",       MLY_DEVICE_TYPE_RAID3L},        /* left symmetric parity */
+    {"MLY SPAN",       MLY_DEVICE_TYPE_SPAN},          /* current spanning implementation */
+    {"MLYRAID5",       MLY_DEVICE_TYPE_RAID5L},        /* left symmetric parity */
+    {"MLYRAIDE",               MLY_DEVICE_TYPE_RAIDE},         /* concatenation */
+    {"MLY PHYS",       MLY_DEVICE_TYPE_PHYSICAL},      /* physical device */
     {NULL, 0},
-    {"UNKNOWN",                0}
+    {"MLY UNKN",       0}
 };
 
 #if 0