gpu: nvgpu: init: reduce CCM for nvgpu_prepare_poweroff

Change how nvgpu_prepare_poweroff() handles multiple errors from the
unit poweroff functions. Previously, the last error was returned. It
doesn't really matter much which error is returned, just return an
error.

This update reduces the TCC metric from 11 to 8.

JIRA NVGPU-4327

Change-Id: Ic84f7e25eef2657c3d11881f221c26c9b09bed27
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2235338
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>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-11-06 16:30:30 -05:00
committed by Alex Waterman
parent c0dae9d471
commit 06a8fd2ecb

View File

@@ -278,15 +278,15 @@ int nvgpu_prepare_poweroff(struct gk20a *g)
}
#endif
tmp_ret = g->ops.gr.gr_suspend(g);
if ((tmp_ret != 0) && (ret == 0)) {
if (tmp_ret != 0) {
ret = tmp_ret;
}
tmp_ret = g->ops.mm.mm_suspend(g);
if ((tmp_ret != 0) && (ret == 0)) {
if (tmp_ret != 0) {
ret = tmp_ret;
}
tmp_ret = g->ops.fifo.fifo_suspend(g);
if ((tmp_ret != 0) && (ret == 0)) {
if (tmp_ret != 0) {
ret = tmp_ret;
}