From owner-freebsd-stable Tue Nov 19 5:11:55 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E87737B401; Tue, 19 Nov 2002 05:11:53 -0800 (PST) Received: from melusine.cuivre.fr.eu.org (melusine.cuivre.fr.eu.org [62.212.105.185]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4139E43E91; Tue, 19 Nov 2002 05:11:52 -0800 (PST) (envelope-from thomas@FreeBSD.ORG) Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000) id D13D92C3D2; Tue, 19 Nov 2002 14:11:44 +0100 (CET) Date: Tue, 19 Nov 2002 14:11:44 +0100 From: Thomas Quinot To: Christian Brueffer Cc: Thomas Quinot , freebsd-stable@FreeBSD.ORG Subject: Re: apm suspend/resume panic - atapicam related Message-ID: <20021119131144.GA30227@melusine.cuivre.fr.eu.org> Reply-To: Thomas Quinot 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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20021119122549.GJ11536@unixpages.org> User-Agent: Mutt/1.4i X-message-flag: WARNING! Using Outlook can damage your computer. Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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