• Bjorn Helgaas's avatar
    PCI: disable MEM decoding while updating 64-bit MEM BARs · 9aac537e
    Bjorn Helgaas authored
    When we update 64-bit BARs, we have to perform two config writes.  Between
    the writes, the half-written BAR value could match a MEM access intended
    for another device.  This could result in corruption of this device (for
    writes) or an unexpected response machine check (for reads).
    
    To prevent this, disable MEM decoding while updating such BARs.  This uses
    the same safety test as 253d2e54, which disables both MEM and IO while
    sizing BARs, namely, we don't disable decoding for host bridge devices.
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    9aac537e
setup-res.c 8.8 KB