Bug 215511

Summary: Dual monitor with amd 5700 causes system to hang at startup.
Product: Drivers Reporter: Jose Mestre (pmestre)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: NEW ---    
Severity: normal CC: alexdeucher, pr_kernel
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.16.1 Subsystem:
Regression: No Bisected commit-id:
Attachments: dual monitor boot crash with amdgpu card.
possible fix
possible fix 1/2
possible fix 2/2

Description Jose Mestre 2022-01-21 09:23:22 UTC
Created attachment 300294 [details]
dual monitor boot crash with amdgpu card.

Hello, system mostly crashes (sometimes in different ways) when i start with more than one monitor attached.

If i switch off one monitor then system boots correctly (i don't need to detach the displayport cable, just to switch off the monitor).


When both monitors are connected, most of the times it just crashes as the attached log, sometimes it boots but screen is flickering and with artifacts.

This happened with kernel 5.10 and 5.11, it was fixed i don't remember exactly when, and is happening again. For me it worked with kernel 5.15.8 and failed with 5.15.13.
It is still failing with 5.16.1.

Kind regards and many thanks for your work in the most crucial open-source project.
Comment 1 Alex Deucher 2022-01-21 21:19:11 UTC
Can you bisect to see what broke it and/or what fixed it originally?
Comment 2 Jose Mestre 2022-02-01 09:42:40 UTC
Hello. I've been unable to compile a specific kernel commit (i did not have too much time to find the docs about how to do it) and i don't know C.

I've tried releases for archlinux and i can confirm that linux 5.15.12 worked ok, and 5.15.13 was the first release that make kernel crash with the two monitors switched on.

If you can point me how to do it i can bisect, compile and try the kernels.

Kind regards.
Comment 3 Alex Deucher 2022-02-01 16:22:27 UTC
Here's a howto for doing a bisect:
https://www.kernel.org/doc/html/latest/admin-guide/bug-bisect.html
Here's a howto for building a kernel:
https://kernelnewbies.org/KernelBuild

Basic process:
# create a directly to store your git source
mkdir kernel
# change to that directory
cd kernel
# clone the stable git tree
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
# copy your distros config to use for your build, replace #whatever with
# whatever config your distro is using
cp /boot/config-#whatever .config
# start bisecting
git bisect start
# tag 5.15.13 as bad
git bisect bad v5.15.13
# tag 5.15.2 as good
git bisect good v5.15.12
# build the first kernel to test
make clean
make
make modules_install
make install
# test the new kernel
# if it's good, mark it as good
git bisect good
# if it's bad, mark it as bad
git bisect bad
# build the next kernel to test
make
make modules_install
make install
# test the new kernel
# repeat until the bisect is complete
Comment 4 Jose Mestre 2022-02-03 00:10:49 UTC
0f591d17e36e08313b0c440b99b0e57b47e01a9a is the first bad commit
commit 0f591d17e36e08313b0c440b99b0e57b47e01a9a
Author: Angus Wang <angus.wang@amd.com>
Date:   Thu Dec 9 17:27:01 2021 -0500

    drm/amd/display: Changed pipe split policy to allow for multi-display pipe split
    
    commit ee2698cf79cc759a397c61086c758d4cc85938bf upstream.
    
    [WHY]
    Current implementation of pipe split policy prevents pipe split with
    multiple displays connected, which caused the MCLK speed to be stuck at
    max
    
    [HOW]
    Changed the pipe split policies so that pipe split is allowed for
    multi-display configurations
    
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1522
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1709
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1655
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403
    
    Note this is a backport of this commit from amdgpu drm-next for 5.16.
    
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
    Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
    Signed-off-by: Angus Wang <angus.wang@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c   | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c   | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c   | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
Comment 5 Alex Deucher 2022-02-03 15:07:33 UTC
Created attachment 300385 [details]
possible fix

This patch should fix it.
Comment 6 Jose Mestre 2022-02-03 16:14:01 UTC
Hello, i've tried this patch and it works with 5.15.12#0f591d17e36e08313b0c440b99b0e57b47e01a9a and with 5.17.0-rc2.
Kind regards.
Comment 7 Philipp Riederer 2022-03-01 09:22:40 UTC
Hi!

My Lenovo T14s (AMD) crashes with a panic (https://imgur.com/a/P6Twvov) when I unplug/replug any monitor. This also happens when waking from DPMS.

I have bisected the issue to the same 0f591d17e36e08313b0c440b99b0e57b47e01a9a as Jose. The patch (that is already mainlined, if I see that correctly) does not help.

I have tried all kernel up to 5.15.24 -- I cannot try 5.16 as I use zfs as root device the and zfs module is not (yet) compatible with 5.16.

Is there anything you would like me to try or should my issue be fixed in 5.16+?

Cheers,
Philipp
Comment 8 Alex Deucher 2022-03-01 14:14:24 UTC
(In reply to Philipp Riederer from comment #7)
> Hi!
> 
> My Lenovo T14s (AMD) crashes with a panic (https://imgur.com/a/P6Twvov) when
> I unplug/replug any monitor. This also happens when waking from DPMS.
> 
> I have bisected the issue to the same
> 0f591d17e36e08313b0c440b99b0e57b47e01a9a as Jose. The patch (that is already
> mainlined, if I see that correctly) does not help.
> 
> I have tried all kernel up to 5.15.24 -- I cannot try 5.16 as I use zfs as
> root device the and zfs module is not (yet) compatible with 5.16.
> 
> Is there anything you would like me to try or should my issue be fixed in
> 5.16+?

Please open a new ticket as this is a different issue.
Comment 9 Philipp Riederer 2022-03-01 14:27:31 UTC
Certainly. Thank you!
Comment 10 Alex Deucher 2023-02-28 19:56:32 UTC
Created attachment 303812 [details]
possible fix 1/2
Comment 11 Alex Deucher 2023-02-28 19:57:05 UTC
Created attachment 303813 [details]
possible fix 2/2

Do the two attached patches fix the issue?