From owner-freebsd-current@FreeBSD.ORG Thu Oct 25 20:53:16 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3626016A418 for ; Thu, 25 Oct 2007 20:53:16 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.freebsd.org (Postfix) with ESMTP id A7FEB13C48E for ; Thu, 25 Oct 2007 20:53:15 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so682658uge for ; Thu, 25 Oct 2007 13:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=j6EJTTM/hjs4AfjQpLuPXDULn4qatY0aFrHW7iWXwHU=; b=MOJnpEZEIy2J8Y8SKJdLI524oYkt7jznnVsTuYGwNp2zsAdLlV63m7Q5GdSNnIMafCb+HydYTlvTZVBElVXX5e8FK0Vfop4H4BHJDzRMpmTRj/YbqtYA7Gh9/BxRkykjHN3y5P8tsqvZ70OR+s6//D/OpX7/1Q7fv2w5sjyVNwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=e1nFpglZ8yhs+4Amhey0DZQq4aoNyzn8eRU9CtjSdXOCSv/S+X5RsYy+6QOweiwBPOrpfEa7UBBFjDpRn6prJtkJKS9Gd563wRXdzWjosNGSWI6QfWQouNKwVNjvtG68cGb6dxBhbgP8YnVE1N7cEMK8u678Xq/Gf2ndVvQvIr8= Received: by 10.78.170.6 with SMTP id s6mr1765425hue.1193345594045; Thu, 25 Oct 2007 13:53:14 -0700 (PDT) Received: by 10.78.168.9 with HTTP; Thu, 25 Oct 2007 13:53:13 -0700 (PDT) Message-ID: Date: Fri, 26 Oct 2007 00:53:13 +0400 From: pluknet To: "John Baldwin" In-Reply-To: <200710251434.18764.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710251434.18764.jhb@freebsd.org> Cc: anholt@freebsd.org, freebsd-current@freebsd.org Subject: Re: agp.ko panic: vm_fault: fault on nofault entry, addr: deadc000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 25 Oct 2007 20:53:16 -0000 On 25/10/2007, John Baldwin wrote: > On Saturday 20 October 2007 10:30:31 pm pluknet wrote: > > Hello all. > > > > I could produce panic while kldunload'ing agp.ko. > > > > It's on 7.0-CURRENT from Oct 11 (just before RELENG_7), i386, UP, > > Intel 82855GME (855GME GMCH) SVGA controller. > > Some debugging below: > > > > panic: vm_fault: fault on nofault entry, addr: deadc000 > > KDB: enter: panic > > This is caused by the agp_i810() driver calling agp_generic_detach() first > which frees the memory resource for the aperture. Other AGP drivers do the > same thing. I think the proper fix is to split agp_generic_detach() into two > pieces. The first part would do a destroy_dev() of the /dev node and the > various agp_foo_detach() methods would call that first. The rest > agp_generic_detach() would be called at the end of the agp_foo_detach() > methods. Yes, I forgot to note that there was a message about memory leakage on panic. > > A possible patch (untested) is at > http://www.FreeBSD.org/~jhb/patches/agp_detach.patch and included below: Thank you. This patch fixes my issue. Now all three modules (drm, agp, i915) unloaded without a panic. > > -- > John Baldwin > wbr, pluknet