diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-05-25 06:23:52 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:16 -0500 |
commit | 11e9ba82de18ba3be7701f36628a9f70ebbe1b39 (patch) | |
tree | 9d79788037b7274192075b16a5d08e3e73c9bc2f /drivers/gpu/nvgpu/gp10b | |
parent | 4e321eb1c84dca5f045b6ad1363cdc35ab763462 (diff) |
gpu: nvgpu: fix patch write error check in update_ctxsw_preemption_mode
Don't attempt to access memory if the patch context can't be mapped, but
print an error message instead.
Change-Id: I374dc94d13674e0bd9d081b790f7c0dac834e868
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1157828
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 5db65175..4a8a1d8e 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -1118,6 +1118,11 @@ static void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, | |||
1118 | gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va >> 8); | 1118 | gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va >> 8); |
1119 | 1119 | ||
1120 | err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); | 1120 | err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); |
1121 | if (err) { | ||
1122 | gk20a_err(dev_from_gk20a(g), | ||
1123 | "can't map patch context"); | ||
1124 | goto out; | ||
1125 | } | ||
1121 | 1126 | ||
1122 | addr = (u64_lo32(gr_ctx->t18x.betacb_ctxsw_buffer.gpu_va) >> | 1127 | addr = (u64_lo32(gr_ctx->t18x.betacb_ctxsw_buffer.gpu_va) >> |
1123 | gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v()) | | 1128 | gr_gpcs_setup_attrib_cb_base_addr_39_12_align_bits_v()) | |
@@ -1169,6 +1174,7 @@ static void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g, | |||
1169 | gr_gk20a_ctx_patch_write_end(g, ch_ctx); | 1174 | gr_gk20a_ctx_patch_write_end(g, ch_ctx); |
1170 | } | 1175 | } |
1171 | 1176 | ||
1177 | out: | ||
1172 | gk20a_dbg_fn("done"); | 1178 | gk20a_dbg_fn("done"); |
1173 | } | 1179 | } |
1174 | 1180 | ||