bianbu-linux-6.6/drivers/gpu/drm/amd/display/dc
Rodrigo Siqueira 44264591a8 drm/amd/display: Fix module load hangs when connected to an eDP
It was recently introduced a change that enables driver to disable
streams if pixel clock changes. Consequently, the code path executed in
the disable vbios function expanded to an encoder verification part.
The encoder loop is nested inside the pipe count loop, and both loops
share the 'i' variable in control of their flow. This situation may lead
to an infinite loop because the encoder loop constantly updates the `i`
variable, making the first loop always positive. As a result, we can see
a soft hang during the module load (modprobe amdgpu) and a series of
dmesg log that looks like this:

kernel:[  124.538727] watchdog: BUG: soft lockup - CPU#2 stuck for 22s!
[modprobe:1000]

RSP: 0018:ffffabbf419bf0e8 EFLAGS: 00000282
RAX: ffffffffc0809de0 RBX: ffff93b35ccc0000 RCX: ffff93b366c21800
RDX: 0000000000000000 RSI: 0000000000000141 RDI: ffff93b35ccc0000
RBP: ffffabbf419bf108 R08: ffffabbf419bf164 R09: 0000000000000001
R10: 0000000000000003 R11: 0000000000000003 R12: 0000000008677d40
R13: 0000000000000141 R14: ffff93b35cfc0000 R15: ffff93b35abc0000
FS:  00007f1400717540(0000) GS:ffff93b37f680000(0000)
     knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005649b66b0968 CR3: 00000003e0fec000 CR4: 0000000000350ee0
Call Trace:
 amdgpu_device_rreg+0x17/0x20 [amdgpu]
 amdgpu_cgs_read_register+0x14/0x20 [amdgpu]
 dm_read_reg_func+0x3a/0xb0 [amdgpu]
 get_pixel_clk_frequency_100hz+0x30/0x50 [amdgpu]
 dc_commit_state+0x8f1/0xae0 [amdgpu]
 ? drm_calc_timestamping_constants+0x101/0x160 [drm]
 amdgpu_dm_atomic_commit_tail+0x39d/0x21a0 [amdgpu]
 ? dcn21_validate_bandwidth+0xe5/0x290 [amdgpu]
 ? kfree+0xc3/0x390
 ? dcn21_validate_bandwidth+0xe5/0x290 [amdgpu]
...
RSP: 002b:00007fff26009bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055a8025bea50 RCX: 00007f140085c89d
RDX: 0000000000000000 RSI: 000055a8025b8290 RDI: 000000000000000c
RBP: 0000000000040000 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000000c R11: 0000000000000246 R12: 000055a8025b8290
R13: 0000000000000000 R14: 000055a8025bead0 R15: 000055a8025bea50

This issue was fixed by introducing a second variable for the internal
loop.

