Re: [REGRESSION] AMD HDMI/DP audio broken after suspend since commit 50e0bae34fa6

2025-09-08 Thread Przemysław Kopa

On 9/5/25 05:37, Mario Limonciello wrote:


Have a try with this diff on 6.17-rc4.


I confirm that the issue goes away after applying this patch.


Re: [REGRESSION] AMD HDMI/DP audio broken after suspend since commit 50e0bae34fa6

2025-09-07 Thread Mario Limonciello

On 9/4/2025 8:03 AM, Przemysław Kopa wrote:

I'm attaching two new dmesg logs.


Sorry, I attached wrong files to my previous message. The proper ones 
are attached to this one.


I'm guessing what's going on is a race between the HDMI device going to 
D3 through snd-hda-intel (which provides HDMI) and the prepare() callback.


The easiest solution will be to drop the prepare() and complete() 
callbacks, but I will need to think about this because we had a variety 
of reasons for adding them.


Have a try with this diff on 6.17-rc4.

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index a0ca3b2c6bd8..d83aeeaf5653 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3127,25 +3127,6 @@ static void dm_destroy_cached_state(struct 
amdgpu_device *adev)

dm->cached_state = NULL;
 }

-static void dm_complete(struct amdgpu_ip_block *ip_block)
-{
-   struct amdgpu_device *adev = ip_block->adev;
-
-   dm_destroy_cached_state(adev);
-}
-
-static int dm_prepare_suspend(struct amdgpu_ip_block *ip_block)
-{
-   struct amdgpu_device *adev = ip_block->adev;
-
-   if (amdgpu_in_reset(adev))
-   return 0;
-
-   WARN_ON(adev->dm.cached_state);
-
-   return dm_cache_state(adev);
-}
-
 static int dm_suspend(struct amdgpu_ip_block *ip_block)
 {
struct amdgpu_device *adev = ip_block->adev;
@@ -3571,10 +3552,8 @@ static const struct amd_ip_funcs amdgpu_dm_funcs = {
.early_fini = amdgpu_dm_early_fini,
.hw_init = dm_hw_init,
.hw_fini = dm_hw_fini,
-   .prepare_suspend = dm_prepare_suspend,
.suspend = dm_suspend,
.resume = dm_resume,
-   .complete = dm_complete,
.is_idle = dm_is_idle,
.wait_for_idle = dm_wait_for_idle,
.check_soft_reset = dm_check_soft_reset,


Re: [REGRESSION] AMD HDMI/DP audio broken after suspend since commit 50e0bae34fa6

2025-09-03 Thread Mario Limonciello

On 9/3/25 7:21 AM, Przemysław Kopa wrote:

On 9/3/25 05:35, Mario Limonciello wrote:

Given it's not a 100% reproduce for you, how did you confirm this 
commit is causing the issue?  Some sort of sampling of X cycles at 
each bisect point?


Yes, I've tried a couple of times to trigger this issue on each 
bisection point (by doing suspend -> resume cycle), and if I wasn't able 
to trigger it, I've assumed it's good and moved on. I think I got the 
right commit in the end, since now I have two kernels that are a single 
commit apart (50e0bae34fa6), and I am able to trigger the issue when 
running kernel with 50e0bae34fa6 applied, but am not able to trigger it 
when running kernel without 50e0bae34fa6 (and I tried a lot ;).


Could you capture a dmesg log where /sys/power/pm_debug_messages is 
set both from a good case and from a bad case so we can compare?


I'm attaching two dmesg dumps, running 6.17-rc4, fresh boot with a 
single suspend -> resume cycle within each file.


'dmesg_dp_audio_good.txt' - sound is fine after resume
'dmesg_dp_audio_bad.txt' - no sound after resume


I compared the two of them.
There are different problems you have with USB during recovery in the 
bad, but I don't think that's relevant.
The only thing different from a display perspective is a slight 
difference to the timing.


Can you repeat once more with /sys/power/pm_debug_messages and 
/sys/power/pm_print_times set for good and bad?  I want to make sure the 
device suspend order is identical.


Also; does playing audio leading up to the suspend cycle influence 
anything (both on good and bad kernel)?


Re: [REGRESSION] AMD HDMI/DP audio broken after suspend since commit 50e0bae34fa6

2025-09-02 Thread Mario Limonciello

On 8/31/2025 5:12 AM, Przemysław Kopa wrote:

Hello,

I'm running Radeon RX 9060 XT and since upgrading to the kernel 6.15 I'm
facing an issue with audio via DisplayPort. After waking from S3 suspend
(sometimes, but not always) audio doesn't work - pavucontrol shows that
the output is disconnected and I don't get sound from my display. If I
manually reselect the Digital/HDMI output in pavucontrol after resume,
sound starts working again. Besides my main screen, GPU is also
connected (via HDMI) to a TV set - I've found out that this issue occurs
more often if the TV is on (not displaying output from GPU) when I put
my PC to sleep and I turn the TV off before resuming PC.

The issue persists on the current mainline kernel (6.17-rc3).

I've bisected it and this is the commit that introduced the issue:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=50e0bae34fa6b8b18e13473ddf0bcdab6ab68310

I've also found a similar report on the alsa mailing list:
https://lore.kernel.org/alsa-devel/[email protected]/

I'm running Arch Linux with pipewire and wireplumber. The following is
an excerpt from the WirePlumber log after bad resume:

D spa.alsa [alsa-util.c:1996:pa_alsa_get_hdmi_eld]: ELD info empty (for 
device=7)
I spa.alsa [alsa-acp-device.c:893:card_props_changed]: card properties changed
D spa.alsa [acp.c:760:report_jack_state]: Jack 'HDMI/DP,pcm=7 Jack' is now 
unplugged
I spa.alsa [alsa-acp-device.c:975:card_port_available]: card port hdmi-output-1 
available yes -> no
I spa.alsa [acp.c:702:profile_set_available]: Profile output:hdmi-stereo-extra1 
available yes -> no
I spa.alsa [alsa-acp-device.c:941:card_profile_available]: card profile 
output:hdmi-stereo-extra1 available yes -> no

Please let me know what additional information I might provide to
pinpoint this issue.

Thanks,
Przemysław Kopa



Given it's not a 100% reproduce for you, how did you confirm this commit 
is causing the issue?  Some sort of sampling of X cycles at each bisect 
point?


Could you capture a dmesg log where /sys/power/pm_debug_messages is set 
both from a good case and from a bad case so we can compare?


The peculiar thing is this commit only changes the timing of some of the 
suspend sequence, and as part of the suspend sequence the GPU is reset 
anyway.  So during the resume sequence it shouldn't have mattered what 
happened the last time on suspend entry.


Thanks,


[REGRESSION] AMD HDMI/DP audio broken after suspend since commit 50e0bae34fa6

2025-08-31 Thread Przemysław Kopa
Hello,

I'm running Radeon RX 9060 XT and since upgrading to the kernel 6.15 I'm
facing an issue with audio via DisplayPort. After waking from S3 suspend
(sometimes, but not always) audio doesn't work - pavucontrol shows that
the output is disconnected and I don't get sound from my display. If I
manually reselect the Digital/HDMI output in pavucontrol after resume,
sound starts working again. Besides my main screen, GPU is also
connected (via HDMI) to a TV set - I've found out that this issue occurs
more often if the TV is on (not displaying output from GPU) when I put
my PC to sleep and I turn the TV off before resuming PC.

The issue persists on the current mainline kernel (6.17-rc3).

I've bisected it and this is the commit that introduced the issue:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=50e0bae34fa6b8b18e13473ddf0bcdab6ab68310

I've also found a similar report on the alsa mailing list:
https://lore.kernel.org/alsa-devel/[email protected]/

I'm running Arch Linux with pipewire and wireplumber. The following is
an excerpt from the WirePlumber log after bad resume:

D spa.alsa [alsa-util.c:1996:pa_alsa_get_hdmi_eld]: ELD info empty (for 
device=7)
I spa.alsa [alsa-acp-device.c:893:card_props_changed]: card properties changed
D spa.alsa [acp.c:760:report_jack_state]: Jack 'HDMI/DP,pcm=7 Jack' is now 
unplugged
I spa.alsa [alsa-acp-device.c:975:card_port_available]: card port hdmi-output-1 
available yes -> no
I spa.alsa [acp.c:702:profile_set_available]: Profile output:hdmi-stereo-extra1 
available yes -> no
I spa.alsa [alsa-acp-device.c:941:card_profile_available]: card profile 
output:hdmi-stereo-extra1 available yes -> no

Please let me know what additional information I might provide to
pinpoint this issue.

Thanks,
Przemysław Kopa