Skip to contentSkip to conversation

drm/amdgpu: fix a build warning by a typo in amdgpu_gfx.c

PATCH In review Guchun Chen 3 participants 3 messages Apr 26, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix a build warning by a typo in amdgpu_gfx.c

This should be a typo when intruducing multi-xx support.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -2
index 60bb4bba1994..2cf1f88fde48 100644
@@ -470,8 +470,8 @@ void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev, int xcc_id)
 
 	for (i = 0; i < adev->gfx.num_compute_rings; i++) {
 		j = i + xcc_id * adev->gfx.num_compute_rings;
-		ring = &adev->gfx.compute_ring[i];
-		kfree(adev->gfx.mec.mqd_backup[i]);
+		ring = &adev->gfx.compute_ring[j];
+		kfree(adev->gfx.mec.mqd_backup[j]);
 		amdgpu_bo_free_kernel(&ring->mqd_obj,
 				      &ring->mqd_gpu_addr,
 				      &ring->mqd_ptr);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 37 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, April 26, 2023 11:12 AM
To: [email protected]; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>
Cc: Chen, Guchun <[email protected]>; kernel test robot <[email protected]>
Subject: [PATCH] drm/amdgpu: fix a build warning by a typo in amdgpu_gfx.c

This should be a typo when intruducing multi-xx support.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -2
index 60bb4bba1994..2cf1f88fde48 100644
@@ -470,8 +470,8 @@ void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device
 *adev, int xcc_id)
 
      for (i = 0; i < adev->gfx.num_compute_rings; i++) {
              j = i + xcc_id * adev->gfx.num_compute_rings;
-             ring = &adev->gfx.compute_ring[i];
-             kfree(adev->gfx.mec.mqd_backup[i]);
+             ring = &adev->gfx.compute_ring[j];
+             kfree(adev->gfx.mec.mqd_backup[j]);
              amdgpu_bo_free_kernel(&ring->mqd_obj,
                                    &ring->mqd_gpu_addr,
                                    &ring->mqd_ptr);

--
2.25.1

Acked-by on v1 1/1
#2 lore raw
In reply to Guchun Chen

Am 26.04.23 um 05:11 schrieb Guchun Chen:

Quoted 5 lines

This should be a typo when intruducing multi-xx support.

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +2 -2
index 60bb4bba1994..2cf1f88fde48 100644
@@ -470,8 +470,8 @@ void amdgpu_gfx_mqd_sw_fini(struct amdgpu_device *adev, int xcc_id)
 
  	for (i = 0; i < adev->gfx.num_compute_rings; i++) {
  		j = i + xcc_id * adev->gfx.num_compute_rings;
-		ring = &adev->gfx.compute_ring[i];
-		kfree(adev->gfx.mec.mqd_backup[i]);
+		ring = &adev->gfx.compute_ring[j];
+		kfree(adev->gfx.mec.mqd_backup[j]);
  		amdgpu_bo_free_kernel(&ring->mqd_obj,
  				      &ring->mqd_gpu_addr,
  				      &ring->mqd_ptr);