Fixes: 8353d30e74 ("drm/amd/display: disable stream if pixel clock changed with link active")
Reviewed-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2020-10-14 15:22:46 -04:00
..
basics drm/amd/dc: Kill dc_conn_log_hex_linux() 2020-04-01 14:44:59 -04:00
bios drm/amd/display: get socBB from VBIOS 2020-09-15 17:52:42 -04:00
calcs drm/amd/display: add DCN support for aarch64 2020-08-10 17:26:53 -04:00
clk_mgr drm/amd/display: Avoid set zero in the requested clk 2020-10-05 15:13:36 -04:00
core drm/amd/display: Fix module load hangs when connected to an eDP 2020-10-14 15:22:46 -04:00
dce drm/amd/display: Ensure all debug bits are passed to fw 2020-09-29 16:08:37 -04:00
dce60 drm/amd/display: dc/dce60: use DCE6 headers (v6) 2020-07-27 16:46:45 -04:00
dce80 drm/amd/display: change from panel to panel cntl 2020-04-22 18:11:48 -04:00
dce100 drm/amd/display: change from panel to panel cntl 2020-04-22 18:11:48 -04:00
dce110 drm/amd/display: make two symbols static 2020-09-29 16:11:40 -04:00
dce112 drm/amd/display: remove redundant initialization of variable result 2020-07-27 16:21:11 -04:00
dce120 drm/amd/display: Enable fp16 also on DCE-11.0 - DCE-12. (v2) 2020-05-21 12:46:51 -04:00
dcn10 drm/amd/display: Fix OPTC_DATA_FORMAT programming 2020-10-09 15:12:32 -04:00
dcn20 drm/amd/display: Fix OPTC_DATA_FORMAT programming 2020-10-09 15:12:32 -04:00
dcn21 drm/amd/display: eDP intermittent black screen during PnP 2020-09-22 12:27:43 -04:00
dcn30 drm/amd/display: Fix OPTC_DATA_FORMAT programming 2020-10-09 15:12:32 -04:00
dml drm/amd/display: Don't allow pstate if no support in blank 2020-10-09 15:09:13 -04:00
dsc drm/amd/display: Mask DPCD field to avoid reading unsupported field value 2020-08-17 14:09:06 -04:00
gpio drm: amd/display: fix spelling of "function" 2020-09-15 17:52:42 -04:00
hdcp drm/amd/display: query hdcp capability during link detect 2020-04-09 10:43:17 -04:00
inc drm/amd/display: Revert check for flip pending before locking pipes 2020-09-29 16:09:05 -04:00
irq drm/amd/display: dc/irq: add support for DCE6 (v4) 2020-07-27 16:46:02 -04:00
virtual drm/amd/display: Add dp_set_dsc_pps_info_packet to virtual stream encoder 2020-09-29 16:08:31 -04:00
dc.h drm/amd/display: Add debug param to force dio disable 2020-09-29 16:08:59 -04:00
dc_bios_types.h drm/amd/display: get socBB from VBIOS 2020-09-15 17:52:42 -04:00
dc_ddc_types.h drm/amd/display: Proper return of result when aux engine acquire fails 2019-10-25 16:50:09 -04:00
dc_dmub_srv.c drm/amd/display: implement notify stream mask 2020-09-15 17:52:41 -04:00
dc_dmub_srv.h drm/amd/display: implement notify stream mask 2020-09-15 17:52:41 -04:00
dc_dp_types.h drm/amd/display: add option to override cr training pattern 2020-09-15 17:52:40 -04:00
dc_dsc.h drm/amd/display: Fix DSC force enable on SST 2020-08-17 14:08:34 -04:00
dc_helper.c drm/amd/display: Pass command instead of header into DMUB service 2020-04-28 16:19:05 -04:00
dc_hw_types.h drm/amd/display: Implement AMD VSIF V3 2020-07-21 15:37:39 -04:00
dc_link.h drm/amd/display: TMDS Fallback transition 2020-09-22 12:29:05 -04:00
dc_stream.h drm/amd/display: Keep current gain when ABM disable immediately 2020-08-26 16:40:18 -04:00
dc_types.h drm/amd/display: Increase Max EDID Size Constant 2020-09-15 17:52:41 -04:00
dm_cp_psp.h drm/amd/display: enable assr 2020-07-01 01:59:25 -04:00
dm_event_log.h drm/amd/display: Add customizable tracing event 2018-11-30 12:02:49 -05:00
dm_helpers.h drm/amd/display: Add DCN3 Support in DM (v2) 2020-07-01 01:59:15 -04:00
dm_pp_smu.h drm/amdgpu: drop BOOLEAN define in display part 2020-09-15 17:52:40 -04:00
dm_services.h drm/amd/display: Handle persistence in DM 2020-05-28 14:00:47 -04:00
dm_services_types.h drm/amd/display: Add definition for number of backlight data points 2019-12-18 16:09:08 -05:00
irq_types.h drm/amd/display: Add Vline1 interrupt source to InterruptManager 2019-01-28 11:44:10 -05:00
Makefile drm/amd/display: dc/dce: add initial DCE6 support (v10) 2020-07-27 16:45:51 -04:00
os_types.h drm/amd/display: add DCN support for aarch64 2020-08-10 17:26:53 -04:00