summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorKary Jin <karyj@nvidia.com>2018-10-15 03:57:52 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-10-29 22:08:48 -0400
commit9d2e50de426ac6362d66f9ccb29a0415322e467f (patch)
treefd7742b653f232a7e4da5ee8e7cf7338f0b5cddf /drivers/gpu/nvgpu/include
parente1c52e46ea383dd280f9d65a4e34422fd9f3637a (diff)
gpu: nvgpu: Add reboot handler
Add a reboot handler to make sure that nvgpu does not try to busy the GPU if the system is going down. If the system is going down then any number of subsystems nvgpu depends on may already have been deinitialized. Bug 200333709 Bug 200454316 Change-Id: I2ceaf7ca4fb88643310874b5b26937ef44c6e3dd Signed-off-by: Kary Jin <karyj@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1927018 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Vinayak Pane <vpane@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/enabled.h1
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/gk20a.h8
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
index 074be0c3..12acf353 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
@@ -36,6 +36,7 @@ struct gk20a;
36#define NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP 3 36#define NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP 3
37#define NVGPU_FECS_TRACE_VA 4 37#define NVGPU_FECS_TRACE_VA 4
38#define NVGPU_CAN_RAILGATE 5 38#define NVGPU_CAN_RAILGATE 5
39#define NVGPU_KERNEL_IS_DYING 6
39 40
40/* 41/*
41 * ECC flags 42 * ECC flags
diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
index a256b01f..0424e74d 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h
@@ -49,6 +49,9 @@ struct nvgpu_gpu_ctxsw_trace_filter;
49struct priv_cmd_entry; 49struct priv_cmd_entry;
50struct nvgpu_gpfifo_args; 50struct nvgpu_gpfifo_args;
51 51
52#ifdef __KERNEL__
53#include <linux/notifier.h>
54#endif
52#include <nvgpu/lock.h> 55#include <nvgpu/lock.h>
53#include <nvgpu/thread.h> 56#include <nvgpu/thread.h>
54 57
@@ -1411,6 +1414,10 @@ struct gk20a {
1411 */ 1414 */
1412 unsigned long *enabled_flags; 1415 unsigned long *enabled_flags;
1413 1416
1417#ifdef __KERNEL__
1418 struct notifier_block nvgpu_reboot_nb;
1419#endif
1420
1414 nvgpu_atomic_t usage_count; 1421 nvgpu_atomic_t usage_count;
1415 1422
1416 struct nvgpu_mutex ctxsw_disable_lock; 1423 struct nvgpu_mutex ctxsw_disable_lock;
@@ -1741,7 +1748,6 @@ void gk20a_idle(struct gk20a *g);
1741int __gk20a_do_idle(struct gk20a *g, bool force_reset); 1748int __gk20a_do_idle(struct gk20a *g, bool force_reset);
1742int __gk20a_do_unidle(struct gk20a *g); 1749int __gk20a_do_unidle(struct gk20a *g);
1743 1750
1744int gk20a_can_busy(struct gk20a *g);
1745int gk20a_wait_for_idle(struct gk20a *g); 1751int gk20a_wait_for_idle(struct gk20a *g);
1746 1752
1747#define NVGPU_GPU_ARCHITECTURE_SHIFT 4 1753#define NVGPU_GPU_ARCHITECTURE_SHIFT 4