Subject: Re: kern/22869: Slave IDE drive not detected
To: Charles M. Hannum <abuse@spamalicious.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 09/22/2003 21:53:21
On Mon, Sep 22, 2003 at 07:29:53PM +0000, Charles M. Hannum wrote:
> 
> > They may do it in backgroud, while doing others tasks. Also, A bios with
> > all devices turned to "auto" will take longer than with unexistent devices
> > turned off.
> 
> My entire BIOS POST sequence takes less than 31s, so I sincerely doubt
> that's the case.

I've not seen a NetBSD probe take more than a few seconds per channel for
a long time either. 31s happens when we try to reset a channel with no
devices; the current code should now avoid that completely.

> 
> > It may be possible to speed up ghost detection via a command:
> > - we may have a ghost only if we have the same signature for device 0 and
> >   device 1 after a reset
> > - if we may have a ghost, issue IDENTIFY or ATAPI_IDENTIFY as appropriate.
> >   After that, we should have either BSY set, or DRQ set, or an aborted
> >   command. If the status register remains all 0, then this isn't a real
> >   device.
> 
> Hm, that might work.  The flowchart in the spec seems to indicate that
> DRQ should be asserted before BSY is cleared, but is that guaranteed?

I think so, all the specs I've seen indicates that BSY has to be cleared
last. Without this we could probably find senarios where a polled command
would not work as expected.

> > Note that we have to IDENTIFY both device, as in a slave-only config the
> > controller may fake a master.
> 
> No, the slave will never fake the master registers, because it can't
> know whether or not a master is present.  (The master only knows the
> presence of the slave via DASP and PDIAG, which are one-way.)

The slave won't but the controller can. I've seen this happen.
I don't think it posted a valid signature after reset in this case though.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--