Skip to content

Commit

Permalink
drm/xe: Set survivability mode before heci init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lucas De Marchi committed Mar 21, 2025
1 parent 86b5e0d commit 14efa73
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/gpu/drm/xe/xe_survivability_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,21 @@ static int enable_survivability_mode(struct pci_dev *pdev)
if (ret)
return ret;

/* Make sure xe_heci_gsc_init() knows about survivability mode */
survivability->mode = true;

ret = xe_heci_gsc_init(xe);
if (ret)
if (ret) {
/*
* But if it fails, device can't enter survivability
* so move it back for correct error handling
*/
survivability->mode = false;
return ret;
}

xe_vsec_init(xe);

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

return 0;
Expand Down

0 comments on commit 14efa73

Please sign in to comment.