drm/amdgpu/gmc9: fix 64 bit division in partition code
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 16 May 2023 21:16:30 +0000 (17:16 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 14:37:52 +0000 (10:37 -0400)
commit45b3a914d40e63d2c9e3a3e02fb2014be975b9b0
tree66bdb4126a5d312e3c19bb14d163d90d305114ea
parent92ecb92ccc839c4c4b51ab1025cde5dd82c2fb4b
drm/amdgpu/gmc9: fix 64 bit division in partition code

Rework logic or use do_div() to avoid problems on 32 bit.

v2: add a missing case for XCP macro
v3: fix out of bounds array access
v4: fix xcp handling harder

Acked-by: Guchun Chen <guchun.chen@amd.com> (v1)
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> (v3)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c