]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Open-code GGTT MMIO access protection
authorMatthew Brost <matthew.brost@intel.com>
Tue, 10 Mar 2026 22:50:39 +0000 (18:50 -0400)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 19 Mar 2026 16:13:54 +0000 (17:13 +0100)
commit01f2557aa684e514005541e71a3d01f4cd45c170
treeeb381e10846f9cd5a40a072726a248418803340b
parente6e3ea52bf07a0b7b9dff189616f189b83ee397a
drm/xe: Open-code GGTT MMIO access protection

GGTT MMIO access is currently protected by hotplug (drm_dev_enter),
which works correctly when the driver loads successfully and is later
unbound or unloaded. However, if driver load fails, this protection is
insufficient because drm_dev_unplug() is never called.

Additionally, devm release functions cannot guarantee that all BOs with
GGTT mappings are destroyed before the GGTT MMIO region is removed, as
some BOs may be freed asynchronously by worker threads.

To address this, introduce an open-coded flag, protected by the GGTT
lock, that guards GGTT MMIO access. The flag is cleared during the
dev_fini_ggtt devm release function to ensure MMIO access is disabled
once teardown begins.

Cc: stable@vger.kernel.org
Fixes: 919bb54e989c ("drm/xe: Fix missing runtime outer protection for ggtt_remove_node")
Reviewed-by: Zhanjun Dong <zhanjun.dong@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260310225039.1320161-8-zhanjun.dong@intel.com
(cherry picked from commit 4f3a998a173b4325c2efd90bdadc6ccd3ad9a431)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/xe_ggtt.c
drivers/gpu/drm/xe/xe_ggtt_types.h