mirror_ubuntu-kernels/drivers/gpu/drm/amd/display/dc
Nicholas Kazlauskas 32685b32d8 drm/amd/display: Fix double free during GPU reset on DC streams
[Why]
The issue only occurs during the GPU reset code path.

We first backup the current state prior to commiting 0 streams
internally from DM to DC. This state backup contains valid link
encoder assignments.

DC will clear the link encoder assignments as part of current state
(but not the backup, since it was a copied before the commit) and
free the extra stream reference it held.

DC requires that the link encoder assignments remain cleared/invalid
prior to commiting. Since the backup still has valid assignments we
call the interface post reset to clear them. This routine also
releases the extra reference that the link encoder interface held -
resulting in a double free (and eventually a NULL pointer dereference).

[How]
We'll have to do a full DC commit anyway after GPU reset because
the stream count previously went to 0.

We don't need to retain the assignment that we had backed up, so
just copy off of the now clean current state assignment after the
reset has occcurred with the new link_enc_cfg_copy() interface.

Fixes: 6d63fcc2a3 ("drm/amd/display: Reset link encoder assignments for GPU reset")

Reviewed-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-03-15 14:25:16 -04:00
..
basics Revert "drm/amd/display: Unblank hubp based on plane visibility" 2021-02-18 16:43:10 -05:00
bios drm/amd/display: Add DCN315 Command Table Helper 2022-02-18 14:07:01 -05:00
clk_mgr drm/amd/display: enable dcn315/316 s0i2 support 2022-03-15 14:25:16 -04:00
core drm/amd/display: Fix double free during GPU reset on DC streams 2022-03-15 14:25:16 -04:00
dce drm/amd/display: merge two duplicated clock_source_create 2022-03-15 14:25:15 -04:00
dce60 drm/amd/display/dc/dce60/dce60_resource: Include our own header containing prototypes 2021-01-14 13:20:21 -05:00
dce80 drm/amd/display: Return last used DRR VTOTAL from DC 2021-06-08 12:20:12 -04:00
dce100 drm/amd/display/dc/dce100/dce100_resource: Include our own header containing prototypes 2021-01-14 13:20:20 -05:00
dce110 drm/amd/display: Program OPP before ODM 2022-03-04 12:43:02 -05:00
dce112 drm/amd/display: Use NULL instead of 0 2022-02-24 17:26:20 -05:00
dce120 drm/amd/display: Return last used DRR VTOTAL from DC 2021-06-08 12:20:12 -04:00
dcn10 drm/amd/display: Modify plane removal sequence to avoid hangs. 2022-03-02 18:40:07 -05:00
dcn20 drm/amd/display: Modify plane removal sequence to avoid hangs. 2022-03-02 18:40:07 -05:00
dcn21 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split 2021-12-30 08:54:44 -05:00
dcn30 drm/amd/display: add gamut coefficient set A and B 2022-03-15 14:25:15 -04:00
dcn31 drm/amd/display: fix deep color ratio 2022-03-15 14:25:15 -04:00
dcn201 drm/amd/display: Add missing prototypes to dcn201_init 2022-02-23 14:03:20 -05:00
dcn301 drm/amdgpu: move dpcs_3_0_0 headers from dcn to dpcs 2022-02-07 18:03:50 -05:00
dcn302 drm/amdgpu: move dpcs_3_0_0 headers from dcn to dpcs 2022-02-07 18:03:50 -05:00
dcn303 drm/amd/display: move FPU associated DCN303 code to DML folder 2022-03-15 14:25:15 -04:00
dcn315 drm/amd/display: merge two duplicated clock_source_create 2022-03-15 14:25:15 -04:00
dcn316 drm/amd/display: merge two duplicated clock_source_create 2022-03-15 14:25:15 -04:00
dml drm/amd/display: move FPU associated DCN303 code to DML folder 2022-03-15 14:25:15 -04:00
dsc drm/dp: Move public DisplayPort headers into dp/ 2022-01-17 11:25:44 +01:00
gpio drm/amd/display: Add DCN315 GPIO 2022-02-18 14:07:00 -05:00
hdcp drm/amd/display: Enforce DPCD Address ranges 2021-06-15 17:25:41 -04:00
inc drm/amd/display: Fix double free during GPU reset on DC streams 2022-03-15 14:25:16 -04:00
irq drm/amd/display: Turn functions into static 2022-02-24 17:26:25 -05:00
link drm/amd/display: Add link dp trace support 2022-03-15 14:25:15 -04:00
virtual drm/amd/display: move link_hwss to link folder and break down to files 2022-02-02 18:26:32 -05:00
dc_bios_types.h drm/amd/display: Interface for LTTPR interop 2021-04-09 16:48:25 -04:00
dc_ddc_types.h drm/amd/display: Support for DMUB AUX 2021-03-02 14:05:41 -05:00
dc_dmub_srv.c drm/amd/display: Wait for ACK for INBOX0 HW Lock 2021-11-17 16:58:11 -05:00
dc_dmub_srv.h drm/amd/display: Wait for ACK for INBOX0 HW Lock 2021-11-17 16:58:11 -05:00
dc_dp_types.h drm/amd/display: add cable ID support for usb c connector 2022-02-23 14:22:03 -05:00
dc_dsc.h drm/amd/display: move bpp range decision in decide dsc bw range function 2021-09-14 15:57:09 -04:00
dc_edid_parser.c drm/amd/display: Add Freesync HDMI support to DMCU 2021-02-02 12:11:41 -05:00
dc_edid_parser.h drm/amd/display: Add Freesync HDMI support to DMCU 2021-02-02 12:11:41 -05:00
dc_helper.c drm/amd/display: Support synchronized indirect reg access 2022-01-25 18:00:35 -05:00
dc_hw_types.h drm/amd/display: add dsc mst stream pbn log for debug 2022-02-16 17:12:00 -05:00
dc_link.h drm/amd/display: Add link dp trace support 2022-03-15 14:25:15 -04:00
dc_stat.h drm/amd/display: DMUB Outbound Interrupt Process-X86 2021-07-08 15:14:36 -04:00
dc_stream.h drm/amd/display: Drop DCN for DP2.x logic 2022-01-25 18:00:34 -05:00
dc_trace.h drm/amd/display: Add control mechanism for FPU utilization 2021-08-05 21:17:59 -04:00
dc_types.h drm/amd/display: Drop DCN for DP2.x logic 2022-01-25 18:00:34 -05:00
dc.h drm/amd/display: 3.2.176 2022-03-15 14:25:16 -04:00
dm_cp_psp.h drm/amd/display: unhard code link to phy idx mapping in dc link and clean up 2022-01-07 17:21:20 -05:00
dm_event_log.h
dm_helpers.h drm/amd/display: refine the EDID override 2022-03-04 13:03:29 -05:00
dm_pp_smu.h drm/amdgpu/pm: display vcn pp dpm (v4) 2021-05-21 10:31:55 -04:00
dm_services_types.h
dm_services.h drm/amd/display: Decouple amdgpu_dm_trace from service 2020-10-26 13:33:59 -04:00
irq_types.h drm/amd/display: Fix for access for ddc pin and aux engine. 2021-10-06 15:52:48 -04:00
Makefile drm/amd/display: Add DCN315 blocks to Makefile 2022-02-18 14:07:01 -05:00
os_types.h drm/dp: Move public DisplayPort headers into dp/ 2022-01-17 11:25:44 +01:00