From nobody Thu Apr 9 08:11:01 2026 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72BB82E06ED for ; Tue, 10 Mar 2026 04:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773116710; cv=none; b=imFr4HK1jxEGpL0hqSU3uQgkzKM/uFA8iEg8BuVCqm9cYk4qJwj/y2RmzH8V8B2ZwHkkMHPo4xSIml5AHhLn3DDbNHTY394k6PpZ+7kMncXLUiEDuBdLx+tVoXt9SXTMfsQv0y0EQkFS8Zk/J47FhH5zXPdLtBdo81lK2BDeE0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773116710; c=relaxed/simple; bh=UToTWkADz2konqxXLNRFKBpRT8+jAoOYOmICiB35LYY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TgWoTZxOC0DkIut1bhTVgkXusuCfRcTRj61zMSlhqKd+FI40BQb8Z2UfLPy5Vjd6byO7fUaL9r1dku7fIfXX4BUL4EnesJ/ZklvdBTpPsEFkD1WU7J62IHioN7CXRigV5LVO45Xm3UiuczYVw2pkUhOC4kZsglWUXdFx1cRCZyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=fJ+NUFu0; arc=none smtp.client-ip=74.125.82.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="fJ+NUFu0" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-12776bebe9fso414626c88.1 for ; Mon, 09 Mar 2026 21:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1773116708; x=1773721508; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hPa4uc736wUZG7p1hT7+UQGgiHHzlxFbUs+tG5i8A9g=; b=fJ+NUFu01Q42JAs3ZMG+IUT46XwmQj0eu6S1001nNRgS/kHP9oRodw5JdBugauJ5m3 3GsS4SKrMJqWUMcYSIC4RMTAh3A1DuspJYj89bjNS4DtfEdM5l9v1AkHCfw7ETMNXjpE XcdJrvnA3Efp+eiqwAgkTiKBwc5u6hkxkbabDHEA8tbZrLR7QXLJGPUKzZE48czskLVt Ho4EYUI1iI2dhap6LuBlh3/AV3KRaWhs+4qTLxsOG0tzt9fKfY77kOcv8swPQu7KLdsY f3i7rETYjKPIPzsPuD8Tq55PkvJXsuP3EujdwoF7+02Vwz1ZMfVuu2/+XsCvBNwkCUKN rfxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773116708; x=1773721508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hPa4uc736wUZG7p1hT7+UQGgiHHzlxFbUs+tG5i8A9g=; b=X8M8Bdo+ZpGBtCyP7eKM2U61IyZ6B72yCJd2zqalnMtDjdxqNRbQzZ4U9EWvgJD539 QLK+1CAsTFjhuQ2J1Djs1K8DSwH+pZ2F5GA5fCCp2pnErL7i2cXQe4WwVsvkvfwOCA1R cKb3EK+sIWYySNCHJEWwCyFdsHd3nRKqYCCjVboYHrxQT08wPY8fqCqV2g77plKPYP6H WeU+pd73yRvjhK3bXArxmiNHHhvOKzPwlzRIF9sU2Ao+iZTAChFVx/0Kwq0H4ffVMl9h IJkWGuzMo/slQvuHq+D07jxymJlDjubP3qcxJ6fafTSRjo7JTYoqrD75n61lCFS6PtQ6 F2Yw== X-Gm-Message-State: AOJu0Yzx3ZJgM7ABC2McCfXxGEHvJIU5gFmnnUb/Z8VrLH4hKUZpmSB5 1lATt5ajlmr1zNpKE6kr0LgcRrmS8/R+76LI3OEhRjxgjPB0hMYhmwb+BtiTwgclpGkQFgphe8r vtCtllJDIPQ== X-Gm-Gg: ATEYQzx+nwZQv/Co1OdfMdivoDm5xDKvoZugmo00dYd3gJ9IHLF892HKDhnzjEWeSzG VonHkYUy++iKRCqUUr7Gd6igVKqZdLLCUrpcolTy6S3YZzpbHcKkqDkQXQyEC77BSjEuGzEfur9 CXTBNnR5enBXb2bPRIYhd1R4unVYlr93c3HcPEZhN8X8QBj2T0lmMDEl3LYxg+6332BhnasiQgi S5CI/Pll+Q5/7n9k9eH9OEtdFH7R8HB4376Q+q22Tsm+ooo6LUYosjr9VOwnM6hpST6dzEXN/ST EsC9gf44pyVMdKoJL6xTmJKkntib0E6ZHE/uaCCpdAtqPgbKbuJxC8QGlFuauvy40CVBhKTERDv ijM9p506KgI4JIwNtfqvY8eHY0U52tv2DnEbCI5OY2YPupAme9x87VqX/QOrA9rdvk8J3rZv4SK L9vXsLkDe6+OgZXdxHcHnhdY+BOQ== X-Received: by 2002:a05:7022:6081:b0:128:dbbf:fd35 with SMTP id a92af1059eb24-128dbbffee6mr1751213c88.28.1773116708236; Mon, 09 Mar 2026 21:25:08 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:eea6:1f6d:5163:10ae]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be4f984cf5sm12925551eec.33.2026.03.09.21.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 21:25:07 -0700 (PDT) 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: [REGRESSION][PATCH] drm/amd/display: Fix uninitialized variable which breaks full LTO Date: Mon, 9 Mar 2026 21:24:57 -0700 Message-ID: X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3D0x0= 7002F00 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 It surprises me that neither gcc nor clang emit a warning about this: I only found it by bisecting the LTO breakage. Fix by using the old value for region_params.bss_data_size in place of the uninitialized reference, which makes amdgpu work with LTO again. Fixes: e1b385726f7f ("drm/amd/display: Add additional checks for PSP footer= size") Signed-off-by: Calvin Owens --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gp= u/drm/amd/display/amdgpu_dm/amdgpu_dm.c index b3d6f2cd8ab6..e69e61163ae9 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2554,7 +2554,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) fw_meta_info_params.fw_inst_const =3D adev->dm.dmub_fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes) + PSP_HEADER_BYTES_256; - fw_meta_info_params.fw_bss_data =3D region_params.bss_data_size ? adev->d= m.dmub_fw->data + + fw_meta_info_params.fw_bss_data =3D le32_to_cpu(hdr->bss_data_bytes) ? ad= ev->dm.dmub_fw->data + le32_to_cpu(hdr->header.ucode_array_offset_bytes) + le32_to_cpu(hdr->inst_const_bytes) : NULL; fw_meta_info_params.custom_psp_footer_size =3D 0; --=20 2.47.3