From patchwork Fri Oct 29 08:46:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 289842 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9T8nVKd031381 for ; Fri, 29 Oct 2010 08:49:51 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B667A9EF18 for ; Fri, 29 Oct 2010 01:49:31 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com [65.115.85.69]) by gabe.freedesktop.org (Postfix) with ESMTP id 498F79F577 for ; Fri, 29 Oct 2010 01:47:07 -0700 (PDT) Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 2E5D8130FF; Fri, 29 Oct 2010 01:47:07 -0700 (PDT) Received: from localhost.localdomain (unknown [10.20.255.116]) by mailhost3.vmware.com (Postfix) with ESMTP id BB9CACD952; Fri, 29 Oct 2010 01:47:05 -0700 (PDT) From: Thomas Hellstrom To: airlied@redhat.com Subject: [PATCH 5/6] drm/ttm: Add a barrier when unreserving Date: Fri, 29 Oct 2010 10:46:48 +0200 Message-Id: <1288342009-25062-6-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1288342009-25062-5-git-send-email-thellstrom@vmware.com> References: <1288342009-25062-1-git-send-email-thellstrom@vmware.com> <1288342009-25062-2-git-send-email-thellstrom@vmware.com> <1288342009-25062-3-git-send-email-thellstrom@vmware.com> <1288342009-25062-4-git-send-email-thellstrom@vmware.com> <1288342009-25062-5-git-send-email-thellstrom@vmware.com> Cc: Thomas Hellstrom , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Oct 2010 08:49:51 +0000 (UTC) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index f561eea..a32fe41 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -37,6 +37,7 @@ #include #include #include +#include #define TTM_ASSERT_LOCKED(param) #define TTM_DEBUG(fmt, arg...) @@ -444,6 +445,11 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) ttm_bo_mem_put(bo, &bo->mem); atomic_set(&bo->reserved, 0); + + /* + * Make processes trying to reserve really pick it up. + */ + smp_mb__after_atomic_dec(); wake_up_all(&bo->event_queue); }