Subject: kern/22869 and ghost detection for IDE controllers
To: None <tech-kern@netbsd.org>
From: Quentin Garnier <netbsd@quatriemek.com>
List: tech-kern
Date: 09/20/2003 20:26:48
Some people reported issues with the new wdc.c code committed yesterday,
with the kernel showing 'ghost detected' messages and preventing any slave
device to be found (see PR kern/22869).

I've been doing some digging today but I couldn't find any real IDE
specification. Though I saw the following:

> Mind: BOTH devices will get their registers WRITTEN. Any data or
> register READ will come from the selected device. ONLY the
> selected device will execute commands.

in http://www.ent.ohiou.edu/~welker/ide.txt.

I don't know what this is worth, but I can tell this is exactly what is
happening on my hardware, on probably on other's.

The ghost detection algorithm does the following:

write 1 to <some data register> for drive 1
write 2 to <some data register> for drive 0
read <some data register> for drive 1
if value read is 2 then disbale drive 1 and print message about a ghost
detected.

Of course, if the citation above is true, this code will always detect a
ghost.

Maybe someone more clueful with IDE can confirm or infirm this, in the
meantime I suggest this piece of code should be at least commented out.

-- 
Quentin Garnier - cube@cubidou.net
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.