]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu/acpi: Reduce amdgpu_acpi_detect stack usage
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Fri, 5 Dec 2025 11:18:50 +0000 (16:48 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Dec 2025 22:32:39 +0000 (17:32 -0500)
commit495b190480dc78ad2dd10f8b96dfb5747fa48c4d
treef3bf975ca69572ca8bf874924c15592744390848
parent35bb80e6832920b5d22554a54601d392208fe019
drm/amdgpu/acpi: Reduce amdgpu_acpi_detect stack usage

amdgpu_acpi_detect() calls some helper functions it calls have large
local structures.  When the compiler inlines these helpers, their local
data adds to the amdgpu_acpi_detect() stack frame.

Mark the helpers with noinline_for_stack:
- amdgpu_atif_verify_interface()
- amdgpu_atif_get_notification_params()
- amdgpu_atif_query_backlight_caps()
- amdgpu_atcs_verify_interface()
- amdgpu_acpi_enumerate_xcc()

This keeps the large temporary objects inside the helper’s own stack
frame instead of being inlined into the caller, preventing the caller
from growing beyond the stack limit.

Fixes the below with gcc W=1:
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c:1403:6: warning: stack frame size (1688) exceeds limit (1024) in 'amdgpu_acpi_detect' [-Wframe-larger-than]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c