From: sashiko-bot@kernel.org
To: "Boris Brezillon" <boris.brezillon@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 11/16] drm/panthor: Don't update might_have_idle_groups in process_idle_event_locked()
Date: Thu, 25 Jun 2026 10:06:22 +0000 [thread overview]
Message-ID: <20260625100622.AC8BB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260625-panthor-signal-from-irq-v5-11-8836a74e0ef9@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The panthor scheduler acquires `queue->fence_ctx.lock` using `spin_lock()` instead of `spin_lock_irqsave()`, violating the `dma_fence` locking rules and risking a deadlock against hardware interrupts.
--
commit 3ecce8ed069220d684864af5f10bd10ad0ae008b
Author: Boris Brezillon <boris.brezillon@collabora.com>
drm/panthor: Don't update might_have_idle_groups in process_idle_event_locked()
By scheduling an immediate tick, we already force idleness re-evaluation,
which gives the scheduler the opportunity to evict idle groups
and schedule onces that have jobs pending.
> and schedule onces that have jobs pending.
[Severity: Low]
This isn't a bug, but there appears to be a typo (onces instead of ones)
in the commit message.
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 237f6a75e624c..a5dfb1beafff8 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -1734,8 +1734,6 @@ static void csg_slot_process_idle_event_locked(struct panthor_device *ptdev, u32
>
> lockdep_assert_held(&sched->lock);
>
> - sched->might_have_idle_groups = true;
> -
[Severity: High]
This is a pre-existing issue, but looking at panthor_sched.c,
queue->fence_ctx.lock is acquired using plain spin_lock() in multiple
functions:
queue_suspend_timeout()
queue_resume_timeout()
cs_slot_process_fault_event_locked()
queue_check_job_completion()
group_term_post_processing()
queue_run_job()
For example, in queue_check_job_completion():
spin_lock(&queue->fence_ctx.lock);
...
This lock is used as the dma_fence lock for the job's done_fence. Since
dma_fence objects can be shared with other subsystems (like KMS display
drivers), they may be accessed from hardirq context (such as a VBLANK
interrupt calling dma_fence_is_signaled() or dma_fence_add_callback(),
which attempt to acquire the fence lock).
If a hardware interrupt occurs on the same CPU while the panthor driver
holds this lock with interrupts enabled, could the interrupt handler spin
forever attempting to acquire the lock, causing a deadlock?
Should these acquisitions be updated to use spin_lock_irqsave() to comply
with dma_fence locking rules?
> /* Schedule a tick so we can evict idle groups and schedule non-idle
> * ones. This will also update runtime PM and devfreq busy/idle states,
> * so the device can lower its frequency or get suspended.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260625-panthor-signal-from-irq-v5-0-8836a74e0ef9@collabora.com?part=11
next prev parent reply other threads:[~2026-06-25 10:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 9:36 [PATCH v5 00/16] drm/panthor: Reduce dma_fence signalling latency Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 01/16] drm/panthor: Fix theoretical IOMEM access in suspended state Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 02/16] drm/panthor: Don't overrule pending immediate ticks in sched_resume_tick() Boris Brezillon
2026-06-25 10:04 ` sashiko-bot
2026-06-25 9:36 ` [PATCH v5 03/16] drm/panthor: Fix panthor_pwr_unplug() Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 04/16] drm/panthor: Drop a needless check in panthor_fw_unplug() Boris Brezillon
2026-06-25 10:00 ` sashiko-bot
2026-06-25 9:36 ` [PATCH v5 05/16] drm/panthor: Fix a leak when a group is evicted before the tiler OOM is serviced Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 06/16] drm/panthor: Interrupt group start/resumption if group_bind_locked() fails Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 07/16] drm/panthor: Keep interrupts masked until they are needed Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 08/16] drm/panthor: Make panthor_irq::state a non-atomic field Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 09/16] drm/panthor: Move the register accessors before the IRQ helpers Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 10/16] drm/panthor: Replace the panthor_irq macro machinery by inline helpers Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 11/16] drm/panthor: Don't update might_have_idle_groups in process_idle_event_locked() Boris Brezillon
2026-06-25 10:06 ` sashiko-bot [this message]
2026-06-25 9:36 ` [PATCH v5 12/16] drm/panthor: Get rid of panthor_group::fatal_lock Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 13/16] drm/panthor: Protect events processing with a separate spinlock Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 14/16] drm/panthor: Don't defer job completion checks Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 15/16] drm/panthor: Don't defer FW event processing Boris Brezillon
2026-06-25 9:36 ` [PATCH v5 16/16] drm/panthor: Automate CSG IRQ processing at group unbind time Boris Brezillon
2026-06-25 12:43 ` [PATCH v5 00/16] drm/panthor: Reduce dma_fence signalling latency Boris Brezillon
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=20260625100622.AC8BB1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.