From patchwork Wed May 4 12:29:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9013461 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9C3EE9F30C for ; Wed, 4 May 2016 12:29:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB9FB203A0 for ; Wed, 4 May 2016 12:29:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E6A7C2039C for ; Wed, 4 May 2016 12:29:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AB1966E7E5; Wed, 4 May 2016 12:29:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0B246E7E5 for ; Wed, 4 May 2016 12:29:46 +0000 (UTC) Received: by mail-wm0-x229.google.com with SMTP id g17so34513605wme.0 for ; Wed, 04 May 2016 05:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=aS2NFfQHBoUKbs7CZ7rm6IHr3xj1jF4jlgeadcx54nI=; b=OxoxCjVoDRPLLEpztpx5Yn/PKX6fGPaMb3xsMjw9qH57DZm4t+XXcwrJ+CpwfGfqZW a1DoRuFXBS88oc88DkocuputG03MZShZHf+eCGJSTjrHbOpH0ThBnH2fr5/KG0FjFDg4 uZVDQIdjls1adMW+f5yOIRBB/nZ6+JceRXOHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aS2NFfQHBoUKbs7CZ7rm6IHr3xj1jF4jlgeadcx54nI=; b=jgxd+YwiWeKrwC5L2GiL9fPBKH062TkdA5V+OGSh/iGW9QfpF3lQrXlMqpGzBzRJi5 cL6rs8NS8JM4LJ9I1RcTOHb0XA00eUH8hF5Nw/F+NA0R6PPYx9rtgo39mh7Fx42Gltof cG/ZPh0wC/jVLpBxWDpaCOo1R39WRHymelSt5wpedKFkEfDJ3CMalkxPbazrlFN8f68F ih5wUPmiFZ/2255ZTSsqLAtBdYBD3Qp8fGc4qbQvFdyLiMYuM40sOXXEa2wnwfw3IfOK HRoe3PmwSTzL/HaucgLskA/JQWe5rHaqoHxKmARE2FH9HS7mNhIzbCRSC3P4Nfvk5KwX yOrA== X-Gm-Message-State: AOPr4FV+Qv1iBibZ/PgKL9qWBgeSzjFxBqkZ+ONCr5ORv6cr8xelrV/Qz1LbwCk93IN3gg== X-Received: by 10.28.167.206 with SMTP id q197mr29339023wme.85.1462364985212; Wed, 04 May 2016 05:29:45 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id jd4sm3943291wjb.43.2016.05.04.05.29.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 May 2016 05:29:44 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Wed, 4 May 2016 14:29:40 +0200 Message-Id: <1462364980-9973-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.8.1 Cc: Daniel Vetter , Intel Graphics Development , Alex Deucher , Daniel Vetter , Lucas Stach Subject: [Intel-gfx] [PATCH] drm: Fixup locking WARN_ON mistake around gem_object_free_unlocked X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Embarrassingly while fixing up the old paths for i915 I managed to misplace a locking check for the new _unlocked paths. That's what I get for not retesting on radeon. Fixes: 9f0ba539d13a ("drm/gem: support BO freeing without dev->struct_mutex") Cc: Chris Wilson Cc: Alex Deucher Cc: Lucas Stach Tested-by: Chris Wilson Signed-off-by: Daniel Vetter Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_gem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 973eb8805ce0..f716308fb48c 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -804,12 +804,13 @@ drm_gem_object_free(struct kref *kref) container_of(kref, struct drm_gem_object, refcount); struct drm_device *dev = obj->dev; - WARN_ON(!mutex_is_locked(&dev->struct_mutex)); - - if (dev->driver->gem_free_object_unlocked) + if (dev->driver->gem_free_object_unlocked) { dev->driver->gem_free_object_unlocked(obj); - else if (dev->driver->gem_free_object) + } else if (dev->driver->gem_free_object) { + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + dev->driver->gem_free_object(obj); + } } EXPORT_SYMBOL(drm_gem_object_free);