Re: USB da(4) quirks deprecated

From: Andrew Thompson <andy_at_fud.org.nz>
Date: Sat, 09 Aug 2003 07:25:54 +0000
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
_at__at_ -94,7 +94,8 _at__at_
 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 {
_at__at_ -228,6 +229,10 _at__at_
                {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. */
_at__at_ -484,7 +489,8 _at__at_
        }
 
        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;
_at__at_ -562,6 +568,7 _at__at_
        }
 
        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
_at__at_ -978,9 +985,10 _at__at_
                              
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 */
Received on Fri Aug 08 2003 - 22:23:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:18 UTC