dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Maíra Canal" <mcanal@igalia.com>
To: Emma Anholt <emma@anholt.net>, Melissa Wen <mwen@igalia.com>,
	Iago Toral <itoral@igalia.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Maíra Canal" <mcanal@igalia.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH 2/2] drm/v3d: assure that the job is NULL after being freed
Date: Mon, 23 Oct 2023 07:58:34 -0300	[thread overview]
Message-ID: <20231023105927.101502-2-mcanal@igalia.com> (raw)
In-Reply-To: <20231023105927.101502-1-mcanal@igalia.com>

After the job is finished and freed, we need to make sure that the job is
NULL. Otherwise, we would get a warning when unloading the driver, as it
would look like the job still exists. Therefore, after freeing the job,
let's assign it to NULL in order to indicate that the job has finished.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_gem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index afa7d170d1ff..61a7f36fc8e2 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -333,6 +333,7 @@ v3d_job_free(struct kref *ref)
 		v3d_perfmon_put(job->perfmon);

 	kfree(job);
+	job = NULL;
 }

 static void
--
2.41.0


  reply	other threads:[~2023-10-23 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 10:58 [PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering Maíra Canal
2023-10-23 10:58 ` Maíra Canal [this message]
2023-10-24  5:57 ` Iago Toral
2023-10-24 10:05   ` Maira Canal
2023-10-30 12:20     ` Iago Toral
2023-10-30 12:42       ` Maira Canal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231023105927.101502-2-mcanal@igalia.com \
    --to=mcanal@igalia.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=itoral@igalia.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).