I have the following root port and device on root port: [root@otc-bromolow power]# lspci -v -s 00:1c.5 00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5) (prog-if 00 [Normal decode]) Flags: bus master, fast devsel, latency 0 Bus: primary=00, secondary=03, subordinate=03, sec-latency=0 Memory behind bridge: c0000000-c18fffff Capabilities: [40] Express Root Port (Slot+), MSI 00 Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit- Capabilities: [90] Subsystem: Intel Corporation Device 7270 Capabilities: [a0] Power Management version 2 Capabilities: [100] Advanced Error Reporting Kernel driver in use: pcieport [root@otc-bromolow power]# lspci -v -s 03:00.0 03:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200e [Pilot] ServerEngines (SEP1) (rev 07) (prog-if 00 [VGA controller]) Subsystem: Intel Corporation Device 0102 Flags: bus master, fast devsel, latency 0, IRQ 11 Memory at c0000000 (32-bit, non-prefetchable) [size=16M] Memory at c1810000 (32-bit, non-prefetchable) [size=16K] Memory at c1000000 (32-bit, non-prefetchable) [size=8M] Expansion ROM at c1800000 [disabled] [size=64K] Capabilities: [dc] Power Management version 2 Capabilities: [e4] Express Legacy Endpoint, MSI 00 Capabilities: [54] MSI: Enable- Count=1/1 Maskable- 64bit- The VGA controller forbids runtime suspend, however, I can still runtime suspend the root port. This causes the VGA controller to stop working. If I then resume the root port (echo on > power/control), the VGA card starts working again. I think the expected behavior should be that if the VGA card is still in use, we should not be able to runtime suspend the root port.
What's in the VGA's power/control file?
on
Created attachment 85301 [details] Debug suspend when children forbidden Kristen, Could you try the patch?
Created attachment 86621 [details] Keep runtime PM enabled for unbound PCI devices Hi, Kristen, Can you try the patch attached?
Kristen, can you respond, please?
So, it kind of works. Now when I switch the PCIe root port device control file to auto, the root port stays not suspended. However, it appears that a side effect of this patch is that I can now go and enable runtime PM for the unbound VGA device, and it suspends right away, even while I am using it (i.e. displaying something). I would expect it to stay active while it is being used. I suspect the proper behavior is to mark VGA devices which are unbound as always active.
We intentionally let user space control the PM of devices without drivers (in the kernel) and yes, it can do as you describe. And no, we can't generally mark unbound VGA devices as always active, because (1) we don't distinguish between VGA and other devices and (2) users may actually want to power them down (think of a headless machine, for example). So, do I understand correctly that the patch fixes the problem you originally reported?
A patch referencing this bug report has been merged in Linux v3.8-rc1: commit 967577b062417b4e4b8e27b711220f4124f5153a Author: Huang Ying <ying.huang@intel.com> Date: Tue Nov 20 16:08:22 2012 +0800 PCI/PM: Keep runtime PM enabled for unbound PCI devices