diff options
author | Janne Hellsten <jhellsten@nvidia.com> | 2014-12-23 04:35:07 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 18:06:05 -0400 |
commit | 57eeccb4a5f1e7ee5be2b1dc2376de2103ef9a04 (patch) | |
tree | ab853dbfa6aacc55736cbd65a8246aa5119add62 /drivers/gpu/nvgpu/gk20a | |
parent | 4f3647ca32650ff93da1c1159bc87561e89489fa (diff) |
gpu: nvgpu: use u32 for priv_cmd_queue get/put/size
Switch to a larger integer type for priv_cmd_queue get/put/size
fields. The previous 16-bit int type overflowed on >= 2048 gpfifo
buffer sizes. This triggered a div-by-zero kernel panic.
Bug 1592391
Signed-off-by: Janne Hellsten <jhellsten@nvidia.com>
Change-Id: Ibffcbbd145f39fdb4a63d05b1dcb42bb4b101795
Reviewed-on: http://git-master/r/667103
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index b3564409..6ccb6ab1 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -223,9 +223,9 @@ struct page_directory_gk20a { | |||
223 | struct priv_cmd_queue { | 223 | struct priv_cmd_queue { |
224 | struct priv_cmd_queue_mem_desc mem; | 224 | struct priv_cmd_queue_mem_desc mem; |
225 | u64 base_gpuva; /* gpu_va base */ | 225 | u64 base_gpuva; /* gpu_va base */ |
226 | u16 size; /* num of entries in words */ | 226 | u32 size; /* num of entries in words */ |
227 | u16 put; /* put for priv cmd queue */ | 227 | u32 put; /* put for priv cmd queue */ |
228 | u16 get; /* get for priv cmd queue */ | 228 | u32 get; /* get for priv cmd queue */ |
229 | struct list_head free; /* list of pre-allocated free entries */ | 229 | struct list_head free; /* list of pre-allocated free entries */ |
230 | struct list_head head; /* list of used entries */ | 230 | struct list_head head; /* list of used entries */ |
231 | }; | 231 | }; |
@@ -233,8 +233,8 @@ struct priv_cmd_queue { | |||
233 | struct priv_cmd_entry { | 233 | struct priv_cmd_entry { |
234 | u32 *ptr; | 234 | u32 *ptr; |
235 | u64 gva; | 235 | u64 gva; |
236 | u16 get; /* start of entry in queue */ | 236 | u32 get; /* start of entry in queue */ |
237 | u16 size; /* in words */ | 237 | u32 size; /* in words */ |
238 | u32 gp_get; /* gp_get when submitting last priv cmd */ | 238 | u32 gp_get; /* gp_get when submitting last priv cmd */ |
239 | u32 gp_put; /* gp_put when submitting last priv cmd */ | 239 | u32 gp_put; /* gp_put when submitting last priv cmd */ |
240 | u32 gp_wrap; /* wrap when submitting last priv cmd */ | 240 | u32 gp_wrap; /* wrap when submitting last priv cmd */ |