Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2567757rwb; Mon, 7 Nov 2022 15:06:17 -0800 (PST) X-Google-Smtp-Source: AMsMyM4s41ikg43hDEY9n/EApQZgP+vsdezj6EfEM6uS8FEICOPVuz8+/mYCAOZBgEXuYj9mbVRi X-Received: by 2002:a17:906:79d8:b0:7ad:b675:f34d with SMTP id m24-20020a17090679d800b007adb675f34dmr46660229ejo.194.1667862377249; Mon, 07 Nov 2022 15:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667862377; cv=none; d=google.com; s=arc-20160816; b=t+dUaCGhArGNRn/oNC3lxtw0CDbOiN59nohEkkjvKql2H/b3axMukRqJni7d59jwTN 4YTS0Ni7EchBcgiDxWPxEGPY3HKbBJQhodyl9mBE8yTCBWAb69ZD1VlEculSl7hp7Npj 9k4/a7E1HKFhb6bpHYpTjQN7LrREjJI0C+bfrt9MvboQ1iT3ccORKCBKqWD2JchNIAZG K7bybG+MJIcSnLndTTDjPQx86QMRMg2IEirm0uCSshb27aaXcdc4jCKgFL4CxYsUVoLZ kio/N85u/xO3eIBJQWdU16IwddZP9x/MB/LSKHPoOLHeT3n5gesC/Cs1T1pMN8TCvn0h MOLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sySJwRNCJq4r2+3MMsumWj1zNyj1+FHPOHGSSLMipnw=; b=yvQQvdW8LaoF5+O+6kSvV4gPGT/FIOp9UpvybKKNLPMj4VWnDA0JDF8gA1FjnutVyN HNQhgZwJrz5VeDuAdoGAZjdmLtElgmgIFf3TsJ6a7XkkDu9KdhVIk7PfYgn/Ig0PXc7B robidAL+Mx62tuqz8XLFyU7CTExiV94ZDIbuP1AcX5EogPcFiLhxBYyDV6O4goA+MBiy kuQQdFI2xmBtylWfMLllAEr5wFoEcNLn5AqdQZD+SBlVLVNRIC7b9MNmlz37kPO1BGD+ tToGB1JhxT7xvhsmbOByQIe6gmMmHdUNhEgDzcWhJxrP333/27s192VrIYnXBigJtwjn j98g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=PmOycH+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a056402170800b0046453c36c69si9069241edu.68.2022.11.07.15.05.50; Mon, 07 Nov 2022 15:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=PmOycH+F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbiKGWsm (ORCPT + 91 others); Mon, 7 Nov 2022 17:48:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232290AbiKGWsi (ORCPT ); Mon, 7 Nov 2022 17:48:38 -0500 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3AD7A1AD for ; Mon, 7 Nov 2022 14:48:37 -0800 (PST) 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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sySJwRNCJq4r2+3MMsumWj1zNyj1+FHPOHGSSLMipnw=; b=PmOycH+FYYcMYFjF5DfoMb6EF0 sNyu4l8JB5jpS956w4cnqFv1zzZ1kWyP/QyrNrcvupvNaztDWMxcMkS5UT1OBZ02WwM4qWNd9LLDA Y3BI7IGwsDTul2bHuZSo2VkfjNKl1BBswS5wZqgt3CaGVpHRqHMy4YYnCJWUaWUWy1zFTsp6Ngc/Z cM4VFqZ8JBWwn8wHNVcWTNxRSPEffkZnC/oPPOMPf5W44VBKR206fLIxrusH5yWYFdrDWJTavCNt0 rXSjiH5OB4ebHtvgfUwJRdbjOtmTouhELSxwRK7clTiy24cWM73DD4+57ZjxKkp1CRF9LsIHvU40U TL7+ADZQ==; 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 1osAuv-00E9qX-5s; Mon, 07 Nov 2022 23:48:33 +0100 From: =?UTF-8?q?Ma=C3=ADra=20Canal?= To: Melissa Wen , Emma Anholt , David Airlie , Daniel Vetter Cc: =?UTF-8?q?Andr=C3=A9=20Almeida?= , "Juan A . Suarez" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Ma=C3=ADra=20Canal?= Subject: [PATCH 1/2] drm/v3d: switch to drmm_mutex_init Date: Mon, 7 Nov 2022 19:46:55 -0300 Message-Id: <20221107224656.278135-2-mcanal@igalia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221107224656.278135-1-mcanal@igalia.com> References: <20221107224656.278135-1-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mutex_init() is supposed to be balanced by a call to mutex_destroy(), but this is not currently happening on the v3d driver. Considering the introduction of a DRM-managed mutex_init variant, switch to drmm_mutex_init. Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/v3d/v3d_gem.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index b8980440d137..96af1cb5202a 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -1075,10 +1076,18 @@ v3d_gem_init(struct drm_device *dev) spin_lock_init(&v3d->mm_lock); spin_lock_init(&v3d->job_lock); - mutex_init(&v3d->bo_lock); - mutex_init(&v3d->reset_lock); - mutex_init(&v3d->sched_lock); - mutex_init(&v3d->cache_clean_lock); + ret = drmm_mutex_init(dev, &v3d->bo_lock); + if (ret) + return ret; + ret = drmm_mutex_init(dev, &v3d->reset_lock); + if (ret) + return ret; + ret = drmm_mutex_init(dev, &v3d->sched_lock); + if (ret) + return ret; + ret = drmm_mutex_init(dev, &v3d->cache_clean_lock); + if (ret) + return ret; /* Note: We don't allocate address 0. Various bits of HW * treat 0 as special, such as the occlusion query counters -- 2.38.1