Solved pci_release_msi fails power management (S3)

I use the following call sequence to request MSI-X interrupt resource when loading device driver, and it's working:
  • bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE)
  • pci_msix_count
  • pci_alloc_msix
  • bus_alloc_resource(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE)
  • bus_setup_intr
Then I use the following call sequence to free MSI-X interrupt resource when unloading device driver, and it's also working:
  • bus_teardown_intr
  • bus_release_resource(dev, SYS_RES_IRQ, rid, irqRes);
  • pci_release_msi
  • bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), barRes[0])

However, I encountered problems when testing power management (S3).
I use the following call sequence to free MSI-X interrupt resource when suspending to RAM:
  • bus_teardown_intr
  • bus_release_resource(dev, SYS_RES_IRQ, rid, irqRes);
  • pci_release_msi

I observed "sudo acpiconf -s 3" is NOT able to suspend system to RAM.
I also observed: if NOT calling pci_release_msi, then "sudo acpiconf -s 3" is able to suspend system to RAM.
Can advice what is the cause of the problem?
Thanks in advance.
 
As with previous questions, check what existing drivers do.

Having looked at several, I don't see any special handling required for suspend -- what happens if you don't do anything as well?
 
As with previous questions, check what existing drivers do.

Having looked at several, I don't see any special handling required for suspend -- what happens if you don't do anything as well?
Thanks yuripv79.
You are correct.
I tried: "when suspending, NOT freeing IRQ; then when resuming, NOT requesting IRQ"
It's working.
Thanks a lot.
 
Back
Top