mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-30 11:09:51 -04:00
drm/xe/gsc: Trigger a driver flr to cleanup the GSC on unload
GSC is only killed by an FLR, so we need to trigger one on unload to make sure we stop it. This is because we assign a chunk of memory to the GSC as part of the FW load, so we need to make sure it stops using it when we release it to the system on driver unload. Note that this is not a problem of the unload per-se, because the GSC will not touch that memory unless there are requests for it coming from the driver; therefore, no accesses will happen while Xe is not loaded, but if we re-load the driver then the GSC might wake up and try to access that old memory location again. Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
committed by
Rodrigo Vivi
parent
aae84bf1cd
commit
f63182b45d
@@ -130,6 +130,23 @@ static int gsc_upload(struct xe_gsc *gsc)
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* GSC is only killed by an FLR, so we need to trigger one on unload to
|
||||
* make sure we stop it. This is because we assign a chunk of memory to
|
||||
* the GSC as part of the FW load, so we need to make sure it stops
|
||||
* using it when we release it to the system on driver unload. Note that
|
||||
* this is not a problem of the unload per-se, because the GSC will not
|
||||
* touch that memory unless there are requests for it coming from the
|
||||
* driver; therefore, no accesses will happen while Xe is not loaded,
|
||||
* but if we re-load the driver then the GSC might wake up and try to
|
||||
* access that old memory location again.
|
||||
* Given that an FLR is a very disruptive action (see the FLR function
|
||||
* for details), we want to do it as the last action before releasing
|
||||
* the access to the MMIO bar, which means we need to do it as part of
|
||||
* mmio cleanup.
|
||||
*/
|
||||
xe->needs_flr_on_fini = true;
|
||||
|
||||
err = emit_gsc_upload(gsc);
|
||||
if (err) {
|
||||
xe_gt_err(gt, "Failed to emit GSC FW upload (%pe)\n", ERR_PTR(err));
|
||||
|
||||
Reference in New Issue
Block a user