From owner-freebsd-stable@FreeBSD.ORG Thu Jan 11 19:20:10 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EDA016A4FE for ; Thu, 11 Jan 2007 19:20:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id ED67413C455 for ; Thu, 11 Jan 2007 19:20:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l0BJJpvE098914; Thu, 11 Jan 2007 14:19:59 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-stable@freebsd.org Date: Thu, 11 Jan 2007 13:00:28 -0500 User-Agent: KMail/1.9.1 References: <1166461097.1296.4.camel@buffy.york.ac.uk> <1166465500.1292.7.camel@buffy.york.ac.uk> In-Reply-To: <1166465500.1292.7.camel@buffy.york.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701111300.29080.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 11 Jan 2007 14:20:03 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2436/Thu Jan 11 06:48:19 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: anholt@freebsd.org Subject: Re: radeon panic: mtx_lock() of destroyed mutex @ /usr/src/sys/modules/drm/radeon/../../../dev/drm/radeon_irq.c:128 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2007 19:20:10 -0000 On Monday 18 December 2006 13:11, Gavin Atkinson wrote: > On Mon, 2006-12-18 at 16:58 +0000, Gavin Atkinson wrote: > > > I've determined that this lock has been destroyed even before glxgears > > runs - I guess it's just the first attempt at 3D rendering that triggers > > it? > > Indeed, what's happening is that something calls drm_irq_install() in > src/sys/dev/drm/drm_irq.c. This code fails to allocate a resource: > > dev->irqrid = 0; > dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ, > &dev->irqrid, RF_SHAREABLE); > > The error handler is then called, which destroys the IRQ mutex. This > all happens while X is initialising. > > Later on, when glxgears is run, radeon_wait_irq() in > src/sys/dev/drm/radeon_irq.c is called, which does a DRM_WAIT_ON, which > tries to acquire the destroyed mutex. > > So, it looks like there should be some checking somewhere that > dev->irq_enabled is non-zero before trying to acquire this mutex. I > don't know where it should go, though. Probably it needs to not create the /dev/drm0 device unless it is able to allocate resources. That is, it should do something like this in attach: bus_alloc_resource_any(..., SYS_RES_MEMORY, ...) bus_alloc_resource_any(..., SYS_RES_IRQ, ...) bus_setup_intr(...) make_dev(...) Where if any step fails it undoes the previous steps and fails to attach. -- John Baldwin