How do I transition an arbitrary PCIe device from the D0 state (powered on) to the D3 cold 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 way to put a device into D3 cold. I am aware that certain device drivers will put the PCIe device into that state under certain conditions, such as power saving, but I would like to find a way to force it for any arbitrary device. If my understanding of the specifications are correct, then any to-spec PCIe device should support D3 cold.