diff options
| author | Tvrtko Ursulin <tvrtko.ursulin@igalia.com> | 2026-03-06 08:30:34 -0300 |
|---|---|---|
| committer | Maíra Canal <mcanal@igalia.com> | 2026-03-13 18:02:32 -0300 |
| commit | 0b2a4569cd9fe56683be1aab9864032a8d267caa (patch) | |
| tree | 537c4e2b9affd0b4ceadcbe258e115f848b80a4e /drivers/gpu/drm/v3d/v3d_drv.h | |
| parent | 8cf1bec37b27846ad3169744c9f1a89a06dcb3fa (diff) | |
| download | linux-next-0b2a4569cd9fe56683be1aab9864032a8d267caa.tar.gz linux-next-0b2a4569cd9fe56683be1aab9864032a8d267caa.zip | |
drm/v3d: Use raw seqcount helpers instead of fighting with lockdep
The `v3d_stats` sequence counter uses regular seqcount helpers, which
carry lockdep annotations that expect a consistent IRQ context between
all writers. However, lockdep is unable to detect that v3d's readers
are never in IRQ or softirq context, and that for CPU job queues, even
the write side never is. This led to false positive that were previously
worked around by conditionally disabling local IRQs under
IS_ENABLED(CONFIG_LOCKDEP).
Switch to the raw seqcount helpers which skip lockdep tracking entirely.
This is safe because jobs are fully serialized per queue: the next job
can only be queued after the previous one has been signaled, so there is
no scope for the start and update paths to race on the same seqcount.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20260306-v3d-reset-locking-improv-v3-2-49864fe00692@igalia.com
Co-developed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.h')
| -rw-r--r-- | drivers/gpu/drm/v3d/v3d_drv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.h b/drivers/gpu/drm/v3d/v3d_drv.h index 314213c26710..2e5520015e08 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.h +++ b/drivers/gpu/drm/v3d/v3d_drv.h @@ -46,6 +46,11 @@ struct v3d_stats { * This seqcount is used to protect the access to the GPU stats * variables. It must be used as, while we are reading the stats, * IRQs can happen and the stats can be updated. + * + * However, we use the raw seqcount helpers to interact with this lock + * to avoid false positives from lockdep, which is unable to detect that + * our readers are never from irq or softirq context, and that, for CPU + * job queues, even the write side never is. */ seqcount_t lock; }; |
