From owner-freebsd-hackers Tue Dec 2 11:57:57 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA28042 for hackers-outgoing; Tue, 2 Dec 1997 11:57:57 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from sos.freebsd.dk (sos.freebsd.dk [195.8.129.33]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA28006; Tue, 2 Dec 1997 11:57:40 -0800 (PST) (envelope-from sos@sos.freebsd.dk) Received: (from sos@localhost) by sos.freebsd.dk (8.8.8/8.8.8) id UAA01466; Tue, 2 Dec 1997 20:58:19 +0100 (MET) (envelope-from sos) Message-Id: <199712021958.UAA01466@sos.freebsd.dk> Subject: Re: Fix for slow reacting ATAPI CD-ROM In-Reply-To: <199712021813.MAA10260@iworks.InterWorks.org> from "Daniel M. Eischen" at "Dec 2, 97 12:13:54 pm" To: deischen@iworks.interworks.org (Daniel M. Eischen) Date: Tue, 2 Dec 1997 20:58:19 +0100 (MET) Cc: freebsd-hackers@FreeBSD.ORG, freebsd-mobile@FreeBSD.ORG From: Søren Schmidt Reply-to: sos@FreeBSD.dk X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In reply to Daniel M. Eischen who wrote: > > Please forgive the cross-post, wasn't sure where this belongs. > > I have a new ChemUSA Chembook and everything works fine > except for the CD-ROM drive, which times out waiting > for the command phase in atapi_wait_cmd(). I was able > to get it to work by increasing the wait count to 3000. > > /* Wait for DRQ from 50 usec to 3 msec for slow devices */ > int cnt = ata->intrcmd ? 10000 : ata->slow ? 3000 : 50; > int ireason = 0, phase = 0; > > + cnt = 3000; > + > /* Wait for command phase. */ > for (; cnt>0; cnt-=10) { > ireason = inb (ata->port + AR_IREASON); > > Obviously, this drive isn't detected as a slow device (I > can post the boot messages later if needed). What I wanted > to do was to add a config flag for setting this, but it doesn't > look like that is sent down to the atapi driver. > > Question: Can we change atapi_attach() to accept a 4th argument > and use this to pass config flags from wdattach() in > wd.c? Is there another method I should be using to > handle atapi device quirks? Hmm, I think that atapi_attach should be educated on how to treat this device, test for model make etc, and then set the slow bit... This is the place to do quirks for atapi CDROM device. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Søren Schmidt (sos@FreeBSD.org) FreeBSD Core Team Even more code to hack -- will it ever end ..