Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Aug 2003 07:25:54 +0000
From:      Andrew Thompson <andy@fud.org.nz>
To:        Nate Lawson <nate@root.org>
Cc:        current@freebsd.org
Subject:   Re: USB da(4) quirks deprecated
Message-ID:  <1060413953.33258.18.camel@localhost>
In-Reply-To: <20030808084040.C78146@root.org>
References:  <20030806213504.S74720@root.org> <03Aug8.140932nzst.119071@homer.fire.org.nz> <20030807200629.G77081@root.org> <1060346467.33258.3.camel@localhost> <20030808084040.C78146@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2003-08-08 at 15:41, Nate Lawson wrote:
> On Fri, 8 Aug 2003, Andrew Thompson wrote:
> > On Fri, 2003-08-08 at 03:13, Nate Lawson wrote:
> > > On Fri, 8 Aug 2003, Andrew Thompson wrote:
> > > > umass0: SigmaTel, Inc. USBMSC Audio Player, rev 1.10/0.01, addr 3
> > >
> > > If I were you, I'd look first into adding one for RS_NO_CLEAR_UA in
> > > sys/dev/usb/umass.c.  See other quirks like this to get an idea.  It's
> > > also possible that the problem is "NO_SYNC_CACHE" in
> > > sys/cam/scsi/scsi_da.c.
> >
> > I have tried RS_NO_CLEAR_UA, NO_GETMAXLUN, NO_START_STOP,
> > NO_TEST_UNIT_READY, DA_Q_NO_SYNC_CACHE and DA_Q_NO_6_BYTE without any
> > luck.
> >
> > Any other quirks to try?
> 
> Let's see the new dmesg.  As per my previous reply, I'm not confident your
> quirk was having any effect.
> 
> -Nate

I had out a printf after the match function, and it was having an effect
for the quirks above.

I have applied Kevins DA_Q_NO_PREVENT patch and now the device is
working perfectly, here is the diff and new dmesg.


Thanks Nate and Kevin for your help.  Should I send a PR?




dmesg:

umass0: SigmaTel, Inc. USBMSC Audio Player, rev 1.10/0.01, addr 3
umass0: Get Max Lun not supported (IOERROR)
Enabling quirks for device
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <SigmaTel MSCN 0001> Removable Direct Access SCSI-4 device 
da0: 1.000MB/s transfers
da0: 125MB (256001 512 byte sectors: 64H 32S/T 125C)



scsi_da.c.diff:

---------- sys/cam/scsi/scsi_da.c.orig Sat Aug  9 12:18:35 2003
+++ sys/cam/scsi/scsi_da.c      Sat Aug  9 18:59:58 2003
@@ -94,7 +94,8 @@
 typedef enum {
        DA_Q_NONE               = 0x00,
        DA_Q_NO_SYNC_CACHE      = 0x01,
-       DA_Q_NO_6_BYTE          = 0x02
+       DA_Q_NO_6_BYTE          = 0x02,
+       DA_Q_NO_PREVENT         = 0x04
 } da_quirks;
 
 typedef enum {
@@ -228,6 +229,10 @@
                {T_DIRECT, SIP_MEDIA_FIXED, quantum, "VIKING 2*", "*"},
                /*quirks*/ DA_Q_NO_6_BYTE
        },
+       {
+               {T_DIRECT, SIP_MEDIA_REMOVABLE, "SigmaTel*", "MSCN*",
"*"},
+               /*quirks*/
DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE|DA_Q_NO_PREVENT
+       },
 
 #ifdef DA_OLD_QUIRKS
        /* Below a list of quirks for USB devices supported by umass. */
@@ -484,7 +489,8 @@
        }
 
        if (error == 0) {
-               if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0)
+               if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0
+                       && (softc->quirks & DA_Q_NO_PREVENT) == 0)
                        daprevent(periph, PR_PREVENT);
        } else {
                softc->flags &= ~DA_FLAG_OPEN;
@@ -562,6 +568,7 @@
        }
 
        if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0) {
+               if ((softc->quirks & DA_Q_NO_PREVENT) == 0)
                daprevent(periph, PR_ALLOW);
                /*
                 * If we've got removeable media, mark the blocksize as
@@ -978,9 +985,10 @@
                              
sizeof(da_quirk_table)/sizeof(*da_quirk_table),
                               sizeof(*da_quirk_table),
scsi_inquiry_match);
 
-       if (match != NULL)
+       if (match != NULL) {
                softc->quirks = ((struct da_quirk_entry
*)match)->quirks;
-       else
+               printf("Enabling quirks for device\n");
+       } else
                softc->quirks = DA_Q_NONE;
 
        /* Check if the SIM does not want 6 byte commands */





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1060413953.33258.18.camel>