Skip to content
  • Huang Ying's avatar
    PCI/PM: Keep runtime PM enabled for unbound PCI devices · 967577b0
    Huang Ying authored
    For unbound PCI devices, what we need is:
    
     - Always in D0 state, because some devices do not work again after
       being put into D3 by the PCI bus.
    
     - In SUSPENDED state if allowed, so that the parent devices can still
       be put into low power state.
    
    To satisfy these requirements, the runtime PM for the unbound PCI
    devices are disabled and set to SUSPENDED state.  One issue of this
    solution is that the PCI devices will be put into SUSPENDED state even
    if the SUSPENDED state is forbidden via the sysfs interface
    (.../power/control) of the device.  This is not an issue for most
    devices, because most PCI devices are not used at all if unbound.
    But there are exceptions.  For example, unbound VGA card can be used
    for display, but suspending its parents makes it stop working.
    
    To fix the issue, we keep the runtime PM enabled when the PCI devices
    are unbound.  But the runtime PM callbacks will do nothing if the PCI
    devices are unbound.  This way, we can put the PCI devices into
    SUSPENDED state without putting the PCI devices into D3 state.
    
    Reference: https://bugzilla.kernel.org/show_bug.cgi?id=48201
    
    
    Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    CC: stable@vger.kernel.org          # v3.6+
    967577b0