summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c
diff options
context:
space:
mode:
authorDeepak Goyal <dgoyal@nvidia.com>2017-10-23 02:16:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-25 07:23:57 -0400
commitc61e21c868246faf7a9ffc812590941fc362af17 (patch)
treecacc1639bcdc48766047dc65a715c67c51682612 /drivers/gpu/nvgpu/common/pmu/pmu_ipc.c
parent539c8bff4b501a4ca999290454a210f5d17ba516 (diff)
gpu: nvgpu: Fix race in PMU state transitions.
PMU response(intr callback for messages) can run faster than the kthread posting commands to PMU. This causes the PMU message callback to skip important pmu state change(which happens just after the PMU command is posted). Solution: State change should be triggered from only inside the intr callback. Other places can only update the pmu_state variable. This change also adds error check to print in case command post fails. JIRA GPUT19X-20 Change-Id: Ib0a4275440455342a898c93ea9d86c5822e039a7 Signed-off-by: Deepak Goyal <dgoyal@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1583577 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_ipc.c')
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_ipc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c
index e76ed7df..4c706e57 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu_ipc.c
@@ -640,7 +640,7 @@ int nvgpu_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd,
640 640
641 nvgpu_log_fn(g, "done"); 641 nvgpu_log_fn(g, "done");
642 642
643 return 0; 643 return err;
644 644
645clean_up: 645clean_up:
646 nvgpu_log_fn(g, "fail"); 646 nvgpu_log_fn(g, "fail");