summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-11-07 19:12:45 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-04 18:53:55 -0500
commita0242464f5f12d9f10fbf0d05614bfadde84386c (patch)
tree2f5981f5b9e90811c675ef59e2d1ca10e440c0ed /drivers/gpu/nvgpu/gk20a/gk20a.c
parentb82d27e38490dc1155ece7d433fbcb6713b5a53b (diff)
gpu: nvgpu: Handle no GPU cases in helper funcs
In many helper functions like gk20a_readl() the code assumed that the GPU is present and registers and available. However, during GPU shutdown this may not be the case. In theory the driver should not be accessing GPU registers during GPU shutdown (since shutdown is triggered by GPU registers being unavailable) but these changes handle any missed cases where this may happen. This goes for GPU device access as well. Many parts of the code assume that if the struct gk20a is valid, the the GPU dev must be there are well. This isn't always the case, it seems. Bug 1816516 Bug 1807277 Change-Id: Icaf6fd56ab7860724e77bda0f5e8d48f0da15642 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1250024 (cherry picked from commit e8c9997b2d7cd424d798ecfce1307e6193c0cf32) Reviewed-on: http://git-master/r/1274473 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 5e56fc81..a65ca6c2 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -309,6 +309,11 @@ int gk20a_restore_registers(struct gk20a *g)
309 return 0; 309 return 0;
310} 310}
311 311
312void __gk20a_warn_on_no_regs(void)
313{
314 WARN_ONCE(1, "Attempted access to GPU regs after unmapping!");
315}
316
312static void kunmap_and_free_iopage(void **kvaddr, struct page **page) 317static void kunmap_and_free_iopage(void **kvaddr, struct page **page)
313{ 318{
314 if (*kvaddr) { 319 if (*kvaddr) {