(unknown charset) Re: ATAPI CD still not detected, verbose boot logs available

From: (unknown charset) Bruce Evans <bde_at_zeta.org.au>
Date: Tue, 2 Dec 2003 22:52:33 +1100 (EST)
On Tue, 2 Dec 2003, Soren Schmidt wrote:

> It seems Christoph Sold wrote:
> > FreeBSD 5.2-B still does not detect my ATAPI DVD-ROM drive. This used to
> > work until Søren's ATAng commits. Other OSes (Win, Linux, Solaris)
> > detect the drive appropriately.
>
> Hmm from the bootlogs it seems that your drive does not set the proper
> ATAPI signature, thats why detection fails:
>
> atapci0: <VIA 82C686A UDMA66 controller> port 0xd800-0xd80f at device 4.1 on pci0
> ata0: reset tp1 mask=03 ostat0=50 ostat1=50
> ata0-master: stat=0x80 err=0x80 lsb=0x80 msb=0x80
               !!!!!!!!! bit 0x80 set says that the master is busy
> ata0-slave:  stat=0x00 err=0x01 lsb=0x14 msb=0x80
>                                          ^^^^^^^^ should be 0xeb
> ata0-master: stat=0x50 err=0x01 lsb=0x00 msb=0x00
               !!!!!!!!! now the master is unbusy
> ata0: reset tp2 mask=03 stat0=50 stat1=00 devices=0x1<ATA_MASTER>
> ata0: at 0x1f0 irq 14 on atapci0
> ata0: [MPSAFE]

Accessing the slave while the master is busy is invalid.  I believe the
failure mechanism is that the master keeps driving the bus while it is
busy, so reads of the slave registers give garbage.  This isn't a problem
unless the slave becomes ready first and it manages to write a success
code to the "err" register.  Then we trust the garbage.  It doesn't help
that the master eventually becomes ready, since we don't read the slave
registers again.

> There isn't much I can do about that one except you experimenting with
> the device and finding out why it fails setting the right signature....

Er, I sent patches for this a few months ago.  After reanalysing their
debugging putput combined with the above debugging output, I think
this bug is is the usual case if there are 2 drives and the drives'
timing after reset is as follows:

	o The master must take more than 100 msec to become ready.
	  Otherwise the 100 msec initial delay hides the bug.
	o The slave must become ready before the master.  Otherwise
	  there is no problem with using garbage slave registers,
	  although accessing them is strictly invalid.

The bug is just not often seen since most drives don't take 100 msec to
become ready.  I only see it on a system with an 8-9 year old pre-ATA
IDE drive that takes 574 msec to become ready.

For a quick fix, try increasing the initial delay of 100 msec to a second
or more.

Bruce
Received on Tue Dec 02 2003 - 02:53:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:32 UTC