Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4054331rdb; Mon, 11 Dec 2023 07:40:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlAs0+dpDAHE58chfsNG9itLR48cU+t3+PNKsvcHWWcZs7OdjujiDMRxbI91YVZwdpJ21r X-Received: by 2002:a17:902:f549:b0:1d0:708c:d04b with SMTP id h9-20020a170902f54900b001d0708cd04bmr5712973plf.31.1702309240335; Mon, 11 Dec 2023 07:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702309240; cv=none; d=google.com; s=arc-20160816; b=WAdMV4F156bAIgmbJlJ4BnNnYFS2SlBNe0r6AwRKcc7VIq+HaUmtDvoGGevKv3EBnZ xi01Q3VZoT36jIZYr0vjlGzy4eZPKTAy1bgrkS+0WAM3bNLYap47ah8i98h57MzUrI1n pSOb1z0S5rVPGp0xVbN0FL8XSw4WybC1X6ri+vXsJaSO+8Wb69dbEmdmenib1KdxlQRL A1wLExGYtFWlTcqXZBsx8l/C7Jvf9TOrX7hYPMpTEMmhk/1WMUfD6mAjgfIPP+sBvmR6 JdYuC5YEoUwuvCU4vnFJz/e3GYYqs2SyFTbbuznxhCVh6Lgi2NT/9NelTFqoy5Bv1ktl mSew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=olWTkTTTDMqyGniJrt96EJYeNEaxv5XjfscB27aHKBI=; fh=yuZfuqfLXYCoGi5Nct1W+64PCai1i9xDwM3Lu/hwzLk=; b=QthEmvyeBg0UU7l+AkPc9Nft3B1hKroCEFAfuqtQDTxdM6pAaN8c7RLGluGrX9onwy UsED+Ypb6lPMdwPkAFdkm0ilu1rPWONyuDrnEcE4c36iCSyFcEgurAjNfcsDURBLcExR q0ShxnXtSS9IzJxHP5YMVOmHyTqef8n96/4PSSt5Mo6vwHfercldGmRptfddQY8/t3FB UJR5V1ybpb6Afs54kFdHFr8yg5eDjoGH1nd+5sECDSrYmGoNP2r4uLxAl+xgpb3icIgM nBiuw8vUUmfq/UJSq+cmWvqRzZipU126nPCAx1zZsi0oxhC7tjscXztsg1JJs8M13s6I 7LsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=l1h4D7tQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 199-20020a6301d0000000b0057745d87b53si6116440pgb.686.2023.12.11.07.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 07:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=l1h4D7tQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5BCDF80755FE; Mon, 11 Dec 2023 07:40:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344160AbjLKPk3 (ORCPT + 99 others); Mon, 11 Dec 2023 10:40:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344158AbjLKPk2 (ORCPT ); Mon, 11 Dec 2023 10:40:28 -0500 Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com [IPv6:2607:f8b0:4864:20::c34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 781BEA1 for ; Mon, 11 Dec 2023 07:40:34 -0800 (PST) Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-59064bca27dso2656010eaf.0 for ; Mon, 11 Dec 2023 07:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1702309234; x=1702914034; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=olWTkTTTDMqyGniJrt96EJYeNEaxv5XjfscB27aHKBI=; b=l1h4D7tQLoemGqj5pyxq18qsiBWZea/dcy51BbWT1G3LW1M4kXlISt8XXn45rV7F97 d6562tTg31ZvhWNpRqPocCj3hc30LaTk/ULYn9kJVFXS6sbdBvPSj+oJ8UawyO/vgFxT qayGnl6sEQUxEB+SlA9uK4CNOw2S5y2lFnhXJB9kCCzKrBK/qMJopKn0ZR0cXMV86y6J rfq06+88Oi+Z5oi+5qLCaesNMYtj4bihYv3t01DJc2njXVTTZEAQ7WkPJA1teT30ssPs LRiTaQn09Q+y3uEB/KYra+BFJ7PLA7mK/VbKQzBOOgmUTpt72NAfQBpUIGDTWUL6lI2A t2mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702309234; x=1702914034; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=olWTkTTTDMqyGniJrt96EJYeNEaxv5XjfscB27aHKBI=; b=VzO5Y1ULRgLOxTmt4C5QIaRxoioTg1zXy740pOOGa3b0g3sfeTHaBWKlRsUE8ejE07 5dTSjhnJhKVR/vlcrUpVBvFf8wvebillx5xJMpOVvAI4ImYOgMK9KDna3B9C51WM+Jtg 6Vize2oGRTzqjABcFbIM/p5qe8AS3+Maq783L6CIWP6mTHmNTlyxj3EAyeMFCldoLRgM ATcmQlmPN2dK8gbAQGkAw8hBxMOTk4lHu1QQy3xCsPr76SodIn4lDtL5cSWs4NVXX+8F SHGwVBAIPpA4WrNrnX3qv+sGqlmFH/PPGopuD1rGxef5AqhhdeBgLJGPJ/S1KoVlxTxH maqA== X-Gm-Message-State: AOJu0Yzlb8j2dpp3PWr9HU9xC9He28csRzNO4mLYLAVj6qdq3xT+jNmy 0s0/y+kVw3I/Qv6JAfd7cS/vJw== X-Received: by 2002:a05:6358:9209:b0:170:1d30:56e0 with SMTP id d9-20020a056358920900b001701d3056e0mr5134113rwb.30.1702309233725; Mon, 11 Dec 2023 07:40:33 -0800 (PST) Received: from ?IPV6:2600:1700:2000:b002:f8a3:26ec:ac85:392e? ([2600:1700:2000:b002:f8a3:26ec:ac85:392e]) by smtp.gmail.com with ESMTPSA id s6-20020a0cf646000000b0067ec9faed23sm1463005qvm.142.2023.12.11.07.40.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Dec 2023 07:40:33 -0800 (PST) Message-ID: Date: Mon, 11 Dec 2023 09:40:32 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V Content-Language: en-US To: Alex Deucher Cc: Arnd Bergmann , Nathan Chancellor , "Conor.Dooley" , llvm@lists.linux.dev, Leo Li , Pan Xinhui , Rodrigo Siqueira , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Palmer Dabbelt , amd-gfx@lists.freedesktop.org, Alex Deucher , linux-riscv@lists.infradead.org, =?UTF-8?Q?Christian_K=C3=B6nig?= References: <20231122030621.3759313-1-samuel.holland@sifive.com> <20231122030621.3759313-4-samuel.holland@sifive.com> <20231123-headdress-mold-0dd7a74477f7@wendy> <20231130004224.GE2513828@dev-arch.thelio-3990X> <4f277982-fffb-4fe1-bc02-007633400f31@sifive.com> <5090a015-5b6f-44be-bb25-d2ca3fdf5d40@app.fastmail.com> <07d27191-12b6-4c84-b80e-75c618df9de4@sifive.com> From: Samuel Holland In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_XBL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 11 Dec 2023 07:40:39 -0800 (PST) Hi Alex, On 2023-12-11 9:17 AM, Alex Deucher wrote: > On Sun, Dec 10, 2023 at 5:10 AM Samuel Holland > wrote: >> >> Hi Arnd, >> >> On 2023-12-09 2:38 PM, Arnd Bergmann wrote: >>> On Fri, Dec 8, 2023, at 06:04, Samuel Holland wrote: >>>> On 2023-11-29 6:42 PM, Nathan Chancellor wrote: >>>>> On Thu, Nov 23, 2023 at 02:23:01PM +0000, Conor Dooley wrote: >>>>>> On Tue, Nov 21, 2023 at 07:05:15PM -0800, Samuel Holland wrote: >>>>>>> RISC-V uses kernel_fpu_begin()/kernel_fpu_end() like several other >>>>>>> architectures. Enabling hardware FP requires overriding the ISA string >>>>>>> for the relevant compilation units. >>>>>> >>>>>> Ah yes, bringing the joy of frame-larger-than warnings to RISC-V: >>>>>> ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:58:13: warning: stack frame size (2416) exceeds limit (2048) in 'DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanceCalculation' [-Wframe-larger-than] >>>>> >>>>> :( >>>>> >>>>>> Nathan, have you given up on these being sorted out? >>>>> >>>>> Does your configuration have KASAN (I don't think RISC-V supports >>>>> KCSAN)? It is possible that dml/dcn32 needs something similar to commit >>>>> 6740ec97bcdb ("drm/amd/display: Increase frame warning limit with KASAN >>>>> or KCSAN in dml2")? >>>>> >>>>> I am not really interested in playing whack-a-mole with these warnings >>>>> like I have done in the past for the reasons I outlined here: >>>>> >>>>> https://lore.kernel.org/20231019205117.GA839902@dev-arch.thelio-3990X/ >>>> >>>> I also see one of these with clang 17 even with KASAN disabled: >>>> >>>> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_32.c:37:6: >>>> warning: stack frame size (2208) exceeds limit (2048) in 'dml32_recalculate' >>>> [-Wframe-larger-than] >>>> void dml32_recalculate(struct display_mode_lib *mode_lib) >>>> >>>> ^ >>>> 1532/2208 (69.38%) spills, 676/2208 (30.62%) variables >>>> >>>> So I'm in favor of just raising the limit for these files for clang, like you >>>> suggested in the linked thread. >>> >>> How about just adding a BUG_ON(IS_ENABLED(CONFIG_RISCV)) >>> in that function? That should also avoid the build failure >>> but give a better indication of where the problem is >>> if someone actually runs into that function and triggers >>> a runtime stack overflow. >> >> Won't that break actual users of the driver, trading an unlikely but >> theoretically possible stack overflow for a guaranteed crash? The intent of this >> series is that I have one of these GPUs plugged in to a RISC-V board, and I want >> to use it. > > Does this patch address the issue? > https://gitlab.freedesktop.org/agd5f/linux/-/commit/72ada8603e36291ad91e4f40f10ef742ef79bc4e No, I get the warning without any of these debugging options enabled. I can reproduce with just defconfig + CONFIG_DRM_AMDGPU=m when built with clang 17. Regards, Samuel