https://bugzilla.kernel.org/show_bug.cgi?id=222340

            Bug ID: 222340
           Summary: GALAX H510M: hard freeze in acpi_init() unless static
                    SSDTs are skipped; culprit is the PEG1 PowerResource
                    _OFF in SSDT "RklS_Rvp"
           Product: ACPI
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Power-Other
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Created attachment 311610
  --> https://bugzilla.kernel.org/attachment.cgi?id=311610&action=edit
Kernel 7.3.6 log with patched SSDT4 override (no acpi_no_static_ssdt);
anonymized, USB/net/audio lines removed

Kernel: 7.3.6-300.fc45.x86_64 (Fedora 45)
Hardware: GALAX H510M (board version G10a), Intel Core i7-10700F (Comet Lake-S
CPU on an H510 / 500-series PCH), NVIDIA RTX 4060 in PEG0
BIOS: American Megatrends International 5.19, 04/21/2021 (no newer useful BIOS
available)
DMI: sys_vendor=GALAX, board_vendor=GALAX, board_name=H510M,
product_name=H510M, bios_version=5.19, bios_date=04/21/2021

== Summary ==

With default parameters the machine freezes completely during acpi_init()
(even the hardware reset button has no effect; a long press of the power
button is required). The last message is:

    ACPI: PCI: Interrupt link LNKH configured for IRQ 0

With initcall_debug, acpi_init never returns. Booting with
acpi_no_static_ssdt works (16 CPUs, NVIDIA driver, network all fine).
Not helpful: TPM/PTT off, Legacy USB off, intel_iommu=off, nox2apic,
hpet=disable, pci=nommconf, maxcpus=1, C-state limits. acpi=off boots but
with 1 CPU only; acpi=noirq/noapic leave the legacy PIRQ routing unusable.

The firmware ships 11 SSDTs, most of them copied from an Intel reference
board (RVP): CpuSsdt, SaSsdt, IgfxSsdt, RklS_Rvp, Ther_Rvp, xh_rksu4,
DTbtSsdt, PtidDevc, TbtTypeC, UsbCTabl, ADebTabl.

== Root cause (bisected) ==

Starting from the SSDT I suspected most (RklS_Rvp: reference-board power
resources, GPIO and PCIe clock handling), I replaced it and later parts of it
using the kernel's ACPI table upgrade from the
initrd (same signature, OEM ID, OEM Table ID, higher OEM revision), booting
without acpi_no_static_ssdt, one change per boot (cold boots, except one
intermediate test done via kexec; the final fix was verified from a cold boot).

1. Replacing only SSDT ALASKA RklS_Rvp with an empty table: boots.
2. Recompiling the real RklS_Rvp (disassembled with iasl 20260930 from an
   acpidump taken under Windows) and turning every PowerResource _OFF
   (21 of them) into Return (Zero): boots. Bisecting those 21 narrows it to
   the _OFF of the PXP PowerResource in \_SB.PC00.PEG1. Note: Linux only
   enumerates 00:01.0 (PEG0, holding the GPU); there is no 00:01.1 in
   lspci, so PEG1 is not a PCI device Linux sees. I have not determined why
   the VDID == 0xFFFFFFFF early return does not trigger there (the
   statements below demonstrably execute, since removing them removes the
   freeze).
3. Inside that method:

    Method (_OFF, 0, NotSerialized)   // PEG1.PXP
    {
        If ((VDID == 0xFFFFFFFF)) { Return (Zero) }
        DL23 ()
        POFF ()
    }
    Method (POFF, 0, NotSerialized)
    {
        Divide (LNRD, 0x03E8, Local0, Local1)
        Sleep (Local1)
        \PIN.ON (RSTG)                    // RSTG = { P1RE, P1RP } 
(GNVS-provided GPIO)
        If (CondRefOf (SCLK)) { SPCO (SCLK, Zero) }     // SCLK = 0x07
        If (CondRefOf (PWRG)) { ... \PIN.OFF (PWRG) ... }   // PWRG = { P1PE,
P1PP }
        If (CondRefOf (WAKG)) { ... \_SB.SHPO (WAKG, Zero) } // WAKG = P1WP
    }

