summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonsta Hölttä <kholtta@nvidia.com>2021-06-09 07:00:12 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2021-06-15 03:24:16 -0400
commit511344da855c4a6fc06432fb478c42664519f93d (patch)
tree3650b3ef7cab36fe85d6e8368803b2dd4bddb6eb
parent12e89c21dec793269a0c0f1f3f2160bb7cdf5ebd (diff)
gpu: nvgpu: avoid faulty elpg protection
Don't store the return value of elpg re-enable if disable fails; this could make the local status value zero again, causing the elpg-protected call to be executed with elpg still enabled and elpg re-enabled twice. Commit c90585856567 ("gpu: nvgpu: add cg and pg function") introduced this bug; failure of re-enabling after a failed disable might be another problem (and it's not clear why this is done in the first place) which isn't propagated to the caller, but that would belong to another patch. Bug 200565050 Change-Id: I7cf7a0887ae59e85bf0c56c38aaaadfefd16cc1c Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2541859 (cherry picked from commit 4b3591aafb8a53b051ce75629b15d2957943bd76) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2543030 Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 08b81e86..901835c8 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A Graphics Engine 2 * GK20A Graphics Engine
3 * 3 *
4 * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2021, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -602,7 +602,7 @@ u32 gk20a_gr_get_sm_no_lock_down_hww_global_esr_mask(struct gk20a *g);
602 if (g->support_pmu) {\ 602 if (g->support_pmu) {\
603 err = nvgpu_pg_elpg_disable(g);\ 603 err = nvgpu_pg_elpg_disable(g);\
604 if (err != 0) {\ 604 if (err != 0) {\
605 err = nvgpu_pg_elpg_enable(g); \ 605 (void)nvgpu_pg_elpg_enable(g); \
606 } \ 606 } \
607 } \ 607 } \
608 if (err == 0) { \ 608 if (err == 0) { \