Date: Tue, 2 Dec 1997 22:08:48 -0600 (CST) From: "Daniel M. Eischen" <deischen@iworks.interworks.org> To: sos@FreeBSD.dk Cc: freebsd-hackers@FreeBSD.ORG, freebsd-mobile@FreeBSD.ORG Subject: Re: Fix for slow reacting ATAPI CD-ROM Message-ID: <199712030408.WAA11699@iworks.InterWorks.org>
next in thread | raw e-mail | index | archive | help
To follow up on my original posting: > > 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. > I was able to lower the wait time to 75 usec for my CD-ROM drive, but anything <= 70 usecs would not work. According to the comments in atapi.h: #define AT_DRQT_MPROC 0 /* microprocessor DRQ - 3 msec delay */ #define AT_DRQT_INTR 1 /* interrupt DRQ - 10 msec delay */ #define AT_DRQT_ACCEL 2 /* accelerated DRQ - 50 usec delay */ my CD-ROM drive should have a 50usec delay. The code in atapi.c uses these numbers without any tolerance. I assume these numbers come from some sort of ATAPI spec, but shouldn't we allow some tolerance? Increasing these waits will not affect drives that conform to the times, so I don't see why they can't be larger. Dan Eischen deischen@iworks.InterWorks.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712030408.WAA11699>