diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 7fc77f5ca..22d45c1c0 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -116,7 +116,7 @@ static int nvgpu_sw_quiesce_thread(void *data) nvgpu_disable_irqs(g); nvgpu_channel_sw_quiesce(g); - nvgpu_bug_exit(1); + nvgpu_bug_exit(); done: nvgpu_log_info(g, "done"); diff --git a/drivers/gpu/nvgpu/include/nvgpu/bug.h b/drivers/gpu/nvgpu/include/nvgpu/bug.h index 914b9e27b..cfa289050 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/bug.h +++ b/drivers/gpu/nvgpu/include/nvgpu/bug.h @@ -110,7 +110,7 @@ nvgpu_bug_cb_from_node(struct nvgpu_list_node *node) }; #ifdef __KERNEL__ -static inline void nvgpu_bug_exit(int status) { } +static inline void nvgpu_bug_exit(void) { } static inline void nvgpu_bug_register_cb(struct nvgpu_bug_cb *cb) { } static inline void nvgpu_bug_unregister_cb(struct nvgpu_bug_cb *cb) { } #endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h b/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h index 79e365890..eefc5e627 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h +++ b/drivers/gpu/nvgpu/include/nvgpu/posix/bug.h @@ -147,12 +147,10 @@ struct nvgpu_bug_cb; * @brief Exit current process * * This function is used during the handling of a bug to exit the calling - * program. Uses the library function #exit with \a status as parameter. - * Function does not perform any validation of the parameter. - * - * @param status [in] Exit status to be used for the program. + * program, a SIGSEGV is raised using library function #raise to terminate + * the process. */ -void nvgpu_bug_exit(int status); +void nvgpu_bug_exit(void); /** * @brief Register callback to be invoked on BUG() diff --git a/drivers/gpu/nvgpu/os/posix/bug.c b/drivers/gpu/nvgpu/os/posix/bug.c index 5edb70f8f..b9c22fd5a 100644 --- a/drivers/gpu/nvgpu/os/posix/bug.c +++ b/drivers/gpu/nvgpu/os/posix/bug.c @@ -101,12 +101,18 @@ static void nvgpu_bug_init(void) } #endif -void nvgpu_bug_exit(int status) +void nvgpu_bug_exit(void) { - (void)status; #ifndef __NVGPU_UNIT_TEST__ + int err; nvgpu_err(NULL, "SW quiesce done. Exiting."); - exit(status); + while ((err = raise(SIGSEGV)) != 0) { + /* + * Make sure that SIGSEGV signal is raised. + */ + } + + pthread_exit(NULL); #endif }