From: Michal Wajdeczko Date: Tue, 26 May 2026 19:54:52 +0000 (+0200) Subject: drm/xe/pm: Do early initialization in init_early() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9462f2b677506d8d698e81bfa378bbfd65a19187;p=thirdparty%2Flinux.git drm/xe/pm: Do early initialization in init_early() There is no need nor gain in splitting mutex or list initializations between two init functions as all of this is just pure software state and all this could be done at once. Signed-off-by: Michal Wajdeczko Reviewed-by: Gustavo Sousa Link: https://patch.msgid.link/20260526195452.20545-8-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c index 5d1a3a26cb6e5..99562f691080b 100644 --- a/drivers/gpu/drm/xe/xe_pm.c +++ b/drivers/gpu/drm/xe/xe_pm.c @@ -363,6 +363,9 @@ int xe_pm_init_early(struct xe_device *xe) { int err; + init_completion(&xe->pm_block); + complete_all(&xe->pm_block); + INIT_LIST_HEAD(&xe->rebind_resume_list); INIT_LIST_HEAD(&xe->mem_access.vram_userfault.list); err = drmm_mutex_init(&xe->drm, &xe->mem_access.vram_userfault.lock); @@ -373,6 +376,10 @@ int xe_pm_init_early(struct xe_device *xe) if (err) return err; + err = drmm_mutex_init(&xe->drm, &xe->rebind_resume_lock); + if (err) + return err; + return 0; } ALLOW_ERROR_INJECTION(xe_pm_init_early, ERRNO); /* See xe_pci_probe() */ @@ -484,14 +491,6 @@ int xe_pm_init(struct xe_device *xe) if (err) return err; - err = drmm_mutex_init(&xe->drm, &xe->rebind_resume_lock); - if (err) - goto err_unregister; - - init_completion(&xe->pm_block); - complete_all(&xe->pm_block); - INIT_LIST_HEAD(&xe->rebind_resume_list); - /* For now suspend/resume is only allowed with GuC */ if (!xe_device_uc_enabled(xe)) return 0;