• Ben Hutchings's avatar
    PCI: MSI: Remove unsafe and unnecessary hardware access · fcd097f3
    Ben Hutchings authored
    During suspend on an SMP system, {read,write}_msi_msg_desc() may be
    called to mask and unmask interrupts on a device that is already in a
    reduced power state.  At this point memory-mapped registers including
    MSI-X tables are not accessible, and config space may not be fully
    functional either.
    
    While a device is in a reduced power state its interrupts are
    effectively masked and its MSI(-X) state will be restored when it is
    brought back to D0.  Therefore these functions can simply read and
    write msi_desc::msg for devices not in D0.
    
    Further, read_msi_msg_desc() should only ever be used to update a
    previously written message, so it can always read msi_desc::msg
    and never needs to touch the hardware.
    Tested-by: default avatar"Michael Chan" <mchan@broadcom.com>
    Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    fcd097f3
msi.c 21 KB