• Bjorn Helgaas's avatar
    PCI: Add comments about ROM BAR updating · 0b457dde
    Bjorn Helgaas authored
    pci_update_resource() updates a hardware BAR so its address matches the
    kernel's struct resource UNLESS it's a disabled ROM BAR.  We only update
    those when we enable the ROM.
    
    It's not obvious from the code why ROM BARs should be handled specially.
    Apparently there are Matrox devices with defective ROM BARs that read as
    zero when disabled.  That means that if pci_enable_rom() reads the disabled
    BAR, sets PCI_ROM_ADDRESS_ENABLE (without re-inserting the address), and
    writes it back, it would enable the ROM at address zero.
    
    Add comments and references to explain why we can't make the code look more
    rational.
    
    The code changes are from 755528c8 ("Ignore disabled ROM resources at
    setup") and 8085ce08 ("[PATCH] Fix PCI ROM mapping").
    
    Link: https://lkml.org/lkml/2005/8/30/138Signed-off-by: 's avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: 's avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    0b457dde