Results per test (PEG1 PXP._OFF; "neutralized" = statement replaced by
Noop; every test booted without acpi_no_static_ssdt):

Test table (executing / neutralized -> result):
  - executing: DL23 only | neutralized: RSTG, SCLK, PWRG, WAKG -> freeze
  - executing: RSTG only | neutralized: DL23, SCLK, PWRG, WAKG -> freeze
  - executing: PWRG only | neutralized: DL23, RSTG, SCLK, WAKG -> boots
  - executing: none (Divide/Sleep still run) | neutralized: all five -> boots
  - executing: SCLK, PWRG, WAKG | neutralized: DL23, RSTG -> freeze
  - executing: PWRG, WAKG | neutralized: DL23, RSTG, SCLK -> boots (minimum fix
found)

Conclusion: DL23 () and \PIN.ON (RSTG) each hang the machine on their
own; with only those two removed it still freezes, so SPCO (SCLK, Zero) (the
DSDT's "PCIe ClkReq Override" helper) is also harmful. I did not test SPCO
in isolation. \PIN.OFF (PWRG) and \_SB.SHPO (WAKG, Zero) are harmless.

Why this is probably hit at boot: I believe it is the kernel evaluating _OFF
of power resources that are not in use (acpi_turn_off_unused_power_resources()
during ACPI scan), but I did not trace the call path.
My (unverified) interpretation: P1RE/P1RP/P1PE/P1PP/P1WP are GPIO pad numbers
filled into GNVS by the BIOS from the Intel reference-board layout, and on the
GALAX H510M these pads/clocks are wired differently (or the slot does not
exist),
so driving them hangs the platform. I have not read the GNVS values or the pad
configuration, so the exact pin/clock being hit is unknown.

== Workaround in use ==

A patched copy of SSDT RklS_Rvp (same IDs, OEM revision +0x10000) with those
three statements replaced by Noop, loaded through ACPI table upgrade in the
initramfs (dracut acpi_override=yes). acpi_no_static_ssdt is no longer
needed; all 16 CPUs, the NVIDIA GPU and networking work.

Side note (probably unrelated to the freeze): the firmware also defines
duplicate objects between the SSDT and DSDT, e.g.
\_SB.PC00.PEG1.{LNRD,UPRD,_S0W,_DSW,_PR0,_PR3} and
\_SB.PC00.PEG0.PEGP._DSD (the latter seen in an acpiexec run) give
AE_ALREADY_EXISTS, and LNKA..H._CRS
returns the IRQ number instead of a bit mask (harmless in APIC mode).

== Request ==

Could a DMI quirk for this board be considered (match
board_vendor=GALAX, board_name=H510M, bios_version=5.19), for example
making the kernel skip evaluating _OFF of unused power resources on it, or
otherwise avoiding the PEG1 _OFF? I am a user, not a kernel developer, so
please point me to the right mechanism if a different approach is preferred
(and I can test patches).

== Attachments ==

- acpi.dat: acpidump of all tables, taken under Windows (the Linux sysfs tables
lack the SSDTs when booting with acpi_no_static_ssdt). A Windows-side dump can
differ from what Linux sees if tables depend on _OSI; the override matched in
the kernel log, so the table identity is right.
- ssdt4-original.dsl: disassembled RklS_Rvp (iasl 20260930)
- ssdt4-patched.dsl: same, with DL23, PIN.ON(RSTG) and SPCO(SCLK,0) replaced by
Noop in PEG1 PXP._OFF
- dmesg-minimal.txt: kernel log of a boot with the workaround (hostname, UUIDs,
MACs and peripherals removed). It shows Table Upgrade: override
[SSDT-ALASKA-RklS_Rvp].
- lspci-nn.txt: lspci -nn

If requested, I can provide a boot log of the freeze (no serial or netconsole
available; the machine stops responding right after the LNKH line).

---
Solved by Claude Sonnet 5.5

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
acpi-bugzilla mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/acpi-bugzilla

Reply via email to