[radeon-alex:amd-staging-drm-next-pco 299/339] drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.c:49 gfxhub_v1_1_get_xgmi_info() warn: should '(((amdgpu_mm_rreg(adev, (adev->reg_offset[1][0][0] + 2424), 0)) & 65535) >> 0) << 24' be a 64 bit type?

Dan Carpenter dan.carpenter at oracle.com
Fri Sep 14 08:34:38 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next-pco
head:   bbab57a341c90ed6e32de8edf4e89dc5c55cddac
commit: 5c777a51926dd6bbbf82dc5bddd980a408f0f618 [299/339] drm/amdgpu/gmc9: Adjust GART and AGP location with xgmi offset

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.c:49 gfxhub_v1_1_get_xgmi_info() warn: should '(((amdgpu_mm_rreg(adev, (adev->reg_offset[1][0][0] + 2424), 0)) & 65535) >> 0) << 24' be a 64 bit type?

git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 5c777a51926dd6bbbf82dc5bddd980a408f0f618
vim +49 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.c

96073652 Alex Deucher 2018-06-19  30  
96073652 Alex Deucher 2018-06-19  31  int gfxhub_v1_1_get_xgmi_info(struct amdgpu_device *adev)
96073652 Alex Deucher 2018-06-19  32  {
96073652 Alex Deucher 2018-06-19  33  	u32 xgmi_lfb_cntl = RREG32_SOC15(GC, 0, mmMC_VM_XGMI_LFB_CNTL);
96073652 Alex Deucher 2018-06-19  34  	u32 max_region =
96073652 Alex Deucher 2018-06-19  35  		REG_GET_FIELD(xgmi_lfb_cntl, MC_VM_XGMI_LFB_CNTL, PF_MAX_REGION);
96073652 Alex Deucher 2018-06-19  36  
96073652 Alex Deucher 2018-06-19  37  	/* PF_MAX_REGION=0 means xgmi is disabled */
96073652 Alex Deucher 2018-06-19  38  	if (max_region) {
96073652 Alex Deucher 2018-06-19  39  		adev->gmc.xgmi.num_physical_nodes = max_region + 1;
96073652 Alex Deucher 2018-06-19  40  		if (adev->gmc.xgmi.num_physical_nodes > 4)
96073652 Alex Deucher 2018-06-19  41  			return -EINVAL;
96073652 Alex Deucher 2018-06-19  42  
96073652 Alex Deucher 2018-06-19  43  		adev->gmc.xgmi.physical_node_id =
96073652 Alex Deucher 2018-06-19  44  			REG_GET_FIELD(xgmi_lfb_cntl, MC_VM_XGMI_LFB_CNTL, PF_LFB_REGION);
96073652 Alex Deucher 2018-06-19  45  		if (adev->gmc.xgmi.physical_node_id > 3)
96073652 Alex Deucher 2018-06-19  46  			return -EINVAL;
5c777a51 Alex Deucher 2018-06-19  47  		adev->gmc.xgmi.node_segment_size = REG_GET_FIELD(
5c777a51 Alex Deucher 2018-06-19  48  			RREG32_SOC15(GC, 0, mmMC_VM_XGMI_LFB_SIZE),
5c777a51 Alex Deucher 2018-06-19 @49  			MC_VM_XGMI_LFB_SIZE, PF_LFB_SIZE) << 24;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list