From 9352136ad34a1c2a485bea0185d34689d0ae4525 Mon Sep 17 00:00:00 2001 From: Sourab Gupta Date: Fri, 4 May 2018 19:55:11 +0530 Subject: gpu: nvgpu: remove usage of xchg in clk arb code With the removal of rcu locks and using spinlocks in place, the usage of xchg for atomic pointer swap is unneccesary. A few places already have barriers in place before changing the pointer values, so a simple pointer assignment would do. Jira VQRM-3741 Change-Id: I03296202b273b5175f166ab3e094c0e4de910eb8 Signed-off-by: Sourab Gupta Reviewed-on: https://git-master.nvidia.com/r/1709655 GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/clk/clk_arb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/clk/clk_arb.c') diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 456246bf..368bacc2 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -395,7 +395,7 @@ static int nvgpu_clk_arb_update_vf_table(struct nvgpu_clk_arb *arb) /* make table visible when all data has resolved in the tables */ nvgpu_smp_wmb(); - xchg(&arb->current_vf_table, table); + arb->current_vf_table = table; exit_vf_table: @@ -800,7 +800,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) nvgpu_list_add(&dev->node, &arb->requests); nvgpu_spinlock_release(&arb->requests_lock); } - xchg(&session->target, target); + session->target = target; } nvgpu_spinlock_release(&session->session_lock); @@ -933,7 +933,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) /* Make changes visible to other threads */ nvgpu_smp_wmb(); - xchg(&arb->actual, actual); + arb->actual = actual; status = nvgpu_lpwr_enable_pg(g, false); if (status < 0) { @@ -988,7 +988,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) } /* commit changes before exchanging debug pointer */ nvgpu_smp_wmb(); - xchg(&arb->debug, debug); + arb->debug = debug; #endif exit_arb: -- cgit v1.2.2