forked from Minki/linux
2 gem context related fixes:
- to avoid a general protection failure when using perf/OA (Chris) - to avoid kernel warnings on driver release (Janusz) -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEbSBwaO7dZQkcLOKj+mJfZA7rE8oFAmMrdP0ACgkQ+mJfZA7r E8oYYQf/Z1ohgR8BWFRkypJdePrkAiaNs0pOdXg6x6Ij1VaIcOc2utWb/SPIXchN FSmpjSWWkxWXXg9ztDOZ/xXFZenivWXaJOlBgFapNkP12M3yIf3d0Khse1ZSezx5 H5BcgyBnrD4b8IO5Kap+UmZQeR+PhPC4gTF28Y2fbvFYpIsfHHEiBf/L/d4db6gv hEeb26qoBeY6yOwt4VO4a35SYlm5f88i0gRUan03RmgOM/Zpb7pxku1VaB0SvTnm e91y7DEJHWT7EtM1VTLFAkglVdX7UxpewxGTTh+T0yQZQFP8IzgSRdJQnvH6SLQC +D/Yvwb3cgBs4UiwZFCNTIuhVJRSWw== =DmQ5 -----END PGP SIGNATURE----- Merge tag 'drm-intel-fixes-2022-09-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes 2 gem context related fixes: - to avoid a general protection failure when using perf/OA (Chris) - to avoid kernel warnings on driver release (Janusz) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Yyt1CV+YIjKQZZMB@intel.com
This commit is contained in:
commit
d21fc11109
@ -1269,6 +1269,10 @@ static void i915_gem_context_release_work(struct work_struct *work)
|
||||
trace_i915_context_free(ctx);
|
||||
GEM_BUG_ON(!i915_gem_context_is_closed(ctx));
|
||||
|
||||
spin_lock(&ctx->i915->gem.contexts.lock);
|
||||
list_del(&ctx->link);
|
||||
spin_unlock(&ctx->i915->gem.contexts.lock);
|
||||
|
||||
if (ctx->syncobj)
|
||||
drm_syncobj_put(ctx->syncobj);
|
||||
|
||||
@ -1521,10 +1525,6 @@ static void context_close(struct i915_gem_context *ctx)
|
||||
|
||||
ctx->file_priv = ERR_PTR(-EBADF);
|
||||
|
||||
spin_lock(&ctx->i915->gem.contexts.lock);
|
||||
list_del(&ctx->link);
|
||||
spin_unlock(&ctx->i915->gem.contexts.lock);
|
||||
|
||||
client = ctx->client;
|
||||
if (client) {
|
||||
spin_lock(&client->ctx_lock);
|
||||
|
@ -1191,7 +1191,8 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
|
||||
|
||||
intel_uc_cleanup_firmwares(&to_gt(dev_priv)->uc);
|
||||
|
||||
i915_gem_drain_freed_objects(dev_priv);
|
||||
/* Flush any outstanding work, including i915_gem_context.release_work. */
|
||||
i915_gem_drain_workqueue(dev_priv);
|
||||
|
||||
drm_WARN_ON(&dev_priv->drm, !list_empty(&dev_priv->gem.contexts.list));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user