diff options
author | Sourab Gupta <sourabg@nvidia.com> | 2018-05-04 10:25:11 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-18 02:34:52 -0400 |
commit | 9352136ad34a1c2a485bea0185d34689d0ae4525 (patch) | |
tree | c6381686806aafab1e6538b6ba4b10cb2993a37d | |
parent | 4b2844260e6dbd6144b88f5b1cfee27b1809598b (diff) |
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 <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1709655
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_arb.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) | |||
395 | 395 | ||
396 | /* make table visible when all data has resolved in the tables */ | 396 | /* make table visible when all data has resolved in the tables */ |
397 | nvgpu_smp_wmb(); | 397 | nvgpu_smp_wmb(); |
398 | xchg(&arb->current_vf_table, table); | 398 | arb->current_vf_table = table; |
399 | 399 | ||
400 | exit_vf_table: | 400 | exit_vf_table: |
401 | 401 | ||
@@ -800,7 +800,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) | |||
800 | nvgpu_list_add(&dev->node, &arb->requests); | 800 | nvgpu_list_add(&dev->node, &arb->requests); |
801 | nvgpu_spinlock_release(&arb->requests_lock); | 801 | nvgpu_spinlock_release(&arb->requests_lock); |
802 | } | 802 | } |
803 | xchg(&session->target, target); | 803 | session->target = target; |
804 | } | 804 | } |
805 | nvgpu_spinlock_release(&session->session_lock); | 805 | nvgpu_spinlock_release(&session->session_lock); |
806 | 806 | ||
@@ -933,7 +933,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) | |||
933 | 933 | ||
934 | /* Make changes visible to other threads */ | 934 | /* Make changes visible to other threads */ |
935 | nvgpu_smp_wmb(); | 935 | nvgpu_smp_wmb(); |
936 | xchg(&arb->actual, actual); | 936 | arb->actual = actual; |
937 | 937 | ||
938 | status = nvgpu_lpwr_enable_pg(g, false); | 938 | status = nvgpu_lpwr_enable_pg(g, false); |
939 | if (status < 0) { | 939 | if (status < 0) { |
@@ -988,7 +988,7 @@ static void nvgpu_clk_arb_run_arbiter_cb(struct nvgpu_clk_arb *arb) | |||
988 | } | 988 | } |
989 | /* commit changes before exchanging debug pointer */ | 989 | /* commit changes before exchanging debug pointer */ |
990 | nvgpu_smp_wmb(); | 990 | nvgpu_smp_wmb(); |
991 | xchg(&arb->debug, debug); | 991 | arb->debug = debug; |
992 | #endif | 992 | #endif |
993 | 993 | ||
994 | exit_arb: | 994 | exit_arb: |