Skip to content

Commit 22d0086

Browse files
committed
drm/xe: Set survivability mode before heci init
Commit d40f275 ("drm/xe: Move survivability entirely to xe_pci") tried to follow the logic: initialize everything needed and if everything succeeds, set the flag that it's enabled. While it fixed some corner cases of those calls failing, it was wrong for setting the flag after the call to xe_heci_gsc_init(): that function does a different initialization for survivability mode. Fix that and add comments about this being done on purpose. Suggested-by: Riana Tauro <riana.tauro@intel.com> Fixes: d40f275 ("drm/xe: Move survivability entirely to xe_pci") Reviewed-by: Riana Tauro <riana.tauro@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250314-fix-survivability-v5-2-fdb3559ea965@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> (cherry picked from commit 14efa73) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent caf2f15 commit 22d0086

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/gpu/drm/xe/xe_survivability_mode.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,21 @@ static int enable_survivability_mode(struct pci_dev *pdev)
155155
if (ret)
156156
return ret;
157157

158+
/* Make sure xe_heci_gsc_init() knows about survivability mode */
159+
survivability->mode = true;
160+
158161
ret = xe_heci_gsc_init(xe);
159-
if (ret)
162+
if (ret) {
163+
/*
164+
* But if it fails, device can't enter survivability
165+
* so move it back for correct error handling
166+
*/
167+
survivability->mode = false;
160168
return ret;
169+
}
161170

162171
xe_vsec_init(xe);
163172

164-
survivability->mode = true;
165173
dev_err(dev, "In Survivability Mode\n");
166174

167175
return 0;

0 commit comments

Comments
 (0)