Skip to content

Commit d21fc11

Browse files
committed
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 <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 521a547 + d119888 commit d21fc11

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,10 @@ static void i915_gem_context_release_work(struct work_struct *work)
12691269
trace_i915_context_free(ctx);
12701270
GEM_BUG_ON(!i915_gem_context_is_closed(ctx));
12711271

1272+
spin_lock(&ctx->i915->gem.contexts.lock);
1273+
list_del(&ctx->link);
1274+
spin_unlock(&ctx->i915->gem.contexts.lock);
1275+
12721276
if (ctx->syncobj)
12731277
drm_syncobj_put(ctx->syncobj);
12741278

@@ -1521,10 +1525,6 @@ static void context_close(struct i915_gem_context *ctx)
15211525

15221526
ctx->file_priv = ERR_PTR(-EBADF);
15231527

1524-
spin_lock(&ctx->i915->gem.contexts.lock);
1525-
list_del(&ctx->link);
1526-
spin_unlock(&ctx->i915->gem.contexts.lock);
1527-
15281528
client = ctx->client;
15291529
if (client) {
15301530
spin_lock(&client->ctx_lock);

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,8 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
11911191

11921192
intel_uc_cleanup_firmwares(&to_gt(dev_priv)->uc);
11931193

1194-
i915_gem_drain_freed_objects(dev_priv);
1194+
/* Flush any outstanding work, including i915_gem_context.release_work. */
1195+
i915_gem_drain_workqueue(dev_priv);
11951196

11961197
drm_WARN_ON(&dev_priv->drm, !list_empty(&dev_priv->gem.contexts.list));
11971198
}

0 commit comments

Comments
 (0)