gpu: nvgpu: move os_channel close after unbind

Move os_channel close after tsg unbind which internally sets syncpoint
to a safe value. Otherwise it causes syncpoint wait in syncpt waiter
thread to block indefinitely if signaler is killed.

Bug 200509048

Change-Id: Ifcb3c2efcabd94c0a4f7da3975db316926003cb5
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094476
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Shashank Singh
2019-04-10 23:09:03 +05:30
committed by mobile promotions
parent c97fc81d21
commit d16c164863

View File

@@ -321,10 +321,6 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
trace_gk20a_free_channel(ch->chid);
if (g->os_channel.close != NULL) {
g->os_channel.close(ch, force);
}
/*
* Disable channel/TSG and unbind here. This should not be executed if
* HW access is not available during shutdown/removal path as it will
@@ -353,6 +349,18 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
*/
}
}
/*
* OS channel close may require that syncpoint should be set to some
* safe value before it is called. nvgpu_tsg_unbind_channel(above) is
* internally doing that by calling nvgpu_nvhost_syncpt_set_safe_state
* deep down in the stack. Otherwise os_channel close may block if the
* app is killed abruptly (which was going to do the syncpoint signal).
*/
if (g->os_channel.close != NULL) {
g->os_channel.close(ch, force);
}
/* wait until there's only our ref to the channel */
if (!force) {
gk20a_wait_until_counter_is_N(