From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 342CCFCC9C8 for ; Tue, 10 Mar 2026 05:54:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 719AF10E651; Tue, 10 Mar 2026 05:54:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=wbinvd.org header.i=@wbinvd.org header.b="Na5xSi4+"; dkim-atps=neutral Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B70C10E652 for ; Tue, 10 Mar 2026 05:54:36 +0000 (UTC) Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-128d2e3082eso1181684c88.0 for ; Mon, 09 Mar 2026 22:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1773122075; x=1773726875; darn=lists.freedesktop.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AZrje2kJSd9Bh+vOqAe83fHEY512zOk+rc8eCAn6ioA=; b=Na5xSi4+kfDDOwlfSI3/D0wQPOuCZws8RWg9iJpxp7FLoTHZskMHTebsa4VgH0rfa6 Rc2YwODn3RmRWh1A+vPcXfvG6z/ES9URMpev4sL1deFiO4QBZcL1IcWhu8MilrxD841R a6RmjoCPWQpPWAdE9OkQnp/swyvKsrf7rRn1KKB427p7WMGxYZG2A0rVSBZNVVAXRm72 goQI76GkG3EA6q1F530qnvUG32Ab+knvx1SczsoFhr3tFY+J3wuw0hYXof5BHlySHgdj FvBnh1TQGopSUCNz0GfqioB+EdN9UeHXh9Yj/aJZnoAGas5zNZ70BGVJMotDB/6bgeYw DxwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773122075; x=1773726875; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AZrje2kJSd9Bh+vOqAe83fHEY512zOk+rc8eCAn6ioA=; b=BSy3+p0ZPxd39cDzs3e8ZUDiEpR6V/EssSxll848RvJlK7ST6zPOGMjKItA7Hu/2ms zvfeK23u3rAbqCgTud/viHvRMR2B42EqCxoNPQfp1Zsh9ydmn4JYKh9MLyaWJf9cIgbV XV7tP/BastnutoBFLTaoLmXmcrGl6lGgtUTGaDGOFo4qdxN/pyDxdIVLsLF1XFioJIu6 l4lKcSOFzzUkWRWOLjJCYQ+Jc7rjsSuG2JPvL4wvfxtAafJxQEgoyjK7/4hqPtzP8WVy mHJF2J4I0m4rKdmStEpoJa8XH/NSIz1NcL7RoDbY+cuSuY6epX0moXKn7aCA2h4aJ8ba egVg== X-Gm-Message-State: AOJu0Yzr9N+lLlO0qyaA0WFonXDbcyFwxS+SZMD/BrGKmVuWdzfTZcYd UdcXxbdhFf8NBnNbZaeHChhCXsC6AkFT66C1Gg5Yk0mUDSb9B66q8kU9V7e91cAPoIs= X-Gm-Gg: ATEYQzxVbTwf0c0Bza/aVNh14rdddNo8Q4Lo6hsh+QNVSCD9IN5mox9kGTyDO2F6iRy uP9+U3kmLeSmM8VBkPHnX0gJMojg4LXXlLiJzAdy3ANODCqyNWRQTllEeMHy4chZ0d73vl749MQ /boH9wHUEQslvnBp2tsxUVF2laUmofgvVLKpY9bc4cvnfzwrzZvD3VEdhlLZX2v6PQywizULuhO LZZagT0MLOOmnQZmalOFHC7cNvbsbl/5ZvS0Ue6nYBCjA+ZDiyZDfRKI4ZkanJajfyIz6N9O/rz 1Ay8728RLrt6EQYvCAItXyVbU1apWMSyiuYIxxBZt9nmXA0RF179NJq1MnURmLAWQOk6WnPFzfR a8mMSUMvZnsodf7wE+8PQIPZ0ASdCp8C7j6yaTih3o31Eo0sM92r+qZJ84/1+NbHJOHRxtYtXkw Ld4pDrV9up4vOw7ajd2ynxCQZV X-Received: by 2002:a05:7022:23a9:b0:11a:49bd:be28 with SMTP id a92af1059eb24-128c2d8ff9fmr6043992c88.4.1773122075270; Mon, 09 Mar 2026 22:54:35 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:d3b:fdd6:c26e:df86]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-128d989cd36sm7603986c88.1.2026.03.09.22.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 22:54:34 -0700 (PDT) Date: Mon, 9 Mar 2026 22:54:32 -0700 From: Calvin Owens To: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Charlene Liu , Ovidiu Bunea , Alex Hung , Dan Wheeler , Alex Deucher , Harry Wentland , Leo Li , Rodrigo Siqueira , Christian Koenig , David Airlie , Simona Vetter , llvm@lists.linux.dev Subject: Re: [REGRESSION][PATCH] drm/amd/display: Fix uninitialized variable which breaks full LTO Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Monday 03/09 at 21:24 -0700, Calvin Owens wrote: > Commit e1b385726f7f ("drm/amd/display: Add additional checks for PSP > footer size") introduced a use of an uninitialized stack variable > in dm_dmub_sw_init() (region_params.bss_data_size). > > Interestingly, this seems to cause no issue on normal kernels. But when > full LTO is enabled, it causes the compiler to "optimize" out huge > swaths of amdgpu initialization code, and the driver is unusable: > > amdgpu 0000:03:00.0: [drm] Loading DMUB firmware via PSP: version=0x07002F00 > amdgpu 0000:03:00.0: sw_init of IP block failed 5 > amdgpu 0000:03:00.0: amdgpu_device_ip_init failed > amdgpu 0000:03:00.0: Fatal error during GPU init In case anybody wants to poke around, I uploaded the binaries here: https://github.com/jcalvinowens/lkml-debug/releases/tag/000001 You can see in the diff of the disassembly that the "missing" piece of dm_sw_init() reappeared after reverting e1b38572: https://github.com/jcalvinowens/lkml-debug/blob/main/amdgpu-lto/not-working-to-working.diff This is my bisect log: bad: [1f318b96cc84d7c2ab792fcc0bfd42a7ca890681] Linux 7.0-rc3 good: [05f7e89ab9731565d8a62e3b5d1ec206485eeb0b] Linux 6.19 bad: [1c2b4a4c2bcb950f182eeeb33d94b565607608cf] Merge tag 'pci-v7.0-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci good: [6589b3d76db2d6adbf8f2084c303fb24252a0dc6] Merge tag 'soc-dt-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc bad: [a60f627cf4ab474aebf15f62c55eadabab9780da] Merge tag 'amd-drm-next-6.20-2026-01-30' of https://gitlab.freedesktop.org/agd5f/linux into drm-next good: [83675851547e835c15252c601f41acf269c351d9] drm/xe: Cleanup unused header includes bad: [71573db5ad74b2087a4688cd1dda73ff082620f6] drm/amd/display: switch to drm_dbg_ macros instead of DRM_DEBUG_ variants bad: [3235a5b72317be613b69e22c3b2c9f2bec546253] drm/amdgpu: Update MES VM_CNTX_CNTL for XNACK off for GFX 12.1 bad: [e1b73b64271d706079370b58b81292dafd373163] amdkfd: remove DIQ support good: [2634ef1b8c00207dde5101e926241957aa5652b8] drm/amdkfd: Fix PTE clearing during SVM unmap on GFX 12.1 bad: [af441be8b75deb93ded51c54b9a2ba1e048b1c91] drm/amdgpu: add support for sdma v7_1 good: [69249b477b95f91e56bb19ec53707253899458c4] drm/amd/display: Move dml2_validate to the non-FPU dml2_wrapper bad: [ec62b7ded978957ec74add4c1feccc986e2baeef] drm/amdkfd: Uninitialized and Unused variables good: [c7062be3380cb20c8b1c4a935a13f1848ead0719] drm/amd/display: Correct DSC padding accounting bad: [d28e92093ceffb424b9b0e36bbd391c83b1cfe78] drm/amd/display: [FW Promotion] Release 0.1.37.0 bad: [e1b385726f7f7fc75b6cd3c2216430de8a625a2d] drm/amd/display: Add additional checks for PSP footer size first bad commit: [e1b385726f7f7fc75b6cd3c2216430de8a625a2d] drm/amd/display: Add additional checks for PSP footer size Thanks, Calvin