Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wframe-larger-than in drivers/gpu/drm/selftests/test-drm_plane_helper.c #1600

Closed
nathanchance opened this issue Feb 18, 2022 · 5 comments
Closed
Assignees
Labels
-Wframe-larger-than= [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

Initially reported by the kernel test robot: https://lore.kernel.org/r/202112211210.kJg5QWU6-lkp@intel.com/

On at least ARCH=hexagon allmodconfig but likely other 32-bit architectures:

drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: error: stack frame size (1136) exceeds limit (1024) in 'igt_check_plane_state' [-Werror,-Wframe-larger-than]
int igt_check_plane_state(void *ignored)
    ^
1 error generated.

Introduced by https://cgit.freedesktop.org/drm/drm-misc/commit/?id=943e6a8beeac1b676265f2dd81a69d7bede5e41d; all of the structures in this function are on the stack.

@nathanchance nathanchance added -Wframe-larger-than= [BUG] linux-next This is an issue only seen in linux-next labels Feb 18, 2022
@nickdesaulniers
Copy link
Member

I wonder if these could be made function static?

@nathanchance
Copy link
Member Author

I think so? It appears that igt_check_plane_state() is only called once, so there should be no problem with static storage.

diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
index ceebeede55ea..b61273e9c403 100644
--- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
@@ -77,7 +77,7 @@ int igt_check_plane_state(void *ignored)
 {
        int ret;

-       const struct drm_crtc_state crtc_state = {
+       static const struct drm_crtc_state crtc_state = {
                .crtc = ZERO_SIZE_PTR,
                .enable = true,
                .active = true,
@@ -87,14 +87,14 @@ int igt_check_plane_state(void *ignored)
                                DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC)
                },
        };
-       struct drm_plane plane = {
+       static struct drm_plane plane = {
                .dev = NULL
        };
-       struct drm_framebuffer fb = {
+       static struct drm_framebuffer fb = {
                .width = 2048,
                .height = 2048
        };
-       struct drm_plane_state plane_state = {
+       static struct drm_plane_state plane_state = {
                .plane = &plane,
                .crtc = ZERO_SIZE_PTR,
                .fb = &fb,

@nathanchance
Copy link
Member Author

@nathanchance nathanchance self-assigned this Mar 3, 2022
@nathanchance nathanchance added the [PATCH] Submitted A patch has been submitted for review label Mar 3, 2022
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Mar 21, 2022
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] 5.18 This bug was fixed in Linux 5.18 [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Accepted A submitted patch has been accepted upstream [FIXED][LINUX] 5.18 This bug was fixed in Linux 5.18 labels Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wframe-larger-than= [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

2 participants