From nobody Tue May 14 19:32:03 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 450E412F39C; Wed, 27 Mar 2024 12:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711541781; cv=none; b=X6o6QxCeRTQXFxrMZsmcXZ0LGZa3UyThcBkdrn+A7cZJjzcCbhngHldBjU1aF65Sg/PJXWHZg6QIGbr3CHll4ux2QcGWnc64UR1bLu1Qncx9qVScCvaHLAoNovLUkbmw6Lq1LUO847U6kIdo5Mlre1JYi9+EoY5Zbmd74ze7o0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711541781; c=relaxed/simple; bh=Yicq+XuQzgG2tonr/iGqCdQycNJ3Mn8wKBosiqBtEZg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mw3lpp95f9XEYszE3zgdtS8Px9cMHKxOwyTUD/BSXwyoaSugcqLHPvFv9tIdaZc4cwM3YLq2sLs2Fzs48LIdYY0Lhg91vawKoteTB5dvwzviJ6jX8MgSkC7Xxebk9mDAaP9r5LgyQuPGwxXvSoXQRrpg+s2vZxnazvg8HUB2vWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kfZMakYq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kfZMakYq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9303C43390; Wed, 27 Mar 2024 12:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711541780; bh=Yicq+XuQzgG2tonr/iGqCdQycNJ3Mn8wKBosiqBtEZg=; h=From:To:Cc:Subject:Date:From; b=kfZMakYqxkmYUI3P7HZgg2CbVKwDMwVeYyUOCU8UwZngZ+/S6hAnd7viA+HNUjixD t5RNMq+wFzZ47FJA7ew+GpL/9UO4bI0tvwfMsVw8a5K9Ozrq0P3nrOxf3fzam5g+mB Zh8R287E0w1rwRFa9y866bBFrqxWca6Ak3wz7F156BgHoq0njaWQ4HAN6MKi84lfen Ld/PrGaktwE5EiDFprt925yHrNxGLwAvjUV5aDrJzo7nybIVRjfzuP+klstSFRS/df gb53kF70bGxlUbAXiA26hRDOWIwm6T/R/q6h4efaNlPd6O0CUh1Ed6e5yJNmL6hpDx t5WdSEr97tA8A== From: Sasha Levin To: stable@vger.kernel.org, sohaib.nadeem@amd.com Cc: Mario Limonciello , Alex Deucher , Josip Pavic , Aurabindo Pillai , Daniel Wheeler , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: FAILED: Patch "drm/amd/display: fixed integer types and null check locations" failed to apply to 5.15-stable tree Date: Wed, 27 Mar 2024 08:16:18 -0400 Message-ID: <20240327121618.2832619-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha Acked-by: Aurabindo Pillai Reviewed-by: Josip Pavic Tested-by: Daniel Wheeler ------------------ original commit in Linus's tree ------------------ From 616b39467e816851335277d817ec98b7a9b92758 Mon Sep 17 00:00:00 2001 From: Sohaib Nadeem Date: Wed, 31 Jan 2024 16:40:37 -0500 Subject: [PATCH] drm/amd/display: fixed integer types and null check locati= ons [why]: issues fixed: - comparison with wider integer type in loop condition which can cause infinite loops - pointer dereference before null check Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Josip Pavic Acked-by: Aurabindo Pillai Signed-off-by: Sohaib Nadeem Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- .../gpu/drm/amd/display/dc/bios/bios_parser2.c | 16 ++++++++++------ .../drm/amd/display/dc/link/link_validation.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/g= pu/drm/amd/display/dc/bios/bios_parser2.c index 960c4b4f6ddf3..05f392501c0ae 100644 --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c @@ -1850,19 +1850,21 @@ static enum bp_result get_firmware_info_v3_2( /* Vega12 */ smu_info_v3_2 =3D GET_IMAGE(struct atom_smu_info_v3_2, DATA_TABLES(smu_info)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_2->gpuclk_ss_percentage); if (!smu_info_v3_2) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_2->gpuclk_ss_percentage); + info->default_engine_clk =3D smu_info_v3_2->bootup_dcefclk_10khz * 10; } else if (revision.minor =3D=3D 3) { /* Vega20 */ smu_info_v3_3 =3D GET_IMAGE(struct atom_smu_info_v3_3, DATA_TABLES(smu_info)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_3->gpuclk_ss_percentage); if (!smu_info_v3_3) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", smu_in= fo_v3_3->gpuclk_ss_percentage); + info->default_engine_clk =3D smu_info_v3_3->bootup_dcefclk_10khz * 10; } =20 @@ -2422,10 +2424,11 @@ static enum bp_result get_integrated_info_v11( info_v11 =3D GET_IMAGE(struct atom_integrated_system_info_v1_11, DATA_TABLES(integratedsysteminfo)); =20 - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v1= 1->gpuclk_ss_percentage); if (info_v11 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v1= 1->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v11->gpucapinfo); /* @@ -2637,11 +2640,12 @@ static enum bp_result get_integrated_info_v2_1( =20 info_v2_1 =3D GET_IMAGE(struct atom_integrated_system_info_v2_1, DATA_TABLES(integratedsysteminfo)); - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _1->gpuclk_ss_percentage); =20 if (info_v2_1 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _1->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v2_1->gpucapinfo); /* @@ -2799,11 +2803,11 @@ static enum bp_result get_integrated_info_v2_2( info_v2_2 =3D GET_IMAGE(struct atom_integrated_system_info_v2_2, DATA_TABLES(integratedsysteminfo)); =20 - DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _2->gpuclk_ss_percentage); - if (info_v2_2 =3D=3D NULL) return BP_RESULT_BADBIOSTABLE; =20 + DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", info_v2= _2->gpuclk_ss_percentage); + info->gpu_cap_info =3D le32_to_cpu(info_v2_2->gpucapinfo); /* diff --git a/drivers/gpu/drm/amd/display/dc/link/link_validation.c b/driver= s/gpu/drm/amd/display/dc/link/link_validation.c index 1c038e2a527b3..1aed55b0ab6a0 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_validation.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_validation.c @@ -359,7 +359,7 @@ bool link_validate_dpia_bandwidth(const struct dc_strea= m_state *stream, const un struct dc_link *dpia_link[MAX_DPIA_NUM] =3D {0}; int num_dpias =3D 0; =20 - for (uint8_t i =3D 0; i < num_streams; ++i) { + for (unsigned int i =3D 0; i < num_streams; ++i) { if (stream[i].signal =3D=3D SIGNAL_TYPE_DISPLAY_PORT) { /* new dpia sst stream, check whether it exceeds max dpia */ if (num_dpias >=3D MAX_DPIA_NUM) --=20 2.43.0