diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-06-30 02:12:17 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-07-04 02:44:30 -0400 |
commit | 2cf964d175abc0f3eae9ed0e01e6eeed5cd6b4da (patch) | |
tree | dc91c30fdfcf4ee37ff830dcffc7b15c8b5add14 /drivers/gpu/nvgpu/common/falcon/falcon.c | |
parent | fbeca4a8414c03a1564d7a370964187be51a3e6c (diff) |
gpu: nvgpu: Falcon controller halt interrupt status clear
- Added nvgpu_flcn_clear_halt_intr_status() to
Wait for halt interrupt status clear by
clear_halt_interrupt_status() HAL within timeout
- Added gk20a_flcn_clear_halt_interrupt_status()
to clear falcon controller halt interrupt status
- Replaced flacon halt interrupt clear with
nvgpu_flcn_clear_halt_intr_status() method
NVGPU JIRA-99
Change-Id: I762a3c01cd1d02028eb6aaa9898a50be94376619
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master/r/1511333
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/falcon/falcon.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/falcon/falcon.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/falcon/falcon.c b/drivers/gpu/nvgpu/common/falcon/falcon.c index ba2fb3fe..3795dd09 100644 --- a/drivers/gpu/nvgpu/common/falcon/falcon.c +++ b/drivers/gpu/nvgpu/common/falcon/falcon.c | |||
@@ -122,6 +122,34 @@ int nvgpu_flcn_wait_for_halt(struct nvgpu_falcon *flcn, unsigned int timeout) | |||
122 | return status; | 122 | return status; |
123 | } | 123 | } |
124 | 124 | ||
125 | int nvgpu_flcn_clear_halt_intr_status(struct nvgpu_falcon *flcn, | ||
126 | unsigned int timeout) | ||
127 | { | ||
128 | struct gk20a *g = flcn->g; | ||
129 | struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; | ||
130 | struct nvgpu_timeout to; | ||
131 | int status = 0; | ||
132 | |||
133 | if (!flcn_ops->clear_halt_interrupt_status) { | ||
134 | nvgpu_warn(flcn->g, "Invalid op on falcon 0x%x ", | ||
135 | flcn->flcn_id); | ||
136 | return -EINVAL; | ||
137 | } | ||
138 | |||
139 | nvgpu_timeout_init(g, &to, timeout, NVGPU_TIMER_CPU_TIMER); | ||
140 | do { | ||
141 | if (flcn_ops->clear_halt_interrupt_status(flcn)) | ||
142 | break; | ||
143 | |||
144 | nvgpu_udelay(1); | ||
145 | } while (!nvgpu_timeout_expired(&to)); | ||
146 | |||
147 | if (nvgpu_timeout_peek_expired(&to)) | ||
148 | status = -EBUSY; | ||
149 | |||
150 | return status; | ||
151 | } | ||
152 | |||
125 | bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn) | 153 | bool nvgpu_flcn_get_idle_status(struct nvgpu_falcon *flcn) |
126 | { | 154 | { |
127 | struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; | 155 | struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; |