diff options
| author | Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> | 2025-12-05 15:15:10 +0300 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2025-12-11 01:37:50 +0300 |
| commit | 6ef93f62533e4176f0aa94d125d742b778cee07e (patch) | |
| tree | f525e43ab4436cd66c8e365308efbc686328ee97 /include/linux/start_kernel.h | |
| parent | 5b57c3c3f22336e8fd5edb7f0fef3c7823f8eac1 (diff) | |
| download | linux-6ef93f62533e4176f0aa94d125d742b778cee07e.tar.xz | |
drm/amd/ras: Reduce stack usage in amdgpu_virt_ras_get_cper_records()
amdgpu_virt_ras_get_cper_records() was using a large stack array
of ras_log_info pointers. This contributed to the frame size
warning on this function.
Replace the fixed-size stack array:
struct ras_log_info *trace[MAX_RECORD_PER_BATCH];
with a heap-allocated array using kcalloc().
We free the trace buffer together with out_buf on all exit paths.
If allocation of trace or out_buf fails, we return a generic RAS
error code.
This reduces stack usage and keeps the runtime behaviour
unchanged.
Fixes:
stack frame size: 1112 bytes (limit: 1024)
Cc: Tao Zhou <tao.zhou1@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/linux/start_kernel.h')
0 files changed, 0 insertions, 0 deletions
