summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMa Jun <Jun.Ma2@amd.com>2024-04-22 10:07:51 +0800
committerAlex Deucher <alexander.deucher@amd.com>2024-04-26 17:22:43 -0400
commit2e55bcf3d742a4946d862b86e39e75a95cc6f1c0 (patch)
tree56a50bfb8462fa7e66cc4c75d70e579bcbf2c83d
parent48fa90718b2ae1d0f17ba94f84e4f93d9f6068cd (diff)
downloadlinux-stable-2e55bcf3d742a4946d862b86e39e75a95cc6f1c0.tar.gz
linux-stable-2e55bcf3d742a4946d862b86e39e75a95cc6f1c0.tar.bz2
linux-stable-2e55bcf3d742a4946d862b86e39e75a95cc6f1c0.zip
drm/amdgpu: Initialize timestamp for some legacy SOCs
Initialize the interrupt timestamp for some legacy SOCs to fix the coverity issue "Uninitialized scalar variable" Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Suggested-by: Christian König <christian.koenig@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 7e6d09730e6d..665c63f55278 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -445,6 +445,14 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
entry.ih = ih;
entry.iv_entry = (const uint32_t *)&ih->ring[ring_index];
+
+ /*
+ * timestamp is not supported on some legacy SOCs (cik, cz, iceland,
+ * si and tonga), so initialize timestamp and timestamp_src to 0
+ */
+ entry.timestamp = 0;
+ entry.timestamp_src = 0;
+
amdgpu_ih_decode_iv(adev, &entry);
trace_amdgpu_iv(ih - &adev->irq.ih, &entry);