Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp824024rwb; Mon, 26 Sep 2022 06:22:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM43nTBTccq7aL3vO5D+sk48iAXtSBjsH5HtCE2iwIFWsxA4vMy+uEkltYrRHSWg0Ly9kvjW X-Received: by 2002:a17:906:fd86:b0:777:d739:1ede with SMTP id xa6-20020a170906fd8600b00777d7391edemr17119943ejb.576.1664198553839; Mon, 26 Sep 2022 06:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198553; cv=none; d=google.com; s=arc-20160816; b=gKUeIFLLtGjyDB/LvCYDFhn1mOUZbPSJGRzeiU3rN8OLizk5U4A+BSLmo6amlcehjL JvgffpeV8fnunWkVnnFPnTBaOg+2esAbXfZXW7NeciyjBJikQWr/xZiFR/U73JsYqdW5 lFXg53oQHXBvV5bNc3KgtN8HK+E1nxZIPbTVqPNiMzLsC2cb/hU0m5M0jCBkfiIkd1ei 1aFLGG5OB9kf+kbmB5iBW9/5GkoA0AwmcE7a98xiM8YQFJOZNLbU75FpfzgVKVI90h6M bgq3rkvSbAuXZSvL0A9Gh83zWjJn1PTgeEon5AK51K0Amzzw5jstvwUx9RHjKOqzvjqg 8gwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9Vh4ffnQGnPoqVvvvruqGKLi5UC5MK4Xl1Hl46PXozs=; b=PYp+fkp29tLFbKJIlbACctJtE7fGkH+NnHgtjl8klWEkqA1Vpu6+r9aIgnT4n2Vkyk Cu9y0JuoONX6TcQMWdmv5IdAI10vg4F1eVWa5hoFrfw5b94KzsreWhE+rm5eeEBcOHhm MerMVQKXG2B188AShl6TBmfXP7zR7Pr47wJgxldNFYn1Wc6v2BHQrEJ4U4fMVxnByF9a VUC9PzJ2Ta54didyRXOo1xvLYqLqRQtLiY1/Lap6BTpXfd98BFp03lavrlB209Dixlj2 JlULiZdfMypfZa2pCLquR+DpQPVZVhETxJHxXgaW5ZjWt8rmZxPCn9gcF7MSkfCdzIxz UQSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ANSkJR0U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw30-20020a1709066a1e00b0072a7a1bd505si16063274ejc.207.2022.09.26.06.22.08; Mon, 26 Sep 2022 06:22:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ANSkJR0U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239074AbiIZL5o (ORCPT + 99 others); Mon, 26 Sep 2022 07:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239205AbiIZLyu (ORCPT ); Mon, 26 Sep 2022 07:54:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C10B785AB; Mon, 26 Sep 2022 03:50:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93F8E60B2F; Mon, 26 Sep 2022 10:50:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6851C433D6; Mon, 26 Sep 2022 10:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189425; bh=zcF7iAfpBljxrp6SL+VwuiFaA9Cu7r63gUi7FJYR51M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ANSkJR0UOe2QgAujfFVM5bbOkjSUpqRfDI7QxQ3GbDkjGzrHVsLVX6CLKQrK1HVHo TYCdR4TQmxjN0FaW9JtjS56jrT6x9VnHly4oWCEI4B03igwnmW7ZS/tSnbrRQK/Dt7 5ohEuuVOVzBHoD8bd7uW2c8pBEfEdAnzykBrvoS8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Sudip Mukherjee (Codethink)" , =?UTF-8?q?Ma=C3=ADra=20Canal?= , Rodrigo Siqueira , Nathan Chancellor , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 184/207] drm/amd/display: Mark dml30s UseMinimumDCFCLK() as noinline for stack usage Date: Mon, 26 Sep 2022 12:12:53 +0200 Message-Id: <20220926100814.842720755@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 41012d715d5d7b9751ae84b8fb255e404ac9c5d0 ] This function consumes a lot of stack space and it blows up the size of dml30_ModeSupportAndSystemConfigurationFull() with clang: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn30/display_mode_vba_30.c:3542:6: error: stack frame size (2200) exceeds limit (2048) in 'dml30_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than] void dml30_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib) ^ 1 error generated. Commit a0f7e7f759cf ("drm/amd/display: fix i386 frame size warning") aimed to address this for i386 but it did not help x86_64. To reduce the amount of stack space that dml30_ModeSupportAndSystemConfigurationFull() uses, mark UseMinimumDCFCLK() as noinline, using the _for_stack variant for documentation. While this will increase the total amount of stack usage between the two functions (1632 and 1304 bytes respectively), it will make sure both stay below the limit of 2048 bytes for these files. The aforementioned change does help reduce UseMinimumDCFCLK()'s stack usage so it should not be reverted in favor of this change. Link: https://github.com/ClangBuiltLinux/linux/issues/1681 Reported-by: "Sudip Mukherjee (Codethink)" Tested-by: MaĆ­ra Canal Reviewed-by: Rodrigo Siqueira Signed-off-by: Nathan Chancellor Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c index f47d82da115c..42a567e71439 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c @@ -6651,8 +6651,7 @@ static double CalculateUrgentLatency( return ret; } - -static void UseMinimumDCFCLK( +static noinline_for_stack void UseMinimumDCFCLK( struct display_mode_lib *mode_lib, int MaxInterDCNTileRepeaters, int MaxPrefetchMode, -- 2.35.1