gpu: nvgpu: fix misra violation in bug unit

Modify the callback interface from bug to quiesce unit to remove
a possible cyclic dependency in the bug unit. Make the list of
callbacks from bug unit, UT specific. The quiesce callback function
and argument are kept in separate variables, and in a normal run the
only callback that bug unit would invoke will be the quiesce specific
function. These changes will fix the violation of Rule 17.2 in bug unit.

JIRA NVGPU-6537

Change-Id: Icb6bc92077f8d26c87425768b09a7194a98e015d
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2527207
(cherry picked from commit 7696565648c5dd573a03be19ba9525856b781ea6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2530900
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
ajesh
2021-05-10 15:49:52 +03:00
committed by mobile promotions
parent d1983f5cfa
commit b15bd97c08
5 changed files with 50 additions and 17 deletions

View File

@@ -163,6 +163,7 @@ static int nvgpu_sw_quiesce_init_support(struct gk20a *g)
/* register callback to SW quiesce GPU in case of BUG() */
g->sw_quiesce_bug_cb.cb = nvgpu_sw_quiesce_bug_cb;
g->sw_quiesce_bug_cb.arg = g;
g->sw_quiesce_bug_cb.sw_quiesce_data = true;
nvgpu_bug_register_cb(&g->sw_quiesce_bug_cb);
#ifdef CONFIG_NVGPU_RECOVERY