From patchwork Mon Dec 10 09:16:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 1856491 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 81D193FCF2 for ; Mon, 10 Dec 2012 09:21:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75768E6058 for ; Mon, 10 Dec 2012 01:21:59 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id E4FAFE6093 for ; Mon, 10 Dec 2012 01:17:13 -0800 (PST) Received: by mail-we0-f177.google.com with SMTP id x48so1052749wey.36 for ; Mon, 10 Dec 2012 01:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=O5IXb8PWmhb/6iBblF37B+OaNG6VKTKwTFnuu5dfQQg=; b=VqzadXORMlgxLbqkYyD6sI5I1lmbVFpLTXZgt7S1jigNbmiHIxcTblHdqivNFbv1PL a4++S5kf5O4Dp3KJm/Phz9LKd/ApnCu+AFo7d/tuhuMBXsfoYWsygE9ND3qqMUX2YL+K sQUTH3QW6fVB61DwaL81osGpIXxPfgQlUYlL7AiDYXP8yW4uCd589y+BusStOMzTFMME 5wKs7CXzML+iNm7QkD4RM8EYJ+lO99Icq8U9yeIEBf6BgGDwaXFXgLb7LIPC4KHy7iPy WAJUt4y/e+dVRSlSWGDIk2pRY2ns3t+B+9SK1lAIavbqTP2/y6G2n1WrCaMhrqrH0dcP x+uw== Received: by 10.180.14.2 with SMTP id l2mr9484191wic.2.1355131032968; Mon, 10 Dec 2012 01:17:12 -0800 (PST) Received: from localhost (5ED48CEF.cm-7-5c.dynamic.ziggo.nl. [94.212.140.239]) by mx.google.com with ESMTPS id w5sm10635438wiz.10.2012.12.10.01.17.10 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 01:17:12 -0800 (PST) Received: by localhost (sSMTP sendmail emulation); Mon, 10 Dec 2012 10:17:09 +0100 From: Maarten Lankhorst To: dri-devel@lists.freedesktop.org, thellstrom@vmware.com Subject: [PATCH 1/7] drm/nouveau: increase reservation sequence every retry Date: Mon, 10 Dec 2012 10:16:55 +0100 Message-Id: <1355131021-11611-1-git-send-email-maarten.lankhorst@canonical.com> X-Mailer: git-send-email 1.8.0 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 This is temporary until the fence framework can be used. With the lru/reservation atomicity removal it is possible to see your old sequence number and the buffer being reserved, leading to erroneously reporting -EDEADLK. Workaround it by bumping the sequence number every retry. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 7b9364b..f2bd59e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -322,8 +322,8 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, int trycnt = 0; int ret, i; - sequence = atomic_add_return(1, &drm->ttm.validate_sequence); retry: + sequence = atomic_add_return(1, &drm->ttm.validate_sequence); if (++trycnt > 100000) { NV_ERROR(drm, "%s failed and gave up.\n", __func__); return -EINVAL;