diff options
author | Kevin Wang <kevin1.wang@amd.com> | 2021-02-07 21:09:59 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-03-23 23:00:22 -0400 |
commit | 2fb3c5d0d16192c926dbad5363867b31c8b8b2f8 (patch) | |
tree | 9995d13aa42676a5e09f2557f77f8c802912a858 /drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c | |
parent | 250491665531f0c926c0dc542feccf3e6045de8a (diff) | |
download | lwn-2fb3c5d0d16192c926dbad5363867b31c8b8b2f8.tar.gz lwn-2fb3c5d0d16192c926dbad5363867b31c8b8b2f8.zip |
drm/amdgpu: change psp_rap_invoke() function return value
RAP TA is an optional firmware. if it doesn’t exist,
the driver should bypass psp_rap_invoke() function.
1. bypass psp_rap_invoke() when RAP TA is not loaded.
2. add new parameter (status) to query RAP TA status.
(the status value is different with psp_ta_invoke(),
3. fix the 'rap_status' MThread critical problem.
(used without lock)
Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c index 8da5356c36f1..51909bf8798c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c @@ -48,6 +48,7 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f, const char __user *buf, struct ta_rap_cmd_output_data *rap_cmd_output; struct drm_device *dev = adev_to_drm(adev); uint32_t op; + enum ta_rap_status status; int ret; if (*pos || size != 2) @@ -70,9 +71,8 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f, const char __user *buf, switch (op) { case 2: - ret = psp_rap_invoke(&adev->psp, op); - - if (ret == TA_RAP_STATUS__SUCCESS) { + ret = psp_rap_invoke(&adev->psp, op, &status); + if (!ret && status == TA_RAP_STATUS__SUCCESS) { dev_info(adev->dev, "RAP L0 validate test success.\n"); } else { rap_shared_mem = (struct ta_rap_shared_memory *) @@ -97,6 +97,7 @@ static ssize_t amdgpu_rap_debugfs_write(struct file *f, const char __user *buf, default: dev_info(adev->dev, "Unsupported op id: %d, ", op); dev_info(adev->dev, "Only support op 2(L0 validate test).\n"); + break; } amdgpu_gfx_off_ctrl(adev, true); |