drm/amdgpu/hubs: cast register values to u64
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu/hubs: cast register values to u64
Cast the register value to u64 for the shift.
Fixes da0020bf6deb ("drm/amdgpu: Add gc v12_1_0 ip headers v4")
Fixes 3148d9bb913a ("drm/amdgpu: Add initial support for mmhub v4_2")
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +3 -3
@@ -45,9 +45,9 @@ static u64 gfxhub_v12_1_get_fb_location(struct amdgpu_device *adev) base &=GCMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (GC ,GET_INST (GC ,0 ), + regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }
drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c +3 -3
@@ -81,9 +81,9 @@ static u64 mmhub_v4_2_0_get_fb_location(struct amdgpu_device *adev) base &=MMMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), - regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), + regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }
Signature · 1 line
2.51.1
Reviewed-by Alex Hung <[email protected]>
Quoted 44 lines · Alex Deucher
Cast the register value to u64 for the shift.
Fixes da0020bf6deb ("drm/amdgpu: Add gc v12_1_0 ip headers v4")Fixes 3148d9bb913a ("drm/amdgpu: Add initial support for mmhub v4_2")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +3
-3@@ -45,9 +45,9 @@ static u64 gfxhub_v12_1_get_fb_location(struct amdgpu_device *adev) base &=GCMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (GC ,GET_INST (GC ,0 ), + regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c +3
-3@@ -81,9 +81,9 @@ static u64 mmhub_v4_2_0_get_fb_location(struct amdgpu_device *adev) base &=MMMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), - regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), + regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Ethan Cheung <[email protected]>
________________________________
From: Hung, Alex <[email protected]>
Sent: Monday, November 24, 2025 12:20 PM
To: Deucher, Alexander <[email protected]>; [email protected] <[email protected]>
Cc: Cheung, Ethan <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/hubs: cast register values to u64
Reviewed-by Alex Hung <[email protected]>
Quoted 44 lines · Alex Deucher
Cast the register value to u64 for the shift.
Fixes da0020bf6deb ("drm/amdgpu: Add gc v12_1_0 ip headers v4")Fixes 3148d9bb913a ("drm/amdgpu: Add initial support for mmhub v4_2")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +3
-3@@ -45,9 +45,9 @@ static u64 gfxhub_v12_1_get_fb_location(struct amdgpu_device *adev) base &=GCMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(GCMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (GC ,GET_INST (GC ,0 ), + regGCMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c +3
-3@@ -81,9 +81,9 @@ static u64 mmhub_v4_2_0_get_fb_location(struct amdgpu_device *adev) base &=MMMC_VM_FB_LOCATION_BASE_LO32__FB_BASE_LO32_MASK ; base <<=24 ; - base |= ((MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & -RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), - regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 ); + base |= ((u64)(MMMC_VM_FB_LOCATION_BASE_HI32__FB_BASE_HI1_MASK & +RREG32_SOC15 (MMHUB ,GET_INST (MMHUB ,0 ), + regMMMC_VM_FB_LOCATION_BASE_HI32)) <<56 );return base; }