summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_uc.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2024-02-19 16:05:30 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2024-02-20 22:13:47 +0300
commitbf8ec3c3e82c70b39244ccde96a875773c1fc620 (patch)
treecab1208abdd3383d961723eade3dbab1a63c972a /drivers/gpu/drm/xe/xe_uc.c
parent8a4587ef9f952105d1d5a7ffcdee848219cdc743 (diff)
downloadlinux-bf8ec3c3e82c70b39244ccde96a875773c1fc620.tar.xz
drm/xe: Initialize GuC earlier during probe
SR-IOV VF has limited access to MMIO registers. Fortunately, it is able to access a curated subset that is needed to initialize the driver by communicating with SR-IOV PF using GuC CT. Initialize GuC earlier in order to keep the unified probe ordering between VF and PF modes. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240219130530.1406044-4-michal.winiarski@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_uc.c')
-rw-r--r--drivers/gpu/drm/xe/xe_uc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index d62137306d28..7033f8c1b431 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -32,13 +32,15 @@ uc_to_xe(struct xe_uc *uc)
/* Should be called once at driver load only */
int xe_uc_init(struct xe_uc *uc)
{
+ struct xe_device *xe = uc_to_xe(uc);
int ret;
+ xe_device_mem_access_get(xe);
+
/*
* We call the GuC/HuC/GSC init functions even if GuC submission is off
* to correctly move our tracking of the FW state to "disabled".
*/
-
ret = xe_guc_init(&uc->guc);
if (ret)
goto err;
@@ -52,7 +54,7 @@ int xe_uc_init(struct xe_uc *uc)
goto err;
if (!xe_device_uc_enabled(uc_to_xe(uc)))
- return 0;
+ goto err;
ret = xe_wopcm_init(&uc->wopcm);
if (ret)
@@ -66,9 +68,13 @@ int xe_uc_init(struct xe_uc *uc)
if (ret)
goto err;
+ xe_device_mem_access_put(xe);
+
return 0;
err:
+ xe_device_mem_access_put(xe);
+
return ret;
}