From: sashiko-bot@kernel.org
To: "Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 06/13] drm/panfrost: Explicitly enable MMU interrupts at device init
Date: Fri, 24 Jul 2026 00:13:30 +0000 [thread overview]
Message-ID: <20260724001330.93EF21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-claude-fixes-v3-6-542af61abd0f@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Premature unmasking of MMU interrupts before reset workqueue initialization leads to a NULL pointer dereference.
--
--- Patch [6]: [PATCH v3 06/13] drm/panfrost: Explicitly enable MMU interrupts at device init ---
commit 28382212258245805fe4be63994981403a3d9c1c
Author: Adrián Larumbe <adrian.larumbe@collabora.com>
drm/panfrost: Explicitly enable MMU interrupts at device init
Because the device must be in a position to accept jobs between the time
drm_dev_register() is called and autosuspend first kicks in, there's a very
narrow window inbetween during which jobs targeting the tiler buffer
object would time out, since the device's PM status is 'Active', but no MMU
interrupts were enabled at device initialisation time.
> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> index 4a3162c3b659f..bb6c1614964b1 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
[ ... ]
> @@ -970,6 +975,8 @@ int panfrost_mmu_init(struct panfrost_device *pfdev)
> return err;
> }
>
> + panfrost_mmu_enable_interrupts(pfdev);
> +
[Severity: High]
Could this premature unmasking of MMU interrupts lead to a NULL pointer
dereference during driver initialization?
If the GPU asserts an MMU interrupt (e.g., due to leftover state from the
bootloader or a hardware glitch) right after interrupts are enabled here, the
IRQ handler thread might encounter a fault and eventually attempt a reset.
However, the reset workqueue hasn't been allocated yet, because
panfrost_mmu_init() is called before panfrost_jm_init():
drivers/gpu/drm/panfrost/panfrost_device.c:panfrost_device_init() {
...
err = panfrost_mmu_init(pfdev);
if (err)
goto out_gpu;
err = panfrost_jm_init(pfdev);
...
}
If panfrost_mmu_irq_handler_thread() triggers a timeout in wait_ready(), it
will call panfrost_device_schedule_reset(), which assumes the reset
workqueue is already initialized:
drivers/gpu/drm/panfrost/panfrost_device.h:panfrost_device_schedule_reset() {
...
queue_work(pfdev->reset.wq, &pfdev->reset.work);
}
Will this dereference the NULL pfdev->reset.wq pointer if the interrupt
fires before panfrost_jm_init() runs?
> return 0;
> }
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-claude-fixes-v3-0-542af61abd0f@collabora.com?part=6
next prev parent reply other threads:[~2026-07-24 0:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 23:58 [PATCH v3 00/13] RPM, perfcnt and other minor fixes for Panfrost Adrián Larumbe
2026-07-23 23:58 ` [PATCH v3 01/13] drm/panfrost: Check another bo field for cache option query Adrián Larumbe
2026-07-23 23:58 ` [PATCH v3 02/13] drm/panfrost: Prevent division by 0 Adrián Larumbe
2026-07-24 0:08 ` sashiko-bot
2026-07-23 23:58 ` [PATCH v3 03/13] drm/panfrost: Remove unnecessary header file include Adrián Larumbe
2026-07-23 23:58 ` [PATCH v3 04/13] drm/panfrost: Move shrinker initialization and unplug one level down Adrián Larumbe
2026-07-24 0:06 ` sashiko-bot
2026-07-23 23:58 ` [PATCH v3 05/13] drm/panfrost: Move all device power up and down into RPM callbacks Adrián Larumbe
2026-07-24 0:11 ` sashiko-bot
2026-07-23 23:58 ` [PATCH v3 06/13] drm/panfrost: Explicitly enable MMU interrupts at device init Adrián Larumbe
2026-07-24 0:13 ` sashiko-bot [this message]
2026-07-23 23:59 ` [PATCH v3 07/13] drm/panfrost: Sync with IRQ before MMU disable and reset Adrián Larumbe
2026-07-24 0:17 ` sashiko-bot
2026-07-23 23:59 ` [PATCH v3 08/13] drm/panfrost: Rewire reset sequence to avoid concurrent attempts Adrián Larumbe
2026-07-24 0:09 ` sashiko-bot
2026-07-23 23:59 ` [PATCH v3 09/13] drm/panfrost: Add debugfs knob for manually triggering a GPU reset Adrián Larumbe
2026-07-24 0:14 ` sashiko-bot
2026-07-23 23:59 ` [PATCH v3 10/13] drm/panfrost: Move perfcnt GPU disable sequence into a helper Adrián Larumbe
2026-07-23 23:59 ` [PATCH v3 11/13] drm/panfrost: Introduce a reset lock Adrián Larumbe
2026-07-24 0:16 ` sashiko-bot
2026-07-23 23:59 ` [PATCH v3 12/13] drm/panfrost: Fix races between perfcnt and reset sequence Adrián Larumbe
2026-07-24 0:12 ` sashiko-bot
2026-07-23 23:59 ` [PATCH v3 13/13] drm/panfrost: Bump driver minor to reflect new DUMP IOCTL req field Adrián Larumbe
2026-07-24 0:16 ` sashiko-bot
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=20260724001330.93EF21F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=adrian.larumbe@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.