Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 14:11:44 +0100
From:      Thomas Quinot <thomas@FreeBSD.ORG>
To:        Christian Brueffer <chris@unixpages.org>
Cc:        Thomas Quinot <thomas@FreeBSD.ORG>, freebsd-stable@FreeBSD.ORG
Subject:   Re: apm suspend/resume panic - atapicam related
Message-ID:  <20021119131144.GA30227@melusine.cuivre.fr.eu.org>
In-Reply-To: <20021119122549.GJ11536@unixpages.org>
References:  <20021117032558.GF11536@unixpages.org> <20021117230520.GB31217@melusine.cuivre.fr.eu.org> <20021118135148.GH11536@unixpages.org> <20021118171053.GA82889@melusine.cuivre.fr.eu.org> <20021119122549.GJ11536@unixpages.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Le 2002-11-19, Christian Brueffer écrivait :

> The panic also appears with atapicam enabled and atapicd disabled.
> Here's a panic from a kernel with your patch:

Thanks, this is very useful information. I think I am beginning to
understand what is going on. Please try the patch below.


> ata0: resetting ata ch=0xc15a9000, dev=1 .. ndev=1 done
> ata1: resetting ata ch=0xc15d0f00, dev=4 .. ndev=c ata1-slave: ATAPI identify retries exceeded

Here we have a 'ghost' device that appears at the ata1 slave position,
but since there is no actual device replying there, the structures that
describe that device are left in an inconsistent state (specifically,
the devices field in the struct ata_channel will flag the device as
present, but the corresponding struct ata_device won't be correctly
initialized).

This is not fatal with atapicd because in such case, it simply won't
attach the acd driver, but on the other hand atapicam relies on the
devices field of struct ata_channel to describe actually present,
correctly initialized devices.

Thomas.

Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.50.2.42
diff -u -r1.50.2.42 ata-all.c
--- ata-all.c	1 Nov 2002 22:04:06 -0000	1.50.2.42
+++ ata-all.c	19 Nov 2002 13:05:07 -0000
@@ -872,8 +872,9 @@
     ATA_FORCELOCK_CH(ch, ATA_CONTROL);
     ch->running = NULL;
     devices = ch->devices;
-    ata_printf(ch, -1, "resetting devices .. ");
+    ata_printf(ch, -1, "resetting ata ch=%p, dev=%x .. ", ch, ch->devices);
     ata_reset(ch);
+    printf (" ndev=%x ", ch->devices);
 
     if ((misdev = devices & ~ch->devices)) {
 	if (misdev)
@@ -904,17 +905,18 @@
     if ((newdev = ~devices & ch->devices)) {
 	if (newdev & ATA_ATA_MASTER)
 	    if (ata_getparam(&ch->device[MASTER], ATA_C_ATA_IDENTIFY))
-		newdev &= ~ATA_ATA_MASTER;
+		ch->devices &= ~ATA_ATA_MASTER;
 	if (newdev & ATA_ATA_SLAVE)
 	    if (ata_getparam(&ch->device[SLAVE], ATA_C_ATA_IDENTIFY))
-		newdev &= ~ATA_ATA_SLAVE;
+		ch->devices &= ~ATA_ATA_SLAVE;
 	if (newdev & ATA_ATAPI_MASTER)
 	    if (ata_getparam(&ch->device[MASTER], ATA_C_ATAPI_IDENTIFY))
-		newdev &= ~ATA_ATAPI_MASTER;
+		ch->devices &= ~ATA_ATAPI_MASTER;
 	if (newdev & ATA_ATAPI_SLAVE)
 	    if (ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY))
-		newdev &= ~ATA_ATAPI_SLAVE;
+		ch->devices &= ~ATA_ATAPI_SLAVE;
     }
+    newdev = ~devices & ch->devices;
     if (!misdev && newdev)
 	printf("\n");
 #if NATADISK > 0

-- 
    Thomas.Quinot@Cuivre.FR.EU.ORG

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021119131144.GA30227>