Radeon R5 Graphics, Radeon HD 7340 and others emit spurious HDMI unplug events
Brief summary of the problem:
After login on Chrome OS, an HDMI unplug event fires even though no unplug occurs. cat /proc/asound/card0/eld#0.0
shows the device as unplugged, though it was plugged prior to completing login. Notably Chrome OS more or less does a full graphics restart upon login, and though I'm not sure I suspect that's why I haven't been able to reproduce the issue so far on other distros. The issue is present on several radeon machines; the two I've done the most testing on are detailed below.
I noticed removing the call to radeon_audio_component_init() outright resolved the issue for me:
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index afbb3a80c0c6..7913995486b8 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1453,7 +1453,7 @@ int radeon_device_init(struct radeon_device *rdev,
goto failed;
}
- radeon_audio_component_init(rdev);
+ //radeon_audio_component_init(rdev);
r = radeon_ib_ring_tests(rdev);
if (r)
@@ -1517,7 +1517,7 @@ void radeon_device_fini(struct radeon_device *rdev)
rdev->shutdown = true;
/* evict vram memory */
radeon_bo_evict_vram(rdev);
- radeon_audio_component_fini(rdev);
+ //radeon_audio_component_fini(rdev);
radeon_fini(rdev);
if (!pci_is_thunderbolt_attached(rdev->pdev))
vga_switcheroo_unregister_client(rdev->pdev);
Hardware description:
- CPU: AMD E2-2000 APU with Radeon(tm) HD Graphics, also AMD A8-7100 Radeon R5
- GPU: Radeon HD 7340, also Radeon R5 Graphics
- System Memory: 8G, also 4G
- Display(s): 1080p HDMI and internal laptop display for both
- Type of Display Connection: HDMI for both
System information:
- Distro name and Version: Any Chrome OS with the kernel commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=20ea34710f7b20e218a42d457da618d99e3fc9d6
- Kernel version: See above
- AMD official driver version: https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+/refs/heads/master/radeon/
How to reproduce the issue:
The issue appears to occur when restarting a graphics session with an external HDMI monitor. The affected machines are both laptops.
Proposed Kernel change
I have a proposed change (not the above code) based on #1569 (comment 1603002) .
See https://lore.kernel.org/all/20241115-hdmi-audio-radeon-connectors-v1-1-d6d66d3128dd@chromium.org