# ACPI suspend to ram (s3) fails



## ap2020 (Apr 20, 2021)

Command used:
acpiconf -s 3

The callback function in the driver is invoked as expected. However, free IRQ vector is failing with the following message and ending with a reboot.

freebsd-version
12.1-RELEASE

$ sysctl hw.acpi.supported_sleep_state
hw.acpi.supported_sleep_state: S3 S4 S5

-- dmesg output --
...
driver: PCIe PM: Device 0 (BusId: 0000:01:00.0) on card 0 detected a Power Management Suspend event. The SDK is attempting to suspend the device.
driver: DRV_freeirqMsix[160]: msixCount = 130
panic: apic_free_vector: Thread already bound. 
cpuid = 0
time = 1618829934
KDB: stack backtrace:
#0 0xffffffff80c1d297 at kdb_backtrace+0x67
#1 0xffffffff80bd05cd at vpanic+0x19d
#2 0xffffffff80bd0423 at panic+0x43
#3 0xffffffff81218e00 at native_lapic_enable_pmc+0
#4 0xffffffff8122133f at msix_release+0xcf
#5 0xffffffff8081aeea at pci_release_msi_method+0x20a
#6 0xffffffff82885b89 at DRV_freeirqMsix+0x169
#7 0xffffffff82884668 at DRV_Suspend+0x128
#8 0xffffffff80c0d534 at bus_generic_suspend_child+0x44
#9 0xffffffff808217e8 at pci_suspend_child+0x38
#10 0xffffffff80c0d617 at bus_generic_suspend+0x67
#11 0xffffffff80c0d534 at bus_generic_suspend_child+0x44
#12 0xffffffff80c0d617 at bus_generic_suspend+0x67
#13 0xffffffff80c0d534 at bus_generic_suspend_child+0x44
#14 0xffffffff808217e8 at pci_suspend_child+0x38
#15 0xffffffff80c0d617 at bus_generic_suspend+0x67
#16 0xffffffff80c0d534 at bus_generic_suspend_child+0x44
#17 0xffffffff80c0d617 at bus_generic_suspend+0x67
Uptime: 20m7s
(ada0:ahcich0:0:0:0): FLUSHCACHE48. ACB: ea 00 00 00 00 40 00 00 00 00 00 00
(ada0:ahcich0:0:0:0): CAM status: Command timeout
(ada0:ahcich0:0:0:0): Error 5, Retries exhausted
(ada0:ahcich0:0:0:0): Synchronize cache failed

...
---<<BOOT>>---

Additional info:
DRV_freeirqMsix is doing the following for each registered IRQ:
bus_teardown_intr(...)
bus_release_resource(...)
pci_release_msi(...)

Suspend function in the driver:
Calls the DRV_freeirqMsix(...)
pci_disable_busmaster()


----------



## Alexander88207 (Apr 20, 2021)

Hello ap2020,

FreeBSD 12.1 is EOL, please update to a newer supported version.









						Unsupported FreeBSD Releases
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org


----------

