]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Initialize timestamp for some legacy SOCs
authorMa Jun <Jun.Ma2@amd.com>
Mon, 22 Apr 2024 02:07:51 +0000 (10:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Jul 2024 09:40:47 +0000 (11:40 +0200)
[ Upstream commit 2e55bcf3d742a4946d862b86e39e75a95cc6f1c0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c

index 76429932035e14289b03933f38d88266d7bcb677..a803e6a4e347372494e4a103a05e41581c56456f 100644 (file)
@@ -384,6 +384,14 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev,
        int r;
 
        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);