From patchwork Thu Nov 19 16:46:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 7659161 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 CDD5DC0649 for ; Thu, 19 Nov 2015 16:47:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 138342064F for ; Thu, 19 Nov 2015 16:47:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5766E20676 for ; Thu, 19 Nov 2015 16:47:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74A8B7A175; Thu, 19 Nov 2015 08:47:20 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 832BE7A175 for ; Thu, 19 Nov 2015 08:47:15 -0800 (PST) Received: by wmec201 with SMTP id c201so34986587wme.0 for ; Thu, 19 Nov 2015 08:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=33Kg6M3i/0n2G3pXQk0kaS0eJ1WtGjtfNU8TMLPiHFQ=; b=aGb9sTVbnUWX2D8AhFKShbNg/FAnBfrCrryPvl8z/QQgRRq5uGMvidBX8P1kBRWQA1 ZcDXOtVlBJ2mCqum/K8b47gCExmJdbYOYbibupkX0zwhTDyry2k+3373CKaCPnkZKOaB 2zSl+ubEk8c+fTTxE+Mea5gJvB62fMs3UwUxE= 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:in-reply-to :references; bh=33Kg6M3i/0n2G3pXQk0kaS0eJ1WtGjtfNU8TMLPiHFQ=; b=AdKa3MwuS+M/+m7XZ1aO4VIAx0hDTpfCdYSVm7HYdMJzuDiblxe5b1V79NXnBQ5IRl qimhM46DCmoWM20bu2nGxqKmblXnQ9J9sgTyU5og8QFx84/xeNU4nV/mYnA8g9SuDSF/ 89wJGYxvkDYE9EZIqOrikGO4W/sd1lpSH2q7aUYV4iAEEPddP8FYu2g3uiRsDX3ABNrJ quFPGvfZpKUpaAw0/zkZ+Lpo4HVwVAx1o/JrWY4VUxohAcWcDilNhkXHRsVYiLYPBOh7 GHH9b4TFyYJyOpSoHy5ugw5ntBlZnG9OJCXWQL80fvCj7YgJgjoyuQ1rkUdM7L9HEaLh gNhQ== X-Gm-Message-State: ALoCoQnJaKBo88f2MsNlnSbEdBqbX0mL+M9YeBbq8GqvghwPbsmdOI5rdqZ82E+YWnkqXnubbcy8 X-Received: by 10.194.23.33 with SMTP id j1mr9370409wjf.4.1447951634310; Thu, 19 Nov 2015 08:47:14 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id cv3sm8695001wjc.20.2015.11.19.08.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 08:47:12 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH RESEND 15/20] drm/exynos: drop struct_mutex from exynos_drm_gem_get_ioctl Date: Thu, 19 Nov 2015 17:46:44 +0100 Message-Id: <1447951610-12622-16-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1447951610-12622-1-git-send-email-daniel.vetter@ffwll.ch> References: <1447951610-12622-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter 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=-4.6 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 The only things this protects is reading ->flags and ->size, both of which are invariant over the lifetime of an exynos gem bo. So no locking needed at all (besides that, nothing protects the writers anyway). Aside: exynos_gem_obj->size is redundant with exynos_gem_obj->base.size and probably should be removed. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index a3286a1ec2b1..dfb3bfee1b63 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -352,12 +352,9 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, struct drm_exynos_gem_info *args = data; struct drm_gem_object *obj; - mutex_lock(&dev->struct_mutex); - obj = drm_gem_object_lookup(dev, file_priv, args->handle); if (!obj) { DRM_ERROR("failed to lookup gem object.\n"); - mutex_unlock(&dev->struct_mutex); return -EINVAL; } @@ -367,7 +364,6 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, args->size = exynos_gem->size; drm_gem_object_unreference(obj); - mutex_unlock(&dev->struct_mutex); return 0; }