From patchwork Wed Mar 13 16:42:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaro Koskinen X-Patchwork-Id: 2271321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 55B2F3FC8A for ; Thu, 14 Mar 2013 14:08:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39192E68EE for ; Thu, 14 Mar 2013 07:08:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from filtteri1.pp.htv.fi (filtteri1.pp.htv.fi [213.243.153.184]) by gabe.freedesktop.org (Postfix) with ESMTP id 08417E6473 for ; Wed, 13 Mar 2013 09:42:17 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by filtteri1.pp.htv.fi (Postfix) with ESMTP id 877DF21B708; Wed, 13 Mar 2013 18:42:15 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri1.pp.htv.fi [213.243.153.184]) (amavisd-new, port 10024) with ESMTP id 7zRfaBWZGlwl; Wed, 13 Mar 2013 18:42:15 +0200 (EET) Received: from musicnaut.iki.fi (cs181064211.pp.htv.fi [82.181.64.211]) by smtp5.welho.com (Postfix) with SMTP id 2DC015BC004; Wed, 13 Mar 2013 18:42:14 +0200 (EET) Received: by musicnaut.iki.fi (sSMTP sendmail emulation); Wed, 13 Mar 2013 18:42:12 +0200 Date: Wed, 13 Mar 2013 18:42:12 +0200 From: Aaro Koskinen To: Ben Skeggs Subject: Re: linux 3.9-rc1: nouveau crash on PPC Message-ID: <20130313164212.GD8798@blackmetal.musicnaut.iki.fi> References: <20130309184431.GF14552@blackmetal.musicnaut.iki.fi> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130309184431.GF14552@blackmetal.musicnaut.iki.fi> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Thu, 14 Mar 2013 07:05:16 -0700 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Hi, On Sat, Mar 09, 2013 at 08:44:31PM +0200, Aaro Koskinen wrote: > There's nouveau crash during boot with 3.9-rc1 on iMac G5 (nVidia GeForce > FX 5200 Ultra). This happens also with current mainline kernel HEAD > (0aefda3e8188ad71168bd32152d41b3d72f04087). > > git bisect tells the first bad commit is > 1d7c71a3e2f77336df536855b0efd2dc5bdeb41b (drm/nouveau/disp: port vblank > handling to event interface). > > The crash is (manually copied from screen): > > [...] > > Unable to handle kernel paging request for data at address 0x100000000 > > call trace: > nouveau_event_trigger The cause is event handling linked lists getting corrupted. I'm not sure how that code is intented to work, but with the below HACK I can at least boot the iMac without crashing, and get a working display: A. diff --git a/drivers/gpu/drm/nouveau/core/core/event.c b/drivers/gpu/drm/nouveau/core/core/event.c index 6d01e0f..ab8d6c7 100644 --- a/drivers/gpu/drm/nouveau/core/core/event.c +++ b/drivers/gpu/drm/nouveau/core/core/event.c @@ -29,7 +29,7 @@ nouveau_event_put_locked(struct nouveau_event *event, int index, { if (!--event->index[index].refs) event->disable(event, index); - list_del(&handler->head); + list_del(&handler->heads[index]); } void @@ -39,7 +39,7 @@ nouveau_event_put(struct nouveau_event *event, int index, unsigned long flags; spin_lock_irqsave(&event->lock, flags); - if (index < event->index_nr) + if (index < ARRAY_SIZE(handler->heads) && index < event->index_nr) nouveau_event_put_locked(event, index, handler); spin_unlock_irqrestore(&event->lock, flags); } @@ -51,8 +51,8 @@ nouveau_event_get(struct nouveau_event *event, int index, unsigned long flags; spin_lock_irqsave(&event->lock, flags); - if (index < event->index_nr) { - list_add(&handler->head, &event->index[index].list); + if (index < ARRAY_SIZE(handler->heads) && index < event->index_nr) { + list_add(&handler->heads[index], &event->index[index].list); if (!event->index[index].refs++) event->enable(event, index); } @@ -69,7 +69,7 @@ nouveau_event_trigger(struct nouveau_event *event, int index) return; spin_lock_irqsave(&event->lock, flags); - list_for_each_entry_safe(handler, temp, &event->index[index].list, head) { + list_for_each_entry_safe(handler, temp, &event->index[index].list, heads[index]) { if (handler->func(handler, index) == NVKM_EVENT_DROP) { nouveau_event_put_locked(event, index, handler); } diff --git a/drivers/gpu/drm/nouveau/core/include/core/event.h b/drivers/gpu/drm/nouveau/core/include/core/event.h index 9e09440..ba52172 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/event.h +++ b/drivers/gpu/drm/nouveau/core/include/core/event.h @@ -6,7 +6,7 @@ #define NVKM_EVENT_KEEP 1 struct nouveau_eventh { - struct list_head head; + struct list_head heads[2]; int (*func)(struct nouveau_eventh *, int index); };