• Ivan Kokshaysky's avatar
    [PATCH] PCI: probing read-only BARs · 1307ef66
    Ivan Kokshaysky authored
    Some pci devices may have base address registers locked with non-zero values.
    Examples:
    - AGP aperture BAR of AMD-7xx host bridges: if the AGP window disabled,
      this BAR is read-only and read as 0x00000008;
    - BAR0-4 of ALi IDE controllers can be non-zero and read-only.
    
    Obviously, we can't calculate correct size of the respective region in
    this case (for AMD AGP window we'll get 4 GB resource - ouch).
    So I think that we should ignore r/o BARs (let the device specific
    fixups deal with them if needed).
    
    Patch appended (note that extra write(0)/read-back pair is required,
    as the BAR might be programmed with all 1s).
    1307ef66
probe.c 16.6 KB