diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-06-08 13:13:51 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-08 22:13:34 -0400 |
commit | 821d1cab904d055264bc5d62b0c0d5187417ff13 (patch) | |
tree | c2e3a395e43374e84fb8b8dc3d8349ff6168a0af /drivers/gpu/nvgpu/common | |
parent | 1dfcf1833ba3e8fa58d0ad6ecb189db32c6b986f (diff) |
gpu: nvgpu: Move error notifier free to Linux module
Freeing error notifier involves calling dma_buf API, which is Linux
specific. Move the free to happen in Linux specific channel close
path.
JIRA NVGPU-65
Change-Id: Ifd8b31bb8c8af13975c34add00f51dd869cfd76a
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1498583
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_channel.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c index 2c9fac0b..a083cb81 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.c | |||
@@ -180,6 +180,19 @@ static int gk20a_channel_set_wdt_status(struct channel_gk20a *ch, | |||
180 | return 0; | 180 | return 0; |
181 | } | 181 | } |
182 | 182 | ||
183 | static void gk20a_channel_free_error_notifiers(struct channel_gk20a *ch) | ||
184 | { | ||
185 | nvgpu_mutex_acquire(&ch->error_notifier_mutex); | ||
186 | if (ch->error_notifier_ref) { | ||
187 | dma_buf_vunmap(ch->error_notifier_ref, ch->error_notifier_va); | ||
188 | dma_buf_put(ch->error_notifier_ref); | ||
189 | ch->error_notifier_ref = NULL; | ||
190 | ch->error_notifier = NULL; | ||
191 | ch->error_notifier_va = NULL; | ||
192 | } | ||
193 | nvgpu_mutex_release(&ch->error_notifier_mutex); | ||
194 | } | ||
195 | |||
183 | static int gk20a_init_error_notifier(struct channel_gk20a *ch, | 196 | static int gk20a_init_error_notifier(struct channel_gk20a *ch, |
184 | struct nvgpu_set_error_notifier *args) | 197 | struct nvgpu_set_error_notifier *args) |
185 | { | 198 | { |
@@ -262,6 +275,8 @@ int gk20a_channel_release(struct inode *inode, struct file *filp) | |||
262 | trace_gk20a_channel_release(dev_name(g->dev)); | 275 | trace_gk20a_channel_release(dev_name(g->dev)); |
263 | 276 | ||
264 | gk20a_channel_close(ch); | 277 | gk20a_channel_close(ch); |
278 | gk20a_channel_free_error_notifiers(ch); | ||
279 | |||
265 | gk20a_idle(g); | 280 | gk20a_idle(g); |
266 | 281 | ||
267 | channel_release: | 282 | channel_release: |