mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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 <michal.wajdeczko@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patch.msgid.link/20260526195452.20545-8-michal.wajdeczko@intel.com
This commit is contained in:
parent
6c766f8d22
commit
9462f2b677
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user