Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is ATA partially broken in -STABLE?

0 views
Skip to first unread message

Jon Larssen

unread,
Mar 21, 2002, 10:36:22 PM3/21/02
to
Hi,

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

Sam Leffler

unread,
Mar 21, 2002, 11:24:43 PM3/21/02
to
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.

Sam

ata-patch

Jon Larssen

unread,
Mar 21, 2002, 11:51:25 PM3/21/02
to
Hi,

>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

Ian Dowse

unread,
Mar 22, 2002, 4:14:24 AM3/22/02
to
In message <F67M19VMczi9y...@hotmail.com>, Jon Larssen writes:
>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

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

Søren Schmidt

unread,
Mar 22, 2002, 4:33:16 AM3/22/02
to
It seems Ian Dowse wrote:
> In message <F67M19VMczi9y...@hotmail.com>, Jon Larssen writes:
> >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
>
> 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.

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

Ian Dowse

unread,
Mar 22, 2002, 7:29:49 AM3/22/02
to
In message <200203220933...@freebsd.dk>, Søren Schmidt writes:
>Its a known problem, the old way of solving it was:

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

Søren Schmidt

unread,
Mar 22, 2002, 7:48:43 AM3/22/02
to
It seems Ian Dowse wrote:
> In message <200203220933...@freebsd.dk>, Søren Schmidt writes:
> >Its a known problem, the old way of solving it was:
>
> 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.

The driver used asleep to avoid the race before the MFC, one of
those got lost in the MFC, sorry...

-Søren

Sam Leffler

unread,
Mar 22, 2002, 11:41:44 AM3/22/02
to
Actually, two races were reintroduced--one for disks and one for cdroms.
Please see my note with a tested patch.

Sam

Wilko Bulte

unread,
Mar 22, 2002, 12:10:42 PM3/22/02
to
On Fri, Mar 22, 2002 at 08:41:44AM -0800, Sam Leffler wrote:
> Actually, two races were reintroduced--one for disks and one for cdroms.
> Please see my note with a tested patch.

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

0 new messages