* [PATCH] drm/amd/pm: Avoid more large frame warnings
@ 2025-06-10 21:21 Palmer Dabbelt
2025-06-11 5:00 ` Lazar, Lijo
0 siblings, 1 reply; 4+ messages in thread
From: Palmer Dabbelt @ 2025-06-10 21:21 UTC (permalink / raw)
To: alexander.deucher
Cc: kenneth.feng, christian.koenig, airlied, simona, asad.kamal,
lijo.lazar, Palmer Dabbelt, amd-gfx, dri-devel, linux-kernel
From: Palmer Dabbelt <palmer@dabbelt.com>
9KiB frames seem pretty big, but without this I'm getting some warnings
as of 6.16-rc1
CC [M] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.o
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c: In function 'smu_v13_0_6_get_gpu_metrics':
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:2885:1: error: the frame size of 8304 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
2885 | }
| ^
cc1: all warnings being treated as errors
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
index 51f1fa9789ab..9824b7f4827f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
@@ -23,9 +23,19 @@
# Makefile for the 'smu manager' sub-component of powerplay.
# It provides the smu management services for the driver.
+ifneq ($(CONFIG_FRAME_WARN),0)
+ frame_warn_limit := 9216
+ ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
+ frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
+ endif
+endif
+
SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o smu_v13_0_6_ppt.o smu_v13_0_12_ppt.o
AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))
AMD_POWERPLAY_FILES += $(AMD_SWSMU_SMU13MGR)
+
+CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_12_ppt.o := $(frame_warn_flag)
+CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_6_ppt.o := $(frame_warn_flag)
--
2.39.5 (Apple Git-154)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/pm: Avoid more large frame warnings
2025-06-10 21:21 [PATCH] drm/amd/pm: Avoid more large frame warnings Palmer Dabbelt
@ 2025-06-11 5:00 ` Lazar, Lijo
2025-06-12 12:29 ` Lazar, Lijo
0 siblings, 1 reply; 4+ messages in thread
From: Lazar, Lijo @ 2025-06-11 5:00 UTC (permalink / raw)
To: Palmer Dabbelt, alexander.deucher
Cc: kenneth.feng, christian.koenig, airlied, simona, asad.kamal,
amd-gfx, dri-devel, linux-kernel
On 6/11/2025 2:51 AM, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmer@dabbelt.com>
>
> 9KiB frames seem pretty big, but without this I'm getting some warnings
> as of 6.16-rc1
>
> CC [M] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.o
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c: In function 'smu_v13_0_6_get_gpu_metrics':
> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:2885:1: error: the frame size of 8304 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
> 2885 | }
> | ^
> cc1: all warnings being treated as errors
>
Could you also provide your build environment details?
With below in Makefile + gcc 11.4.0, stack frame size is 168 bytes.
ccflags-y += -fstack-usage
smu_v13_0_6_ppt.c:2667:16:smu_v13_0_6_get_gpu_metrics 168 static
Thanks,
Lijo
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
> index 51f1fa9789ab..9824b7f4827f 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
> @@ -23,9 +23,19 @@
> # Makefile for the 'smu manager' sub-component of powerplay.
> # It provides the smu management services for the driver.
>
> +ifneq ($(CONFIG_FRAME_WARN),0)
> + frame_warn_limit := 9216
> + ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
> + frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
> + endif
> +endif
> +
> SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
> smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o smu_v13_0_6_ppt.o smu_v13_0_12_ppt.o
>
> AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))
>
> AMD_POWERPLAY_FILES += $(AMD_SWSMU_SMU13MGR)
> +
> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_12_ppt.o := $(frame_warn_flag)
> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_6_ppt.o := $(frame_warn_flag)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/pm: Avoid more large frame warnings
2025-06-11 5:00 ` Lazar, Lijo
@ 2025-06-12 12:29 ` Lazar, Lijo
2025-06-12 21:10 ` Palmer Dabbelt
0 siblings, 1 reply; 4+ messages in thread
From: Lazar, Lijo @ 2025-06-12 12:29 UTC (permalink / raw)
To: Palmer Dabbelt, alexander.deucher
Cc: kenneth.feng, christian.koenig, airlied, simona, asad.kamal,
amd-gfx, dri-devel, linux-kernel
On 6/11/2025 10:30 AM, Lazar, Lijo wrote:
>
>
> On 6/11/2025 2:51 AM, Palmer Dabbelt wrote:
>> From: Palmer Dabbelt <palmer@dabbelt.com>
>>
>> 9KiB frames seem pretty big, but without this I'm getting some warnings
>> as of 6.16-rc1
>>
>> CC [M] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.o
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c: In function 'smu_v13_0_6_get_gpu_metrics':
>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:2885:1: error: the frame size of 8304 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>> 2885 | }
>> | ^
>> cc1: all warnings being treated as errors
>>
>
> Could you also provide your build environment details?
>
> With below in Makefile + gcc 11.4.0, stack frame size is 168 bytes.
>
> ccflags-y += -fstack-usage
>
> smu_v13_0_6_ppt.c:2667:16:smu_v13_0_6_get_gpu_metrics 168 static
>
> Thanks,
> Lijo
>
Was able to see this issue in one of our systems. This patch fixed that
- https://patchwork.freedesktop.org/patch/658216/
Please try and let me know if it works for your config.
Thanks,
Lijo
>> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
>> ---
>> drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>> index 51f1fa9789ab..9824b7f4827f 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>> @@ -23,9 +23,19 @@
>> # Makefile for the 'smu manager' sub-component of powerplay.
>> # It provides the smu management services for the driver.
>>
>> +ifneq ($(CONFIG_FRAME_WARN),0)
>> + frame_warn_limit := 9216
>> + ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
>> + frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
>> + endif
>> +endif
>> +
>> SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
>> smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o smu_v13_0_6_ppt.o smu_v13_0_12_ppt.o
>>
>> AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))
>>
>> AMD_POWERPLAY_FILES += $(AMD_SWSMU_SMU13MGR)
>> +
>> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_12_ppt.o := $(frame_warn_flag)
>> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_6_ppt.o := $(frame_warn_flag)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/pm: Avoid more large frame warnings
2025-06-12 12:29 ` Lazar, Lijo
@ 2025-06-12 21:10 ` Palmer Dabbelt
0 siblings, 0 replies; 4+ messages in thread
From: Palmer Dabbelt @ 2025-06-12 21:10 UTC (permalink / raw)
To: lijo.lazar
Cc: alexander.deucher, kenneth.feng, christian.koenig, airlied,
simona, asad.kamal, amd-gfx, dri-devel, linux-kernel
On Thu, 12 Jun 2025 05:29:55 PDT (-0700), lijo.lazar@amd.com wrote:
>
>
> On 6/11/2025 10:30 AM, Lazar, Lijo wrote:
>>
>>
>> On 6/11/2025 2:51 AM, Palmer Dabbelt wrote:
>>> From: Palmer Dabbelt <palmer@dabbelt.com>
>>>
>>> 9KiB frames seem pretty big, but without this I'm getting some warnings
>>> as of 6.16-rc1
>>>
>>> CC [M] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.o
>>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c: In function 'smu_v13_0_6_get_gpu_metrics':
>>> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:2885:1: error: the frame size of 8304 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
>>> 2885 | }
>>> | ^
>>> cc1: all warnings being treated as errors
>>>
>>
>> Could you also provide your build environment details?
>>
>> With below in Makefile + gcc 11.4.0, stack frame size is 168 bytes.
I'm on GCC 12 on RISC-V (though looks like it showed up somewhere else,
too).
>>
>> ccflags-y += -fstack-usage
>>
>> smu_v13_0_6_ppt.c:2667:16:smu_v13_0_6_get_gpu_metrics 168 static
>>
>> Thanks,
>> Lijo
>>
>
> Was able to see this issue in one of our systems. This patch fixed that
> - https://patchwork.freedesktop.org/patch/658216/
>
> Please try and let me know if it works for your config.
Thanks, I just threw it at the tester. I'll go post a Reviewed-by at
https://lore.kernel.org/all/20250612122321.801690-1-lijo.lazar@amd.com/
if it works...
>
> Thanks,
> Lijo
>
>>> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
>>> ---
>>> drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile | 10 ++++++++++
>>> 1 file changed, 10 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>>> index 51f1fa9789ab..9824b7f4827f 100644
>>> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>>> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/Makefile
>>> @@ -23,9 +23,19 @@
>>> # Makefile for the 'smu manager' sub-component of powerplay.
>>> # It provides the smu management services for the driver.
>>>
>>> +ifneq ($(CONFIG_FRAME_WARN),0)
>>> + frame_warn_limit := 9216
>>> + ifeq ($(call test-lt, $(CONFIG_FRAME_WARN), $(frame_warn_limit)),y)
>>> + frame_warn_flag := -Wframe-larger-than=$(frame_warn_limit)
>>> + endif
>>> +endif
>>> +
>>> SMU13_MGR = smu_v13_0.o aldebaran_ppt.o yellow_carp_ppt.o smu_v13_0_0_ppt.o smu_v13_0_4_ppt.o \
>>> smu_v13_0_5_ppt.o smu_v13_0_7_ppt.o smu_v13_0_6_ppt.o smu_v13_0_12_ppt.o
>>>
>>> AMD_SWSMU_SMU13MGR = $(addprefix $(AMD_SWSMU_PATH)/smu13/,$(SMU13_MGR))
>>>
>>> AMD_POWERPLAY_FILES += $(AMD_SWSMU_SMU13MGR)
>>> +
>>> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_12_ppt.o := $(frame_warn_flag)
>>> +CFLAGS_$(AMD_SWSMU_PATH)/smu13/smu_v13_0_6_ppt.o := $(frame_warn_flag)
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-12 21:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 21:21 [PATCH] drm/amd/pm: Avoid more large frame warnings Palmer Dabbelt
2025-06-11 5:00 ` Lazar, Lijo
2025-06-12 12:29 ` Lazar, Lijo
2025-06-12 21:10 ` Palmer Dabbelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®