Subject: Re: atapi driver for -current
To: Jeff Thieleke <thieleke@lust.isca.uiowa.edu>
From: Manuel Bouyer <bouyer@ensta.fr>
List: port-i386
Date: 06/08/1996 14:11:17
Jeff Thieleke said:
> 
> I had the damnest time getting this working, but when I did, it works
> great! :)  
> 
> I actually don't have any FFS format CDROMs (is there such a thing?), but
> I was able to test quite a few ISO9660 format disks, including the
> Windoze95 installation disk, MSOffice95, and Flight Simulator 5.1.  The
> driver works very well, even under some heavy access.
> 
> As for your cd9660 problem, make sure it the cd9660 file system is in your
> kernel's conf file.  If so, 'mount -t cd9660 -o ro /dev/acd0a /mountpoint'
> should work (it does for me).
> 
> 
> I noted two things that might help you:
> 
> 1. It seems to be best to leave the IRQ at 15, if you are using wdc1, as
>    in the patched GENERIC files.  I tried it at 11 and it didn't work.
>    When trying to eject the disk with IRQ 11, I get:
> 
>   acd: open
>   atapi_exec_cmd: sleeping
>   wdc1(atapibus1): lost interrupt
>   wdc1(atapibus1): lost interrupt
>   wdc1(atapibus1): lost interrupt
>   wdc1(atapibus1): lost interrupt
>   wdc1(atapibus1): lost interrupt
>   atapi_done
>   acd0(wdc1:0): illegal length indication, command:  0  0  0  0  0  0  0 0
>   0  0  0  0
>   calling private done
>   atapidone: wakeup acp
>   atapi_exec_cmd: done sleeping
>   atapi_free_pkt: calling private start
>   acd: acdstart

Well, the driver doesn't receive the interrupts. However, on a PC, I don't
know if a IDE controller can be on a IRQ other than 14 or 15 ...

> 
> 
> 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.

> 
> 
> 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.

> 
> 
> 
> 
> For debugging info, here are my kernel messages for a working kernel:
> 
> wdc0 at isa0 port 0x1f0-0x1f7 irq 14
> wd0 at wdc0 drive 0: 1039MB, 2112 cyl, 16 head, 63 sec, 512 bytes/sec <QUANTUM FIREBALL1080A>
> wd0: using 8-sector 16-bit pio transfers, lba addressing
> atapibus0 at wdc0
> wdc1 at isa0 port 0x170-0x177 irq 15
> 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.

--
Manuel Bouyer, Ecole Nationale Superieure de Techniques Avancees, Paris
email: bouyer@ensta.fr
--