Skip to content

Commit 424a98a

Browse files
committed
Merge tag 'amd-drm-fixes-6.11-2024-08-21' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.11-2024-08-21: amdgpu: - GFX10 firmware loading fix - SDMA 5.2 fix - Debugfs parameter validation fix - eGPU hotplug fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 5d34b05 + 9cead81 commit 424a98a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
278278
msg = RREG32(mmMP0_SMN_C2PMSG_33);
279279
if (msg & 0x80000000)
280280
break;
281-
usleep_range(1000, 1100);
281+
msleep(1);
282282
}
283283
}
284284

drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ static ssize_t ta_if_load_debugfs_write(struct file *fp, const char *buf, size_t
166166
if (ret)
167167
return -EFAULT;
168168

169+
if (ta_bin_len > PSP_1_MEG)
170+
return -EINVAL;
171+
169172
copy_pos += sizeof(uint32_t);
170173

171174
ta_bin = kzalloc(ta_bin_len, GFP_KERNEL);

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,6 +4116,7 @@ static void gfx_v10_0_check_gfxoff_flag(struct amdgpu_device *adev)
41164116

41174117
static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
41184118
{
4119+
char fw_name[53];
41194120
char ucode_prefix[30];
41204121
const char *wks = "";
41214122
int err;
@@ -4149,8 +4150,8 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
41494150
amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_CE);
41504151

41514152
if (!amdgpu_sriov_vf(adev)) {
4152-
err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw,
4153-
"amdgpu/%s_rlc.bin", ucode_prefix);
4153+
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", ucode_prefix);
4154+
err = request_firmware(&adev->gfx.rlc_fw, fw_name, adev->dev);
41544155
if (err)
41554156
goto out;
41564157

drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,16 @@ static void sdma_v5_2_ring_set_wptr(struct amdgpu_ring *ring)
176176
DRM_DEBUG("calling WDOORBELL64(0x%08x, 0x%016llx)\n",
177177
ring->doorbell_index, ring->wptr << 2);
178178
WDOORBELL64(ring->doorbell_index, ring->wptr << 2);
179-
/* SDMA seems to miss doorbells sometimes when powergating kicks in.
180-
* Updating the wptr directly will wake it. This is only safe because
181-
* we disallow gfxoff in begin_use() and then allow it again in end_use().
182-
*/
183-
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR),
184-
lower_32_bits(ring->wptr << 2));
185-
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI),
186-
upper_32_bits(ring->wptr << 2));
179+
if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) == IP_VERSION(5, 2, 1)) {
180+
/* SDMA seems to miss doorbells sometimes when powergating kicks in.
181+
* Updating the wptr directly will wake it. This is only safe because
182+
* we disallow gfxoff in begin_use() and then allow it again in end_use().
183+
*/
184+
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR),
185+
lower_32_bits(ring->wptr << 2));
186+
WREG32(sdma_v5_2_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI),
187+
upper_32_bits(ring->wptr << 2));
188+
}
187189
} else {
188190
DRM_DEBUG("Not using doorbell -- "
189191
"mmSDMA%i_GFX_RB_WPTR == 0x%08x "

0 commit comments

Comments
 (0)