From owner-freebsd-current@FreeBSD.ORG Wed Mar 16 18:11:58 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 463BB16A4CE; Wed, 16 Mar 2005 18:11:58 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BF3143D49; Wed, 16 Mar 2005 18:11:58 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id 0AE2372DDB; Wed, 16 Mar 2005 10:11:58 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id 0812C72DD4; Wed, 16 Mar 2005 10:11:58 -0800 (PST) Date: Wed, 16 Mar 2005 10:11:58 -0800 (PST) From: Doug White To: Max Khon In-Reply-To: <20050316053338.GA69911@samodelkin.net> Message-ID: <20050316101107.C24083@carver.gumbysoft.com> References: <20050316053338.GA69911@samodelkin.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org cc: sos@freebsd.org Subject: Re: ATAng: reboot after panic, crashdumps [PATCH] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2005 18:11:58 -0000 On Wed, 16 Mar 2005, Max Khon wrote: > Hi! > > Attached patch fixes reboot after panic for me on RELENG_5 and RELENG_5_3. > Crashdumps work again for me as well. > > The problem was in ata_shutdown() -- ATA_FLUSHCACHE request issued from > ata_shutdown() never completes (ata_queue_request() sleeps in > sema_wait(&request->done)) because ata_interrupt() is never called > (callouts do not work as well, so that if the controller is busy > ATA_FLUSHCACHE was not retried). > > I am not sure if "if (panicstr == NULL)" check is required (for normal > shutdown sequence). addump() does not check if we are shutting down > cleanly (ata_flushcache() was copy-n-pasted from addump()) and always > uses atadev->channel->hw.begin_transaction(&request)/end_transaction(&request) > directly. This part here: + if (atadev->channel->hw.begin_transaction(&request) == ATA_OP_CONTINUES) { + do { + DELAY(20); + } while (atadev->channel->hw.end_transaction(&request) == ATA_OP_CONTINUES); looks like it could get stuck in an infinite loop if the controller is hung. I'm not familiar with the ata code so i don't nkow if this is handled elsewhere, but I figure I'd ask :) -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org