diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-07-31 03:39:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-02 16:56:40 -0400 |
commit | 7216f3dd71cc023ec4d8ef0c9a90a554c0f09362 (patch) | |
tree | 4ddcb2517e4094d930f8dd9e5604b8e212e86fa2 /drivers/gpu/nvgpu/os/linux | |
parent | 63e6e8ee3ee9ce01b1f7d4c0014bb589df105d71 (diff) |
gpu: nvgpu: allow global regops before ctx is created
In nvgpu_ioctl_channel_reg_ops(), we right now first check if context is
allocated or not and if context is not allocated we fail the regops operation
But it is possible that the regops operation only includes global regops which
does not need global context allocated
So move this global context check from nvgpu_ioctl_channel_reg_ops() to
exec_regops_gk20a() and only if we have context ops included in the regops
Bug 200431958
Change-Id: Iaa4953235d95b2106d5f81a456141d3a57603fb9
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1789262
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 1989a5cb..eadf1f93 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | |||
@@ -100,9 +100,6 @@ static int alloc_session(struct gk20a *g, struct dbg_session_gk20a_linux **_dbg_ | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static bool gr_context_info_available(struct dbg_session_gk20a *dbg_s, | ||
104 | struct gr_gk20a *gr); | ||
105 | |||
106 | static int gk20a_perfbuf_release_locked(struct gk20a *g, u64 offset); | 103 | static int gk20a_perfbuf_release_locked(struct gk20a *g, u64 offset); |
107 | 104 | ||
108 | static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | 105 | static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, |
@@ -870,13 +867,6 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
870 | return -EINVAL; | 867 | return -EINVAL; |
871 | } | 868 | } |
872 | 869 | ||
873 | /* be sure that ctx info is in place */ | ||
874 | if (!g->is_virtual && | ||
875 | !gr_context_info_available(dbg_s, &g->gr)) { | ||
876 | nvgpu_err(g, "gr context data not available"); | ||
877 | return -ENODEV; | ||
878 | } | ||
879 | |||
880 | /* since exec_reg_ops sends methods to the ucode, it must take the | 870 | /* since exec_reg_ops sends methods to the ucode, it must take the |
881 | * global gpu lock to protect against mixing methods from debug sessions | 871 | * global gpu lock to protect against mixing methods from debug sessions |
882 | * on other channels */ | 872 | * on other channels */ |
@@ -1653,29 +1643,6 @@ static void nvgpu_dbg_gpu_ioctl_get_timeout(struct dbg_session_gk20a *dbg_s, | |||
1653 | args->enable = NVGPU_DBG_GPU_IOCTL_TIMEOUT_DISABLE; | 1643 | args->enable = NVGPU_DBG_GPU_IOCTL_TIMEOUT_DISABLE; |
1654 | } | 1644 | } |
1655 | 1645 | ||
1656 | /* In order to perform a context relative op the context has | ||
1657 | * to be created already... which would imply that the | ||
1658 | * context switch mechanism has already been put in place. | ||
1659 | * So by the time we perform such an opertation it should always | ||
1660 | * be possible to query for the appropriate context offsets, etc. | ||
1661 | * | ||
1662 | * But note: while the dbg_gpu bind requires the a channel fd, | ||
1663 | * it doesn't require an allocated gr/compute obj at that point... | ||
1664 | */ | ||
1665 | static bool gr_context_info_available(struct dbg_session_gk20a *dbg_s, | ||
1666 | struct gr_gk20a *gr) | ||
1667 | { | ||
1668 | int err; | ||
1669 | |||
1670 | nvgpu_mutex_acquire(&gr->ctx_mutex); | ||
1671 | err = !gr->ctx_vars.golden_image_initialized; | ||
1672 | nvgpu_mutex_release(&gr->ctx_mutex); | ||
1673 | if (err) | ||
1674 | return false; | ||
1675 | return true; | ||
1676 | |||
1677 | } | ||
1678 | |||
1679 | static int gk20a_perfbuf_release_locked(struct gk20a *g, u64 offset) | 1646 | static int gk20a_perfbuf_release_locked(struct gk20a *g, u64 offset) |
1680 | { | 1647 | { |
1681 | struct mm_gk20a *mm = &g->mm; | 1648 | struct mm_gk20a *mm = &g->mm; |