From: Simona Vetter <simona.vetter@ffwll.ch>
To: Mihail Atanassov <mihail.atanassov@arm.com>
Cc: linux-kernel@vger.kernel.org,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Steven Price" <steven.price@arm.com>,
dri-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>,
"Shashank Sharma" <shashank.sharma@amd.com>,
"Ketil Johnsen" <ketil.johnsen@arm.com>,
"Akash Goel" <akash.goel@arm.com>
Subject: Re: [PATCH 6/8] drm/panthor: Implement XGS queues
Date: Tue, 3 Sep 2024 21:17:13 +0200 [thread overview]
Message-ID: <ZtdguY2gELaMWuxk@phenom.ffwll.local> (raw)
In-Reply-To: <20240828172605.19176-7-mihail.atanassov@arm.com>
On Wed, Aug 28, 2024 at 06:26:02PM +0100, Mihail Atanassov wrote:
> +int panthor_xgs_queue_create(struct panthor_file *pfile, u32 vm_id,
> + int eventfd_sync_update, u32 *handle)
> +{
> + struct panthor_device *ptdev = pfile->ptdev;
> + struct panthor_xgs_queue_pool *xgs_queue_pool = pfile->xgs_queues;
> + struct panthor_xgs_queue *queue;
> + struct drm_gpu_scheduler *drm_sched;
> + int ret;
> + int qid;
> +
> + queue = kzalloc(sizeof(*queue), GFP_KERNEL);
> + if (!queue)
> + return -ENOMEM;
> +
> + kref_init(&queue->refcount);
> + INIT_LIST_HEAD(&queue->fence_ctx.in_flight_jobs);
> + INIT_WORK(&queue->release_work, xgs_queue_release_work);
> + queue->ptdev = ptdev;
> +
> + ret = drmm_mutex_init(&ptdev->base, &queue->lock);
This is guaranteed buggy, because you kzalloc queue, with it's own
refcount, but then tie the mutex cleanup to the entirely different
lifetime of the drm_device.
Just spotted this while reading around.
-Sima
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2024-09-03 19:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 17:25 [RFC PATCH 00/10] drm/panthor: Add user submission Mihail Atanassov
2024-08-28 17:25 ` [PATCH 1/8] drm/panthor: Add uAPI to submit from user space Mihail Atanassov
2024-08-28 17:25 ` [PATCH 2/8] drm/panthor: Extend GROUP_CREATE for user submission Mihail Atanassov
2024-08-28 17:25 ` [PATCH 3/8] drm/panthor: Map doorbell pages Mihail Atanassov
2024-08-28 17:26 ` [PATCH 4/8] drm/panthor: Add GROUP_KICK ioctl Mihail Atanassov
2024-08-28 17:26 ` [PATCH 5/8] drm/panthor: Factor out syncobj handling Mihail Atanassov
2024-08-28 17:26 ` [PATCH 6/8] drm/panthor: Implement XGS queues Mihail Atanassov
2024-09-03 19:17 ` Simona Vetter [this message]
2024-08-28 17:26 ` [PATCH 7/8] drm/panthor: Add sync_update eventfd handling Mihail Atanassov
2024-08-28 17:26 ` [PATCH 8/8] drm/panthor: Add SYNC_UPDATE ioctl Mihail Atanassov
2024-08-29 9:40 ` [RFC PATCH 00/10] drm/panthor: Add user submission Christian König
2024-08-29 13:37 ` Steven Price
[not found] ` <96ef7ae3-4df1-4859-8672-453055bbfe96@amd.com>
2024-09-03 21:11 ` Simona Vetter
2024-09-04 7:49 ` Christian König
2024-09-04 9:31 ` Steven Price
2024-09-04 11:23 ` Boris Brezillon
[not found] ` <a5a53492-9651-403e-b613-91ef0b9e80b6@amd.com>
2024-09-04 12:46 ` Steven Price
2024-09-04 13:20 ` Boris Brezillon
2024-09-04 13:35 ` Steven Price
2024-09-04 13:58 ` Boris Brezillon
2024-09-04 13:36 ` Christian König
2024-09-24 9:30 ` Simona Vetter
2024-11-08 22:27 ` Matthew Brost
2024-11-11 12:57 ` Christian König
2024-11-11 20:29 ` Matthew Brost
2024-09-04 9:43 ` Simona Vetter
2024-08-29 13:48 ` Ketil Johnsen
2024-09-03 12:27 ` Ketil Johnsen
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=ZtdguY2gELaMWuxk@phenom.ffwll.local \
--to=simona.vetter@ffwll.ch \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=akash.goel@arm.com \
--cc=alexander.deucher@amd.com \
--cc=boris.brezillon@collabora.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=ketil.johnsen@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mihail.atanassov@arm.com \
--cc=mripard@kernel.org \
--cc=shashank.sharma@amd.com \
--cc=steven.price@arm.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
all inboxes | Powered by JetHome®