I have just cvsup'd my -STABLE system running under VMware 3
Workstation under Windows 2000. After making world and a
GENERIC kernel I can't boot into my system. These are the
messages I get:
ata0-master: timeout waiting for interrupt
ata0-master: ATA identify failed
ata1-master: timeout waiting for interrupt
ata1-master: ATAPI identify failed
Mounting root from ufs:/dev/ad0s1a
no such device 'ad'
setrootbyname failed
and then of course will of course ask me to manually supply
the boot filesystem. What's is strange is that I kept an old
kernel that _does_ boot and finds ad.
Is ATA support semi-broken or I am the one broken? :^)
Best regards,
Jon.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
>This is a regression introduced in rev 1.50.2.30. The asleep+await
>calls that closed two races in the driver were removed. Soren is
>aware of it. Attached is a patch that fixes it for me.
Thanks for the prompt reply. Lemme ask you how do I apply this patch. I'm
thinking of:
# cd /usr/src/sys/dev/ata
# cat <the_patch_file> | patch -p0
Is this OK? I wouldn't like to fsck this up ;^)
> Sam
Thanks a lot,
Jon.
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
I get something similar with VMware2. The following patch seems to work
for me, but I haven't really investigated the problem. It is the change
in ata_boot_attach() below that actually makes the difference; I think
the ata_attach bit won't affect boot-time probes.
Ian
Index: ata-all.c
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.50.2.30
diff -u -r1.50.2.30 ata-all.c
--- ata-all.c 18 Mar 2002 08:37:33 -0000 1.50.2.30
+++ ata-all.c 22 Mar 2002 09:06:30 -0000
@@ -162,7 +162,7 @@
ata_attach(device_t dev)
{
struct ata_channel *ch;
- int error, rid;
+ int error, rid, s;
if (!dev || !(ch = device_get_softc(dev)))
return ENXIO;
@@ -186,6 +186,7 @@
* otherwise attach what the probe has found in ch->devices.
*/
if (!ata_delayed_attach) {
+ s = splbio();
if (ch->devices & ATA_ATA_SLAVE)
if (ata_getparam(&ch->device[SLAVE], ATA_C_ATA_IDENTIFY))
ch->devices &= ~ATA_ATA_SLAVE;
@@ -210,6 +211,7 @@
if (ch->devices & ATA_ATAPI_SLAVE)
atapi_attach(&ch->device[SLAVE]);
#endif
+ splx(s);
}
return 0;
}
@@ -469,13 +471,14 @@
ata_boot_attach(void)
{
struct ata_channel *ch;
- int ctlr;
+ int ctlr, s;
if (ata_delayed_attach) {
config_intrhook_disestablish(ata_delayed_attach);
free(ata_delayed_attach, M_TEMP);
ata_delayed_attach = NULL;
}
+ s = splbio();
/*
* run through all ata devices and look for real ATA & ATAPI devices
@@ -522,6 +525,7 @@
atapi_attach(&ch->device[SLAVE]);
}
#endif
+ splx(s);
}
static void
Its a known problem, the old way of solving it was:
diff -u -r1.50.2.30 ata-all.c
--- ata-all.c 2002/03/18 08:37:33 1.50.2.30
+++ ata-all.c 2002/03/21 08:39:59
@@ -1039,13 +1039,14 @@
case ATA_WAIT_INTR:
atadev->channel->active |= ATA_WAIT_INTR;
+ asleep((caddr_t)atadev->channel, PRIBIO, "atacmd", 10 * hz);
ATA_OUTB(atadev->channel->r_io, ATA_CMD, command);
/* enable interrupt */
if (atadev->channel->flags & ATA_QUEUED)
ATA_OUTB(atadev->channel->r_altio, ATA_ALTSTAT, ATA_A_4BIT);
- if (tsleep((caddr_t)atadev->channel, PRIBIO, "atacmd", 10 * hz)) {
+ if (await(PRIBIO, 10 * hz)) {
ata_prtdev(atadev, "timeout waiting for interrupt\n");
atadev->channel->active &= ~ATA_WAIT_INTR;
error = -1;
-Søren
Ok - is there a good reason for not using spl calls to block the
interrupt until the tsleep(), or is it just an oversight? I guess
maybe you are trying to avoid the delay associated with deferring
the interrupt, but it must open up a number of races, especially
if the ATA interrupt line is shared with something else.
Ian
The driver used asleep to avoid the race before the MFC, one of
those got lost in the MFC, sorry...
-Søren
Sam
Could it be that this problem also influences a sysinstall?
I built a 4.5-STABLE 'release' and the resulting CD boots just fine from
IDE CD (according to the the device probe messages) but sysinstall tells
me that it does not find a CDROM drive to install from.
Verified on two different Proliant models, on both 4.5R sysinstall
works just fine
Wilko
---end of quoted text---
--
| / o / /_ _ wi...@FreeBSD.org
|/|/ / / /( (_) Bulte Arnhem, the Netherlands