From patchwork Thu Jul 30 10:28:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 6907661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20627C05AC for ; Fri, 31 Jul 2015 01:04:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50A4220608 for ; Fri, 31 Jul 2015 01:04:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 67B4820592 for ; Fri, 31 Jul 2015 01:04:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C47E7A189; Thu, 30 Jul 2015 18:04:35 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 517 seconds by postgrey-1.34 at gabe; Thu, 30 Jul 2015 03:36:45 PDT Received: from outbound-smtp01.blacknight.com (outbound-smtp01.blacknight.com [81.17.249.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 448C77A12A for ; Thu, 30 Jul 2015 03:36:45 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id 60BBD993B8 for ; Thu, 30 Jul 2015 10:28:06 +0000 (UTC) Received: (qmail 6877 invoked from network); 30 Jul 2015 10:28:06 -0000 Received: from unknown (HELO localhost.localdomain) (pure.logic@nexus-software.ie@[176.61.64.9]) by 81.17.254.9 with ESMTPSA (AES128-SHA encrypted, authenticated); 30 Jul 2015 10:28:06 -0000 From: Bryan O'Donoghue To: airlied@linux.ie, bskeggs@redhat.com, maarten.lankhorst@canonical.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/nouveau/gem: tolerate a buffer specified multiple times Date: Thu, 30 Jul 2015 11:28:05 +0100 Message-Id: <1438252085-4773-1-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 30 Jul 2015 18:04:29 -0700 Cc: Bryan O'Donoghue X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ubuntu is shipping Chrome Version 44.0.2403.125 (64-bit). With this version of the browser and current tip-of-tree 86ea07ca846a I get the following error message followed by a lock-up of X. nouveau E[chrome[2737]] multiple instances of buffer 33 on validation list nouveau E[chrome[2737]] validate_init nouveau E[chrome[2737]] validate: -22 nouveau E[chrome[2737]] multiple instances of buffer 18 on validation list nouveau E[chrome[2737]] validate_init nouveau E[chrome[2737]] validate: -22 nouveau E[ PFIFO][0000:01:00.0] PFIFO: read fault at 0x0003e21000 [PAGE_NOT_PRESENT] from (unknown enum 0x00000000)/GPC0/(unknown enum 0x0000000f) on channel 0x007f80c000 [unknown] This patch suggests a fix for this with the kernel simply tolerating an application such as chrome requesting the same buffer more than once. With the version of chrome given above, you can elicit this behaviour by clicking on the bookmarks drop down. This will open another window on-top of the current window. Minus the fix included here, this will lead to hard lockup of all windows on the desktop. Chrome Version 44.0.2403.125 (64-bit) Linux 4.2.0-rc4+ 86ea07ca846a People are suggesting running chrome with -disable-gpu however it is possible to run Chrome in it's default mode, so long as we tolerate the above behaviour. http://tinyurl.com/orvbzf3 Signed-off-by: Bryan O'Donoghue --- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index af1ee51..a9694faad 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -401,9 +401,7 @@ retry: if (nvbo->reserved_by && nvbo->reserved_by == file_priv) { NV_PRINTK(error, cli, "multiple instances of buffer %d on " "validation list\n", b->handle); - drm_gem_object_unreference_unlocked(gem); - ret = -EINVAL; - break; + continue; } ret = ttm_bo_reserve(&nvbo->bo, true, false, true, &op->ticket);