summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorMahantesh Kumbar <mkumbar@nvidia.com>2017-06-28 07:23:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-04 02:44:30 -0400
commitfbeca4a8414c03a1564d7a370964187be51a3e6c (patch)
tree4ba412c53e52678b9e115fd1ec80655bd2380f46 /drivers/gpu/nvgpu/common
parent2f712e22303471b8dd2f9388c874d12b07aed258 (diff)
gpu: nvgpu: Falcon controller wait for halt
- Added nvgpu_flcn_wait_for_halt() interface to wait for falcon halt, which block till falcon halt or timeout expire for selected falcon controller - Replaced falcon wait for halt code with method nvgpu_flcn_wait_for_halt() NVGPU JIRA-99 Change-Id: Ie1809dc29ff65bddc7ef2859a9ee9b4f0003b127 Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-on: https://git-master/r/1510201 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/falcon/falcon.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/falcon/falcon.c b/drivers/gpu/nvgpu/common/falcon/falcon.c
index b6589bd1..ba2fb3fe 100644
--- a/drivers/gpu/nvgpu/common/falcon/falcon.c
+++ b/drivers/gpu/nvgpu/common/falcon/falcon.c
@@ -102,6 +102,26 @@ bool nvgpu_flcn_get_cpu_halted_status(struct nvgpu_falcon *flcn)
102 return status; 102 return status;
103} 103}
104 104
105int nvgpu_flcn_wait_for_halt(struct nvgpu_falcon *flcn, unsigned int timeout)
106{
107 struct gk20a *g = flcn->g;
108 struct nvgpu_timeout to;
109 int status = 0;
110
111 nvgpu_timeout_init(g, &to, timeout, NVGPU_TIMER_CPU_TIMER);
112 do {
113 if (nvgpu_flcn_get_cpu_halted_status(flcn))
114 break;
115
116 nvgpu_udelay(10);
117 } while (!nvgpu_timeout_expired(&to));
118
119 if (nvgpu_timeout_peek_expired(&to))
120 status = -EBUSY;
121
122 return status;
123}
124
105bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn) 125bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn)
106{ 126{
107 struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; 127 struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops;