lorenz/asrock-x300-s3-fix

iasl error on try to reproduce with X300/4650G

Closed this issue · 5 comments

Z3NOX commented

Thank you for sharing this problem with us and also for the additional information in your blog post! I wanted to take the chance of being a guinea pig, as I have an ASRock X300 with a Renoir CPU (4650G) and BIOS version 1.70 and this problem of not being able to suspend the system is getting on my nerves.

So I thought about trying to reproduce your steps under Arch Linux, installed the dependencies

% pacman -Q linux acpica patch libarchive
linux 5.16.14.arch1-1
acpica 20211217-1
patch 2.7.6-8
libarchive 3.6.0-1 # contains `bsdcpio` which seems to be the successor of `gen_init_cpio` in arch

and while running mkoverride.sh I get the following error from iasl:

% iasl -va -e ssdt1.aml -e ssdt6.aml -d dsdt.aml

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20211217
Copyright (c) 2000 - 2021 Intel Corporation

File appears to be binary: found 7133 non-ASCII characters, disassembling
Binary file appears to be a valid ACPI table, disassembling
Input file dsdt.aml, Length 0x5854 (22612) bytes
ACPI: DSDT 0x0000000000000000 005854 (v02 ALASKA A M I    01072009 INTL 20120913)
External object resolution file        ssdt6.aml
Input file ssdt6.aml, Length 0x10AC (4268) bytes
ACPI: SSDT 0x0000000000000000 0010AC (v01 AMD    ArticTPX 00000001 INTL 20120913)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file        ssdt1.aml
Input file ssdt1.aml, Length 0x723C (29244) bytes
ACPI: SSDT 0x0000000000000000 00723C (v02 AMD    Artic    00000002 MSFT 04000000)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
Pass 1 parse of [DSDT]
Firmware Error (ACPI): Failure creating named object [\_SB.PCI0.GPP6._PRW], AE_ALREADY_EXISTS (20211217/dswload-495)
ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20211217/psobject-372)
Could not parse ACPI tables, AE_ALREADY_EXISTS

So it seems there is some bug in the firmware. Have you also had this issue or do you have an idea what is wrong here in the first place? I checked that TSME is disabled within the BIOS, which is the case. The same error also appears in early boot stage and can be seen in the syslog. Do you have an idea of how to precede further? Thank you in advance!

Apply my patch in this repo to iasl/acpica or use the nix-based setup as described in the README. The ACPI table in the X300 is broken and iasl refuses to disassemble it without being patched.

Z3NOX commented

Oh, I overlooked that part, sorry.
Now I cloned the acpica repo, applied your patch and compiled it. After that everything worked as expected. As another reference the DSDT site in the ArchWiki was also helpful here.

And now my X300 is able to suspend to RAM \o/
[You can hear some minor coil whine but that is ok for me - but maybe this could be a reason, why ASRock deactivated the S3 state in the first place?]

The coil whine is fine from an electrical perspective. There is an RT6585B DC/DC controller for the 5V and 3.3V rails which is permanently powered (needs to be) but there is very little load on it in S3, causing it to operate in discontinous conduction mode and dropping its switching frequency into the audible range. The output capacitors are ceramics with a large piezoelelectric effect causing the whine (it's not caused by coils). Ideally ASRock would have used aluminum polymer or tantalum capacitors (as recommended in the datasheet) instead of ceramics, that would have solved the issue.

Z3NOX commented

Thank you for the additional information, that sounds very interesting to me. So the ceramics capacitors are vibrating in the audible range and one could - in principle - change the capacitors for reducing or eliminating the whine.

The problem is there aren't any non-piezoelectric capacitors with the capacitance required. The only thing I considered doing (but I ended up just putting some thick thermal putty over it) was replacing the caps with Murata KRM-series ceramics. These are available in the same footprint, but are on metal tabs which prevent transfering the vibrations to the PCB. Putting AluPoly capacitors would require redesigning the PCB which is not viable.