• Rafael J. Wysocki's avatar
    PCI PM: Avoid touching devices behind bridges in unknown state · 73410429
    Rafael J. Wysocki authored
    It generally is better to avoid accessing devices behind bridges that
    may not be in the D0 power state, because in that case the bridges'
    secondary buses may not be accessible.  For this reason, during the
    early phase of resume (ie. with interrupts disabled), before
    restoring the standard config registers of a device, check the power
    state of the bridge the device is behind and postpone the restoration
    of the device's config space, as well as any other operations that
    would involve accessing the device, if that state is not D0.
    
    In such cases the restoration of the device's config space will be
    retried during the "normal" phase of resume (ie. with interrupts
    enabled), so that the bridge can be put into D0 before that happens.
    
    Also, save standard configuration registers of PCI devices during the
    "normal" phase of suspend (ie. with interrupts enabled), so that the
    bridges the devices are behind can be put into low power states (we
    don't put bridges into low power states at the moment, but we may
    want to do it in the future and it seems reasonable to design for
    that).
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    73410429
pci-driver.c 23.4 KB