Skip to content

Commit 5af2c86

Browse files
houlz0507smb49
authored andcommitted
accel/amdxdna: Fix incorrect PSP firmware size
BugLink: https://bugs.launchpad.net/bugs/2119603 [ Upstream commit 779a0c9 ] The incorrect PSP firmware size is used for initializing. It may cause error for newer version firmware. Fixes: 8c9ff1b ("accel/amdxdna: Add a new driver for AMD AI Engine") Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://lore.kernel.org/r/20250604143217.1386272-1-lizhi.hou@amd.com Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 0f76854 commit 5af2c86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/accel/amdxdna/aie2_psp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ struct psp_device *aie2m_psp_create(struct drm_device *ddev, struct psp_config *
126126
psp->ddev = ddev;
127127
memcpy(psp->psp_regs, conf->psp_regs, sizeof(psp->psp_regs));
128128

129-
psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN) + PSP_FW_ALIGN;
130-
psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz, GFP_KERNEL);
129+
psp->fw_buf_sz = ALIGN(conf->fw_size, PSP_FW_ALIGN);
130+
psp->fw_buffer = drmm_kmalloc(ddev, psp->fw_buf_sz + PSP_FW_ALIGN, GFP_KERNEL);
131131
if (!psp->fw_buffer) {
132132
drm_err(ddev, "no memory for fw buffer");
133133
return NULL;

0 commit comments

Comments
 (0)