From owner-freebsd-hackers Thu Feb 7 16:42:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from harrier.prod.itd.earthlink.net (harrier.mail.pas.earthlink.net [207.217.120.12]) by hub.freebsd.org (Postfix) with ESMTP id 9202137B41A; Thu, 7 Feb 2002 16:42:02 -0800 (PST) Received: from pool0339.cvx22-bradley.dialup.earthlink.net ([209.179.199.84] helo=mindspring.com) by harrier.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Yz6u-00055G-00; Thu, 07 Feb 2002 16:41:53 -0800 Message-ID: <3C631E45.2EAAA4CF@mindspring.com> Date: Thu, 07 Feb 2002 16:39:33 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Josef Karthauser Cc: "Eugene M. Kim" , Oliver Fromme , FreeBSD Hardware Mailing List , FreeBSD Hackers Mailing List Subject: Re: USB "Memorybird" quirks References: <200202072046.g17KkSM05459@lurza.secnetix.de> <20020207125449.A9620@alicia.nttmcl.com> <3C63133A.CF411A74@mindspring.com> <20020207235746.E46984@genius.tao.org.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Josef Karthauser wrote: > On Thu, Feb 07, 2002 at 03:52:26PM -0800, Terry Lambert wrote: > > > IIRC this problem is being addressed at a more fundamental level on > > > -current, by adding a 6-byte-to-10-byte READ command translator > > > somewhere in the abstraction layer. > > > > Could this be "auto-quirked"? > > As in, try a 6 byte command, and if that fails try a 10 byte command > instead? As in, if it fails to reset, then sc->softc->minimum_cmd_size = 10; printf( "auto-quirking mumble foo\n"); It would let most of the existing quirks table go away, but would require additional retries. The cool thing is that it would all happen in the error path, so, other than increasing the number of retries to cause it to engage by itself without having to try the disklabel 3 times, which is also failure mode stuff, it adds no overhead to working devices, and makes non-working ones work with the overhead they have to have anyway. > Unfortunately although I'm maintaining USB in -current, I don't have a > complete in depth understanding of the code yet. :( I'm mainly trying > to fix my problems by taking from NetBSD. I took a look at the code. I have to say it's opaque. It makes a better door than a window. ;-). I haven't figured out how to turn a struct umass_softc * into a struct da_softc *, or I would have given you an ugly little patch against an older version of FreeBSD to try. 8-p. I think someone with one of these things, or with a quirky one with the DA_Q_NO_6_BYTE removed from the quirks table, is going to have to set CAM_DEBUG on big-time, and then see where the reset error falls out, add a static fail counter to that place in the code, and then if it fails and the fail counter >= 3 (for example), reset the minimum command size to 10. That should "just work". If the reset is retried enough times, you could get rid of the quirks entries that existed solely for this quirk; I think that a 6 byte commands not supported: changing to 10 byte commands message on the console is probably acceptable "noise" in trade for getting rid of it, and supporting future devices with the same problem, without needing to "quirk" them. I think DA_Q_NO_SYNC_CACHE might be handleable the same way, which would get rid of all the quirk entries, and maybe the need for a quirk table at all (it looks like the daclose/dadump/dashutdown sync code could be static'ed and shared, as well). Maybe this is a CAM-specific thing, and shouldn't be handled in the USB code at all (you won't know until you see a quirked device failure with the CAM debug, or you write the CAM code to tape and run it through your dental fillings or otherwise load it into your head). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message