How do I transition an arbitrary PCIe device from the D0 state (powered on) to the D3cold state (no current to the device) using common utilities on a Linux system? Presumably this involves writing to a sysfs file, but other methods that may be more involved are welcome too, as long as they can be done in userspace. This question is based on another one regarding power cycling.
I am specifically looking for a hardware-agnostic (x86 at least) way to put a device into D3cold.
Assume that /sys/bus/pci/devices/*/d3cold_allowed is 1.
Note: I'm aware that a PCI function can't be put into D3cold on its own, so I suppose a better way to phrase this would be "How can I put a specific PCIe device's bus into the L3 state?".