Subject: Re: atapi driver for -current
To: Manuel Bouyer <bouyer@ensta.fr>
From: Jeff Thieleke <thieleke@lust.isca.uiowa.edu>
List: port-i386
Date: 06/08/1996 16:58:18
> > 2. As the above diagonstics show, I could only get the driver working with
> >    some of the debugging #defines defined.  Specifically, add the
> >    following to your kernel conf file:
> > 
> >   options 	ATAPI_DEBUG_PROBE
> >   options	ATAPI_DEBUG
> >   options	ACD_DEBUG
> > 
> 
> I remember having the same kind of problem while debugging the driver.
> What's happen if you don't have these options ? Maybe there is still some kind
> of timing problem.

This afternoon, I narrowed it down to just ACD_DEBUG, so it seems that I
get a working driver without ATAPI_DEBUG_PROBE & ATAPI_DEBUG.  

Anyway, without ACD_DEBUG, I get this on boot:

  atapibus1 at wdc1
  Warning drive 0 returned 142/512 of indentify device data
  atapibus1 drive0: <NEC                 CD-ROM DRIVE:273, , 4.21> cdrom, removable.
  acd0 at atapibus1 drive 0: wdc_atapi_intr: unknown phase 1
  wdc_atapi_intr: unknown phase 1
  atapi_exec_cmd failed


and when trying to eject (eject acd0):

  wdc_atapi_start: timout waiting PHASE_CMDOU



> > I too have the phase 1 problem, but it doesn't seem to affect anything.  I
> > get it even on my working kernels.  But it seems you are SOL when you get
> > the 'atapi_exec_cmd failed' error.  I get that when I don't have the above
> > set of debugging options. 
> 
> In this case, perhaps the controller is left in an unsane state, and need a
> reset.


Is there a way to do a reset?



> > atapibus1 at wdc1
> > Warning drive 0 returned 142/512 of indentify device data
> > atapibus1 drive0: <NEC                 CD-ROM DRIVE:273, , 4.21> cdrom, removable.
> > acd0 at atapibus1 drive 0: wdc_atapi_intr: unknown phase 1
> > atapi_free_pkt: calling private start
> > acd: acdstart
> > wdc_atapi_intr: unknown phase 1
> > atapi_free_pkt: calling private start
> > acd: acdstart
> > atapi_free_pkt: calling private start
> > acd: acdstart
> > medium type unknown
> > ^^^^^^^^^^^^^^^^^^^
> > ocassionally, I get a "unknown medium type=0x6c" error.
> > 
> 
> What kind of media are you using ? On some of my writable cd-roms, the driver
> reports "120mm photo disc". I guess the "medium type=0x6c" is a vendor
> specific type. Unfortunnably, I don't have any info on IDE and ATAPI specs,
> other than the one found in the FreeBSD and Linux drivers.


It is just a 120mm read-only data (iso9660) disk - the MS Flight Simulator
5.1 CDROM, actually.  I think the 0x6c thing might be related to the
compiler - when I use -O2, I almost always get medium type=0x00 (unknown),
but with -O3, I usually get 0x6c.



Jeff Thieleke