Mark Kettenis <mark.kette...@xs4all.nl> writes: > Certainly looks like a smoking gun to me. > > One thing to look at is amdgpu_acpi_is_s0ix_active() in > dev/pci/drm/amd/amdgpu/amdgpu_acpi.c. That function should return > true, but may be returning false because we don't #define CONFIG_AMD_PMC. > So maybe try what happens if you force that function to return true.
The patch below doesn't seem to have any effect. I still see the same unfinished sleep the second time around. The last dmesg entry then is still > config_suspend: wsdisplay0 0 At that point acpi0's WCHAN is dmafenc: 0 53191 0 1 -22 0 0 0 dmafenc DK ?? 0:23.66 (acpi0) X is in kqread: 0 84130 1 6 18 0 1012 1952 sigsusp I ?? 0:00.00 /usr/X11R6/bin/xenodm 35 81802 84130 0 2 0 68936 97272 kqread I ?? 0:00.75 /usr/X11R6/bin/X :0 vt05 -auth /etc/X11/xenodm/authdir/authfiles/A:0-InfYGC (Xorg) 0 48574 81802 3 2 0 2976 1468 sbwait IpU ?? 0:00.00 X: [priv] (Xorg) 0 81121 1 20 2 0 972 1032 sbwait I ?? 0:00.00 /usr/X11R6/bin/xconsole 35 33692 1 0 2 0 1320 3692 kqread Ip ?? 0:00.80 /usr/X11R6/bin/xconsole Per deraadt@ suggestion I used `pkill X` to see what happens: 0 48574 81802 0 -22 0 0 0 - Zp ?? 0:00.00 (Xorg) 0 84130 1 0 18 0 1012 1960 sigsusp I ?? 0:00.00 /usr/X11R6/bin/xenodm 35 81802 84130 0 0 0 66868 95332 drmioc D ?? 0:00.76 /usr/X11R6/bin/X :0 vt05 -auth /etc/X11/xenodm/authdir/authfiles/A:0-InfYGC (Xorg) No otherwise observable symptoms besides X becoming D. When zzz is not anywhere in the picture, kill'ing X over ssh leads to its normal restart. I'll try to run other experiments with not having started X at all. modified sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c @@ -1514,10 +1514,10 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { if (!(adev->flags & AMD_IS_APU) || (pm_suspend_target_state != PM_SUSPEND_TO_IDLE)) - return false; + return true; if (adev->asic_type < CHIP_RAVEN) - return false; + return true; /* * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally @@ -1529,13 +1529,13 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) dev_err_once(adev->dev, "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n" "To use suspend-to-idle change the sleep mode in BIOS setup.\n"); - return false; + return true; } #if !IS_ENABLED(CONFIG_AMD_PMC) dev_err_once(adev->dev, "Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n"); - return false; + return true; #else return true; #endif /* CONFIG_AMD_PMC */