mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
gpu: nvgpu: Fix gv11b_gr_set_sm_debug_mode for gpus with more than 32 sms
For gpu's 32 < number of sms <= 64, the hal uses integer type (which is usually 32 bit) for checking masks and left shifts the integer with values greater than 32. To avoid this is undefined behaviour, use u64 instead. Bug 2418354 Change-Id: Ib447e9360fab128ec5e46805aae734ce6a165d7f Signed-off-by: Anup Mahindre <amahindre@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1926890 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Thomas Fleury <tfleury@nvidia.com> Tested-by: Thomas Fleury <tfleury@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
25aa0f33b1
commit
2a465533ab
@@ -3222,7 +3222,7 @@ int gv11b_gr_set_sm_debug_mode(struct gk20a *g,
|
||||
u32 gpc, tpc, sm;
|
||||
u32 reg_offset, reg_mask, reg_val;
|
||||
|
||||
if (!(sms & (1 << sm_id))) {
|
||||
if (!(sms & ((u64)1 << sm_id))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user