Skip to content

Commit 779a0c9

Browse files
committed
accel/amdxdna: Fix incorrect PSP firmware size
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 <[email protected]> Signed-off-by: Lizhi Hou <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 19272b3 commit 779a0c9

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)