From patchwork Tue Nov 6 14:03:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel J Blueman X-Patchwork-Id: 1705121 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 608913FCDE for ; Tue, 6 Nov 2012 15:59:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22B0A9E91B for ; Tue, 6 Nov 2012 07:59:57 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f49.google.com (mail-da0-f49.google.com [209.85.210.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 0403B9E839 for ; Tue, 6 Nov 2012 06:03:49 -0800 (PST) Received: by mail-da0-f49.google.com with SMTP id q27so200377daj.36 for ; Tue, 06 Nov 2012 06:03:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=1uiPCjglGTju/we+y1TRdpc4cu8S+b5gnrJrEeZMsqY=; b=VlMz5GtG1WaDErqdD47Kp1+vKZK8urQ6hhfKwk9UTPI3O7nSUxhLkPYtHhoIo3NfSF dyTu+m3lstOaslNvtGBo5QFNJVzZHgmKROSNp3ye+pzCrfpLqeK7R7eLKhsapEcgNh9j xrD6j9rGwMI1HxGV8N3eSlnF7UvsVE3iph0ABh1V/MoiBVXn7JFkmNheBUjmo444u9VV YYgOxXbzu+Jkm1gshrYitF2sNTkfkfV2h6t9NsZ2n/Y5boBCiVhjfCFg2hVcebsGSVet miwGCgekl0fP0OPPU0nq7HsKy6WezXLP/zDTRFCZdpGVAHHZQdg48FBlJIXK2/UI//Ia mAqQ== Received: by 10.66.76.9 with SMTP id g9mr3017469paw.17.1352210629667; Tue, 06 Nov 2012 06:03:49 -0800 (PST) Received: from localhost.localdomain (bb116-14-119-144.singnet.com.sg. [116.14.119.144]) by mx.google.com with ESMTPS id n7sm12512287pav.26.2012.11.06.06.03.46 (version=SSLv3 cipher=OTHER); Tue, 06 Nov 2012 06:03:48 -0800 (PST) From: Daniel J Blueman To: David Airlie Subject: [PATCH] nouveau: Fix crash after D3 Date: Tue, 6 Nov 2012 22:03:40 +0800 Message-Id: <1352210620-4200-1-git-send-email-daniel@quora.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlAaGzW6USMfA56GpeZOwa3hAK3suGJs8Ltq6/6XzbHmY4Vno6Jo/MijUFMbJtc7MB/ZX9Q X-Mailman-Approved-At: Tue, 06 Nov 2012 07:58:42 -0800 Cc: nouveau@lists.freedesktop.org, Daniel J Blueman , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.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: , MIME-Version: 1.0 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 In 3.7-rc4, when starting X with the integrated GPU and suspending the discrete GPU, after one or more 32-bit applications are used (eg Skype) and X is stopped, we hit a panic. Prevent this by testing if the fini function is valid. Full panic bootlog is at: http://quora.org/2012/nouveau/dmesg-crash.txt Xorg.log is at: http://quora.org/2012/nouveau/Xorg.0.log-crash.txt Kernel log after fix is at: http://quora.org/2012/nouveau/dmesg-fix.txt Signed-off-by: Daniel J Blueman --- drivers/gpu/drm/nouveau/core/core/object.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/core/object.c b/drivers/gpu/drm/nouveau/core/core/object.c index 0daab62..3da3525 100644 --- a/drivers/gpu/drm/nouveau/core/core/object.c +++ b/drivers/gpu/drm/nouveau/core/core/object.c @@ -354,12 +354,16 @@ static int nouveau_object_decf(struct nouveau_object *object) { int ret; + struct nouveau_ofuncs *pfuncs; nv_trace(object, "stopping...\n"); - ret = nv_ofuncs(object)->fini(object, false); - if (ret) - nv_warn(object, "failed fini, %d\n", ret); + pfuncs = nv_ofuncs(object); + if (pfuncs->fini) { + ret = nv_ofuncs(object)->fini(object, false); + if (ret) + nv_warn(object, "failed fini, %d\n", ret); + } if (object->engine) { mutex_lock(&nv_subdev(object->engine)->mutex);