[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 8b0ddf19cca2a352b2a7e01d99d3ba949a99c84c
WARNING: Author mismatch between patch and upstream commit: Backport author: Keerthana K keerthana.kalyanasundaram@broadcom.com Commit author: Alex Hung alex.hung@amd.com
Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: e50bec62acae) 6.1.y | Not found
Note: The patch differs from the upstream commit: --- 1: 8b0ddf19cca2a ! 1: 3a1c77af30b1b drm/amd/display: Check BIOS images before it is used @@ Metadata ## Commit message ## drm/amd/display: Check BIOS images before it is used
+ [ Upstream commit 8b0ddf19cca2a352b2a7e01d99d3ba949a99c84c ] + BIOS images may fail to load and null checks are added before they are used.
@@ Commit message Acked-by: Hamza Mahfooz hamza.mahfooz@amd.com Signed-off-by: Alex Hung alex.hung@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com + Signed-off-by: Sasha Levin sashal@kernel.org + Signed-off-by: Keerthana K keerthana.kalyanasundaram@broadcom.com
## drivers/gpu/drm/amd/display/dc/bios/bios_parser.c ## @@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static enum bp_result get_ss_info_v3_1( - ss_table_header_include = ((ATOM_ASIC_INTERNAL_SS_INFO_V3 *) bios_get_image(&bp->base, - DATA_TABLES(ASIC_InternalSS_Info), - struct_size(ss_table_header_include, asSpreadSpectrum, 1))); + + ss_table_header_include = GET_IMAGE(ATOM_ASIC_INTERNAL_SS_INFO_V3, + DATA_TABLES(ASIC_InternalSS_Info)); + if (!ss_table_header_include) + return BP_RESULT_UNSUPPORTED; + @@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static enum bp_result get_ss_ (le16_to_cpu(ss_table_header_include->sHeader.usStructureSize) - sizeof(ATOM_COMMON_TABLE_HEADER)) @@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static enum bp_result get_ss_info_from_internal_ss_info_tbl_V2_1( - &bp->base, - DATA_TABLES(ASIC_InternalSS_Info), - struct_size(header, asSpreadSpectrum, 1))); + + header = GET_IMAGE(ATOM_ASIC_INTERNAL_SS_INFO_V2, + DATA_TABLES(ASIC_InternalSS_Info)); + if (!header) + return result;
@@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static uint32_t get_ss_entry_ if (1 != revision.major || 2 > revision.minor) return number; @@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_v2_1( - &bp->base, - DATA_TABLES(ASIC_InternalSS_Info), - struct_size(header_include, asSpreadSpectrum, 1))); + + header_include = GET_IMAGE(ATOM_ASIC_INTERNAL_SS_INFO_V2, + DATA_TABLES(ASIC_InternalSS_Info)); + if (!header_include) + return 0;
size = (le16_to_cpu(header_include->sHeader.usStructureSize) - sizeof(ATOM_COMMON_TABLE_HEADER)) @@ drivers/gpu/drm/amd/display/dc/bios/bios_parser.c: static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_V3_1( - header_include = ((ATOM_ASIC_INTERNAL_SS_INFO_V3 *) bios_get_image(&bp->base, - DATA_TABLES(ASIC_InternalSS_Info), - struct_size(header_include, asSpreadSpectrum, 1))); + + header_include = GET_IMAGE(ATOM_ASIC_INTERNAL_SS_INFO_V3, + DATA_TABLES(ASIC_InternalSS_Info)); + if (!header_include) + return number; + ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success | | stable/linux-5.10.y | Success | Success |