mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: sync with sw quiesce thread on init
Sometimes nvgpu_sw_quiesce_thread does not get a chance to run before common.init unit tests complete. When it finally gets scheduled, related gk20a context is invalid and it crashes in the pthread wrapper. Make sure nvgpu_sw_quiesce_thread has started in nvgpu_sw_quiesce_init_support, to avoid such issues. Bug 2732985 Change-Id: I0a46f271a926b5f0c203b465f69556b2b46d96c5 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2222560 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
764822d378
commit
d22fc21a5c
@@ -79,6 +79,9 @@ static int nvgpu_sw_quiesce_thread(void *data)
|
||||
struct gk20a *g = data;
|
||||
int err = 0;
|
||||
|
||||
g->sw_quiesce_init_done = true;
|
||||
nvgpu_cond_signal(&g->sw_quiesce_cond);
|
||||
|
||||
/* wait until all SW quiesce is requested */
|
||||
NVGPU_COND_WAIT(&g->sw_quiesce_cond,
|
||||
g->sw_quiesce_pending ||
|
||||
@@ -136,7 +139,8 @@ static int nvgpu_sw_quiesce_init_support(struct gk20a *g)
|
||||
return err;
|
||||
}
|
||||
|
||||
g->sw_quiesce_init_done = true;
|
||||
/* wait until thread actually starts */
|
||||
NVGPU_COND_WAIT(&g->sw_quiesce_cond, g->sw_quiesce_init_done, 0U);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user