| From b0f6a748166a3d30a3385dbadc549e6e14490113 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Mon, 22 Apr 2024 10:07:51 +0800 |
| Subject: drm/amdgpu: Initialize timestamp for some legacy SOCs |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| From: Ma Jun <Jun.Ma2@amd.com> |
| |
| [ 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 | 8 ++++++++ |
| 1 file changed, 8 insertions(+) |
| |
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c |
| index 9efbc0f7c6bdf..c3da333f09de4 100644 |
| --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c |
| +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c |
| @@ -480,6 +480,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); |
| -- |
| 2.43.0 |
| |