mirror-linux/drivers/gpu/drm/amd/display/dc
Tobias Jakobi e835d5144f drm/amd/display: Avoid race between dcn35_set_drr() and dc_state_destruct()
dc_state_destruct() nulls the resource context of the DC state. The pipe
context passed to dcn35_set_drr() is a member of this resource context.

If dc_state_destruct() is called parallel to the IRQ processing (which
calls dcn35_set_drr() at some point), we can end up using already nulled
function callback fields of struct stream_resource.

The logic in dcn35_set_drr() already tries to avoid this, by checking tg
against NULL. But if the nulling happens exactly after the NULL check and
before the next access, then we get a race.

Avoid this by copying tg first to a local variable, and then use this
variable for all the operations. This should work, as long as nobody
frees the resource pool where the timing generators live.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3142
Fixes: 06ad7e1642 ("drm/amd/display: Destroy DC context while keeping DML and DML2")
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0607a50c00)
Cc: stable@vger.kernel.org
2024-09-10 16:31:44 -04:00
..
basics drm/amd/display: Fix possible overflow in integer multiplication 2024-07-01 16:06:53 -04:00
bios drm/amd/display: Check and log for function error codes 2024-06-27 17:10:36 -04:00
clk_mgr drm/amd/display: replace CRTC disable function call 2024-07-01 16:10:35 -04:00
core minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
dccg drm/amd/display: Refactor dccg401_get_other_enable_symclk_fe 2024-06-27 17:10:35 -04:00
dce drm/amd/display: Replace dm_execute_dmub_cmd with dc_wake_and_execute_dmub_cmd 2024-08-07 18:13:31 -04:00
dce60
dce80 drm/amd/display: use even ODM slice width for two pixels per container 2024-04-30 09:57:04 -04:00
dce110 drm/amd/display: use even ODM slice width for two pixels per container 2024-04-30 09:57:04 -04:00
dce112
dce120 drm/amd/display: use even ODM slice width for two pixels per container 2024-04-30 09:57:04 -04:00
dcn10 drm/amd/display: Move dio files into dio folder 2024-07-01 16:10:35 -04:00
dcn20 drm/amd/display: Move dio files into dio folder 2024-07-01 16:10:35 -04:00
dcn21 drm/amd/display: Refactor HUBP into component folder. 2024-05-08 15:17:03 -04:00
dcn30 drm/amd/display: Move dio files into dio folder 2024-07-01 16:10:35 -04:00
dcn31 drm/amd/display: Move dio files into dio folder 2024-07-01 16:10:35 -04:00
dcn201 drm/amd/display: Add left edge pixel for YCbCr422/420 + ODM pipe split 2024-05-13 15:46:55 -04:00
dcn301 drm/amd/display: Fix Makefile copyright notices 2024-06-27 17:10:39 -04:00
dcn303 drm/amd/display: Refactor DCCG into component folder 2024-05-02 16:18:16 -04:00
dcn314 drm/amd/display: Fix Makefile copyright notices 2024-06-27 17:10:39 -04:00
dcn401 drm/amd/display: Fix Makefile copyright notices 2024-06-27 17:10:39 -04:00
dio drm/amd/display: Move dio files into dio folder 2024-07-01 16:10:35 -04:00
dml drm/amd/display: Add missing DCN314 to the DML Makefile 2024-08-07 18:17:27 -04:00
dml2 drm/amd/display: Block timing sync for different signals in PMO 2024-09-02 13:13:43 -04:00
dpp drm/amd/display: Fix cursor issues with ODMs and HW rotations 2024-06-27 17:10:36 -04:00
dsc drm/amd/display: Adjust reg field for DSC wait for disconnect 2024-06-27 17:10:38 -04:00
dwb drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
gpio drm/amd/display: Remove useless comparison of unsigned int vs. 0 2024-06-14 16:17:17 -04:00
hdcp drm/amd/display: Check msg_id before processing transcation 2024-05-02 16:18:17 -04:00
hpo drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
hubbub drm/amd/display: Add ASIC cap to limit DCC surface width 2024-07-01 16:06:53 -04:00
hubp drm/amd/display: Fix divide by zero in CURSOR_DST_X_OFFSET calculation 2024-07-01 16:06:53 -04:00
hwss drm/amd/display: Avoid race between dcn35_set_drr() and dc_state_destruct() 2024-09-10 16:31:44 -04:00
inc drm/amd/display: Add simple struct doc to remove doc build warning 2024-07-16 11:45:09 -04:00
irq drm/amd/display: Remove useless comparison of unsigned int vs. 0 2024-06-14 16:17:17 -04:00
link drm/amd/display: Move DIO documentation to the right place 2024-07-16 11:44:49 -04:00
mmhubbub drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
mpc drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
opp drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
optc drm/amd/display: fix corruption with high refresh rates on DCN 3.0 2024-07-17 17:41:28 -04:00
pg drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
resource drm/amd/display: Enable otg synchronization logic for DCN321 2024-08-13 12:52:27 -04:00
spl drm/amd/display: Fix possible overflow in integer multiplication 2024-07-01 16:06:53 -04:00
virtual
Makefile drm/amd/display: Refactor DCN3X into component folder 2024-06-14 16:18:55 -04:00
dc.h drm/amd/display: 3.2.291 2024-07-01 16:10:35 -04:00
dc_bios_types.h drm/amd/display: Add misc DC changes for DCN401 2024-04-26 17:23:34 -04:00
dc_ddc_types.h
dc_dmub_srv.c drm/amd/display: Validate function returns 2024-06-27 17:10:38 -04:00
dc_dmub_srv.h drm/amd/display: Notify idle link detection through shared state 2024-04-30 09:57:17 -04:00
dc_dp_types.h
dc_dsc.h
dc_edid_parser.c
dc_edid_parser.h
dc_hdmi_types.h
dc_helper.c drm/amd/display: remove unused struct 'dc_reg_sequence' 2024-05-20 16:20:26 -04:00
dc_hw_types.h drm/amd/display: Remove unused code for some dc files 2024-05-13 15:46:02 -04:00
dc_plane.h
dc_plane_priv.h
dc_spl_translate.c drm/amd/display: add odm_slice_rect parameter in spl_in 2024-06-14 16:17:13 -04:00
dc_spl_translate.h drm/amd/display: Add new DCN401 sources 2024-04-26 17:23:13 -04:00
dc_stat.h
dc_state.h
dc_state_priv.h drm/amd/display: Add misc DC changes for DCN401 2024-04-26 17:23:34 -04:00
dc_stream.h drm/amd/display: Move fpo_in_use to stream_status 2024-06-05 11:06:36 -04:00
dc_stream_priv.h drm/amd/display: Find max flickerless instant vtotal delta 2024-05-13 15:47:53 -04:00
dc_trace.h
dc_types.h drm/amd/display: Add Replay general cmd 2024-06-27 17:10:36 -04:00
dm_cp_psp.h
dm_event_log.h
dm_helpers.h drm/amd/display: Code style adjustments 2024-04-26 17:22:45 -04:00
dm_pp_smu.h drm/amd/display: Add missing SMU version 2024-04-30 09:52:08 -04:00
dm_services.h
dm_services_types.h
irq_types.h drm/amd/display: Add missing IRQ types 2024-04-30 09:45:11 -04:00
os_types.h drm/amd/display: Remove legacy code in DC 2024-04-30 09:52:51 -04:00