aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
diff options
context:
space:
mode:
authorYiPeng Chai <[email protected]>2024-04-12 05:46:03 +0000
committerAlex Deucher <[email protected]>2024-07-16 15:44:30 +0000
commitb3fb79cda5688a44a423c27b791f5456d801e49c (patch)
tree5ed05d47902fd492df8a37d7806e8ae67ca60d93 /drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
parentdrm/amd/display: Add function banner for idle_workqueue (diff)
downloadkernel-b3fb79cda5688a44a423c27b791f5456d801e49c.tar.gz
kernel-b3fb79cda5688a44a423c27b791f5456d801e49c.zip
drm/amdgpu: add mutex to protect ras shared memory
Add mutex to protect ras shared memory. v2: Add TA_RAS_COMMAND__TRIGGER_ERROR command call status check. Signed-off-by: YiPeng Chai <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
index 8e8afbd237bc..0c856005df6b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
@@ -348,6 +348,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
context->session_id = ta_id;
+ mutex_lock(&psp->ras_context.mutex);
ret = prep_ta_mem_context(&context->mem_context, shared_buf, shared_buf_len);
if (ret)
goto err_free_shared_buf;
@@ -366,6 +367,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
ret = -EFAULT;
err_free_shared_buf:
+ mutex_unlock(&psp->ras_context.mutex);
kfree(shared_buf);
return ret;