Bug 248159

Summary: mpr(4): Unable to suspend to ACPI S3 state
Product: Base System Reporter: Joshua Kinard <freebsd>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: emaste, scottl
Priority: ---    
Version: 12.1-RELEASE   
Hardware: amd64   
OS: Any   

Description Joshua Kinard 2020-07-22 00:37:52 UTC
It looks like the mpr(4) driver w/ an LSI/AVAGO/Broadcom SAS9300-8i won't allow an AMD Ryzen system to enter ACPI S3 state.  I have on system running Ryzen on an ASUS PRIME B450M-A/CSM motherboard, and building a second system using a Gigabyte B450M DS3H motherboard.  Both systems have a SAS9300-8i card in them, and I finally pinned down that removing the SAS card allowed 'acpiconf -s 3' to work and put the system to sleep.

Issue is reproducible on 12.1-RELEASE-p7, 12.1-STABLE (r361761), and 13-CURRENT (r361779).  The only (somewhat) usable error message is "acpi0: device_suspend failed", followed by the system running resume functions (mostly bringing the USB ports back online).

Doing some looking around, it appears the culprit is....by design:

/usr/src/sys/dev/mpr/mpr_pci.c:454

    static int
    mpr_pci_suspend(device_t dev)
    {
            return (EINVAL);
    }

Are there plans to implement mpr_pci_suspend so that this device can be put into S3 state?  are here any SAS/SATA HBA drivers in FreeBSD that support suspend/resume?
Comment 1 Ed Maste freebsd_committer freebsd_triage 2020-07-23 14:58:00 UTC
Presumably we can remove "on Ryzen platform" from the title - this issue is an mpr(4) limitation regardless of platform.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2020-07-23 15:35:08 UTC
(In reply to Joshua Kinard from comment #0)

This code appears to have come in with the initial commit in 2014.

I'm going to Cc: scottl but only because it seems he is the only one actively working on underlying issues like this in this driver.  scottl, feel free to remove yourself from the Cc: if my guess here is wrong.