From patchwork Tue Nov 8 17:54:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13036641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB7EFC43219 for ; Tue, 8 Nov 2022 17:54:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A58BB10E4E8; Tue, 8 Nov 2022 17:54:41 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A35610E4E8 for ; Tue, 8 Nov 2022 17:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=K7hR3kcY9SxHZtoP6I8WOetvo7/nxlSyWlDLbOd9cE0=; b=sF7V8SO+MpZ0/+pI4UY1NIrlwL eNtZnW/HAn/DSrDlb7g+lgJcIeCPFx3IvnDDlfZOl98lSS4feNSppwQokKpBGSxfe8w9u1UR2VRbN ry2jKn/pqWHqX6AuIgV/qeNm37xpGgfP8gK5wOloYoRj7OxvafWocV0ggYgD6dgfQzuCuGBN8QDUS JL/0AczqPR+4I3B3u5sFLIrh1CL90CeeZg//rBtImU0FJhHLD7sTcUiUMYm9RRWoStrFEvYDtEMin EAvqNOfUeXiKyTxUeEqHBkr5vc/gKLOxuRyIqghivu4izISkDEAQigP+PHqELb/CfNGzcsHebbdJw t8W5Zrdw==; Received: from [177.34.169.227] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1osSnw-00EVxA-R3; Tue, 08 Nov 2022 18:54:33 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Melissa Wen , Emma Anholt , David Airlie , Daniel Vetter Subject: [PATCH v2 0/2] Balance mutex_init and mutex_destroy calls Date: Tue, 8 Nov 2022 14:54:23 -0300 Message-Id: <20221108175425.39819-1-mcanal@igalia.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Juan A . Suarez" , =?utf-8?q?Ma=C3=ADra_Canal?= , =?utf-8?q?Andr=C3=A9_Alme?= =?utf-8?q?ida?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This series introduces some changes to assure the correct resource release on the V3D driver, especially the mutex. Currently, the V3D has no mutex_destroy() calls, which means that a mutex is being instantiated, but it is not being released by the end of its use. So, use the DRM-managed mutex_init variants when possible to manage the mutex release and add mutex_destroy() calls when not possible. Best Regards, - Maíra Canal v1 -> v2: https://lore.kernel.org/dri-devel/20221107224656.278135-1-mcanal@igalia.com/T/#m3c23e3f21fe6aaae51138c746c74e94b2a7b3bfc - Move mutex_destroy() to v3d_perfmon_put() (Daniel Vetter). - Add mutex_destroy() on error case in v3d_perfmon_create_ioctl() (Daniel Vetter). - Add Daniel Vetter's tags. Maíra Canal (2): drm/v3d: switch to drmm_mutex_init drm/v3d: add missing mutex_destroy drivers/gpu/drm/v3d/v3d_gem.c | 17 +++++++++++++---- drivers/gpu/drm/v3d/v3d_perfmon.c | 6 +++++- 2 files changed, 18 insertions(+), 5 deletions(-)