[PATCH v2 8/8] [ANDROID]: Handle xe_work_period destruction
Aakash Deep Sarkar
aakash.deep.sarkar at intel.com
Fri Aug 22 08:59:30 UTC 2025
This adds the xe_work_period destruction procedure.
We iterate over all entries in the xe::work_period::users
xarray and cancel any pending delayed work. Then destroy
the xarray itself.
Signed-off-by: Aakash Deep Sarkar <aakash.deep.sarkar at intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 569f3890bde2..e07bc2f2d0c1 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -481,6 +481,19 @@ static void xe_device_destroy(struct drm_device *dev, void *dummy)
if (xe->destroy_wq)
destroy_workqueue(xe->destroy_wq);
+ if (IS_ENABLED(CONFIG_TRACE_GPU_WORK_PERIOD)) {
+ struct xe_user *user = NULL;
+ unsigned long i;
+
+ mutex_lock(&xe->work_period.lock);
+ xa_for_each(&xe->work_period.users, i, user) {
+ if (cancel_delayed_work_sync(&user->delay_work))
+ xe_user_put(user);
+ }
+ xa_destroy(&xe->work_period.users);
+ mutex_unlock(&xe->work_period.lock);
+ }
+
ttm_device_fini(&xe->ttm);
}
--
2.49.0
More information about the Intel-xe
mailing list