drm/i915: Replace rcu_swap_protected() with rcu_replace_pointer()
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 23 Sep 2019 22:22:15 +0000 (15:22 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 30 Oct 2019 15:44:04 +0000 (08:44 -0700)
This commit replaces the use of rcu_swap_protected() with the more
intuitively appealing rcu_replace_pointer() as a step towards removing
rcu_swap_protected().

Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
[ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Cc: <dri-devel@lists.freedesktop.org>
drivers/gpu/drm/i915/gem/i915_gem_context.c

index 1cdfe05514c3f6597b78455978030307a5d10b73..3f3e803dfd5a3fa12430c76863c8425e038bf3a0 100644 (file)
@@ -1629,7 +1629,7 @@ replace:
                i915_gem_context_set_user_engines(ctx);
        else
                i915_gem_context_clear_user_engines(ctx);
-       rcu_swap_protected(ctx->engines, set.engines, 1);
+       set.engines = rcu_replace_pointer(ctx->engines, set.engines, 1);
        mutex_unlock(&ctx->engines_mutex);
 
        call_rcu(&set.engines->rcu, free_engines_rcu);