diff options
| author | Matthew Brost <matthew.brost@intel.com> | 2026-03-26 04:12:07 +0300 |
|---|---|---|
| committer | Matthew Brost <matthew.brost@intel.com> | 2026-03-26 22:03:02 +0300 |
| commit | 225d02cb46d0e567eb788308168159f61735c8fe (patch) | |
| tree | 73f1c899c20955b66419dd730e6e486d51925295 | |
| parent | 1600b49b0819599b138f92c72e6c6ebb43c40378 (diff) | |
| download | linux-225d02cb46d0e567eb788308168159f61735c8fe.tar.xz | |
drm/xe: Issue GGTT invalidation under lock in ggtt_node_remove
Async work (e.g., GuC queue teardowns) can call ggtt_node_remove, so the
operation must be performed under the GGTT lock to ensure the GGTT
online check remains stable. GGTT insertion and removal are heavyweight
operations (e.g., queue create/destroy), so the additional serialization
cost is negligible compared to ensuring correctness.
Fixes: 4f3a998a173b ("drm/xe: Open-code GGTT MMIO access protection")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Link: https://patch.msgid.link/20260326011207.62373-1-matthew.brost@intel.com
| -rw-r--r-- | drivers/gpu/drm/xe/xe_ggtt.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 21071b64b09d..a848d1a41b9b 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -481,15 +481,10 @@ static void ggtt_node_remove(struct xe_ggtt_node *node) xe_ggtt_clear(ggtt, xe_ggtt_node_addr(node), xe_ggtt_node_size(node)); drm_mm_remove_node(&node->base); node->base.size = 0; - mutex_unlock(&ggtt->lock); - - if (!bound) - goto free_node; - - if (node->invalidate_on_remove) + if (bound && node->invalidate_on_remove) xe_ggtt_invalidate(ggtt); + mutex_unlock(&ggtt->lock); -free_node: ggtt_node_fini(node); } |
