[PATCH] drm/amdgpu: correct releasing the same sdma fw repeatedly

Jiansong Chen Jiansong.Chen at amd.com
Wed Dec 30 09:22:53 UTC 2020


Same as sienna_cichlid, dimgrey_cavefish and navy_flounder
reuse sdma0 fw for other instances, so free it only once.

Signed-off-by: Jiansong Chen <Jiansong.Chen at amd.com>
Change-Id: I9dda4a9b73e20243ee48f54d8f0c7593d7e7354b
---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index f1ba36a094da..6ac314c8be32 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -125,7 +125,8 @@ static void sdma_v5_2_destroy_inst_ctx(struct amdgpu_device *adev)
 		release_firmware(adev->sdma.instance[i].fw);
 		adev->sdma.instance[i].fw = NULL;
 
-		if (adev->asic_type == CHIP_SIENNA_CICHLID)
+		if (adev->asic_type >= CHIP_SIENNA_CICHLID &&
+		    adev->asic_type <= CHIP_DIMGREY_CAVEFISH)
 			break;
 	}
 
-- 
2.25.1



More information about the amd-gfx mailing list