linux/drivers/gpu/drm/amd/display/dc
Rodrigo Siqueira cd294f9a64 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-12 13:57:43 -04:00
..
basics
bios drm/amd/display: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
calcs drm/amd/display: add DCN support for aarch64 2020-08-10 17:26:53 -04:00
clk_mgr drm/amd/display: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
core drm/amd/display: Fix module load hangs when connected to an eDP 2020-10-12 13:57:43 -04:00
dce drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dce60 drm/amd/display: dc/dce60: use DCE6 headers (v6) 2020-07-27 16:46:45 -04:00
dce80 drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dce100 drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dce110 drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dce112 drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dce120 drm/amd/display: Add i2c speed arbitration for dc_i2c and hdcp_i2c 2020-10-05 15:16:50 -04:00
dcn10 drm/amd/display: Program meta addresses correctly 2020-10-05 15:17:20 -04:00
dcn20 drm/amd/display: Program meta addresses correctly 2020-10-05 15:17:20 -04:00
dcn21 drm/amd/display: Hardcode 45W Bounding Box for DCN2.1 Diags 2020-10-05 15:17:13 -04:00
dcn30 drm/amd/display: Add missing function pointers for dcn3 2020-10-12 13:57:26 -04:00
dcn301 drm/amd/display: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
dml drm/amd/display: Don't allow pstate if no support in blank 2020-10-05 15:16:05 -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: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
hdcp
inc drm/amd/display: Block ABM in case of eDP ODM 2020-10-05 15:16:43 -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: 3.2.106 2020-10-05 15:17:49 -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
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
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: Block ABM in case of eDP ODM 2020-10-05 15:16:43 -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
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/amd/display: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
dm_services.h drm/amd/display: Handle persistence in DM 2020-05-28 14:00:47 -04:00
dm_services_types.h
irq_types.h
Makefile drm/amd/display: Add dcn3.01 support to DC (v2) 2020-10-05 15:15:56 -04:00
os_types.h drm/amd/display: add DCN support for aarch64 2020-08-10 17:26:53 -04:00