From owner-freebsd-current@FreeBSD.ORG Sat Aug 9 00:23:40 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB3C737B401 for ; Sat, 9 Aug 2003 00:23:40 -0700 (PDT) Received: from smtp.fud.org.nz (203-79-110-29.cable.paradise.net.nz [203.79.110.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2D1D43FDD for ; Sat, 9 Aug 2003 00:23:38 -0700 (PDT) (envelope-from andy@fud.org.nz) Received: from [192.168.10.254] (dhcp-254.fud.org.nz [192.168.10.254]) by smtp.fud.org.nz (Postfix) with ESMTP id CA9FF337; Sat, 9 Aug 2003 19:23:37 +1200 (NZST) From: Andrew Thompson To: Nate Lawson 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> Content-Type: text/plain Message-Id: <1060413953.33258.18.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sat, 09 Aug 2003 07:25:54 +0000 Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: USB da(4) quirks deprecated X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2003 07:23:41 -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: 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 */