]> git.itanic.dy.fi Git - linux-stable/commit
drm/amdgpu: refine get gpu clock counter method
authorTong Liu01 <Tong.Liu01@amd.com>
Thu, 6 Apr 2023 07:58:31 +0000 (15:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:30:23 +0000 (17:30 +0100)
commit5af10fd3cb68798ae4b1209e897ff6e983dfb30b
tree4655e4fc1fe40a284a3493be05704f6feaa24fca
parentc5b44c03d4ae2c1e33f09743f1e727429779d767
drm/amdgpu: refine get gpu clock counter method

commit 5591a051b86be170a84943698ab140342602ff7b upstream.

[why]
regGOLDEN_TSC_COUNT_LOWER/regGOLDEN_TSC_COUNT_UPPER are protected and
unaccessible under sriov.
The clock counter high bit may update during reading process.

[How]
Replace regGOLDEN_TSC_COUNT_LOWER/regGOLDEN_TSC_COUNT_UPPER with
regCP_MES_MTIME_LO/regCP_MES_MTIME_HI to get gpu clock under sriov.
Refine get gpu clock counter method to make the result more precise.

Signed-off-by: Tong Liu01 <Tong.Liu01@amd.com>
Acked-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c