Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2002 00:05:20 +0100
From:      Thomas Quinot <thomas@FreeBSD.ORG>
To:        Christian Brueffer <chris@unixpages.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: apm suspend/resume panic - atapicam related
Message-ID:  <20021117230520.GB31217@melusine.cuivre.fr.eu.org>
In-Reply-To: <20021117032558.GF11536@unixpages.org>
References:  <20021117032558.GF11536@unixpages.org>

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

> fangorn# ata0: resetting devices .. done
> ata1: resetting devices .. ata1-slave: ATAPI identify retries exceeded
> done

OK, it looks to me like we are invalidating the param field of the
struct atadev for your ata1 slave (BTW, a complete dmesg.boot would be
useful here.

> Fatal trap 12: page fault while in kernel mode
> fault virtual address   = 0x1
> fault code              = supervisor read, page not present
> instruction pointer     = 0x8:0xc0155171
> stack pointer           = 0x10:0xc032c8b4
> frame pointer           = 0x10:0xc032c8b4
> code segment            = base 0x0, limit 0xfffff, type 0x1b
>                         = DPL 0, pres 1, def32 1, gran 1
> processor eflags        = interrupt enabled, resume, IOPL = 0
> current process         = Idle
> interrupt mask          = bio
> kernel: type 12 trap, code=0
> Stopped at      atapi_start+0x9:        movzbw  0x1(%eax),%ax
> db> tr
> atapi_start(c15d0f50) at atapi_start+0x9
> ata_start(c15d0f00,c02ebe16,c15c3900,c03957c0,4000000) at ata_start+0xda
> ata_reinit(c15d0f00,c15c3900,c032c900,c01291a6,c15c3900) at ata_reinit+0x2ed

Makes sense. What I cannot entirely figure out is why this does not
happen when you disable ATAPI/CAM. Supposing that your ATAPI device
is a CD drive, do you also have atapicd in the kernel? Does the
'identify retries exceeded message' also occur when you disable
atapicam? When you disable atapicam, is atapicd enabled?

Also, it would be interesting to know whether the enclosed patch works
around the problem. It is likely to make your ata1-slave device unusable
after a suspend/resume, in which case you should then perform an
'atacontrol reinit 1' and see if it improves the situation. If you can
test this, please also do an 'atacontrol list 1' and 'camcontrol
devlist' at each step.

Thanks for taking the time to report this issue!

Thomas.

Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.158
diff -u -r1.158 ata-all.c
--- ata-all.c	7 Nov 2002 22:23:46 -0000	1.158
+++ ata-all.c	17 Nov 2002 22:59:28 -0000
@@ -906,14 +906,20 @@
     if (newdev & ATA_ATAPI_MASTER && !ch->device[MASTER].driver)
 	atapi_attach(&ch->device[MASTER]);
     else if (ch->devices & (ATA_ATAPI_MASTER) && ch->device[MASTER].driver) {
-	ata_getparam(&ch->device[MASTER], ATA_C_ATAPI_IDENTIFY);
-	atapi_reinit(&ch->device[MASTER]);
+	if (ata_getparam(&ch->device[MASTER], ATA_C_ATAPI_IDENTIFY)) {
+    		ata_printf(ch, ATA_MASTER, "ata_getparam failed\n");
+		ch->devices &= ~ATA_ATAPI_MASTER;
+	} else
+		atapi_reinit(&ch->device[MASTER]);
     }
     if (newdev & ATA_ATAPI_SLAVE && !ch->device[SLAVE].driver)
 	atapi_attach(&ch->device[SLAVE]);
     else if (ch->devices & (ATA_ATAPI_SLAVE) && ch->device[SLAVE].driver) {
-	ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY);
-	atapi_reinit(&ch->device[SLAVE]);
+	if (ata_getparam(&ch->device[SLAVE], ATA_C_ATAPI_IDENTIFY)) {
+    		ata_printf(ch, ATA_SLAVE, "ata_getparam failed\n");
+		ch->devices &= ~ATA_ATAPI_SLAVE;
+	} else
+		atapi_reinit(&ch->device[SLAVE]);
     }
 #endif
 #ifdef DEV_ATAPICAM

-- 
    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?20021117230520.GB31217>