|
@@ -436,8 +436,15 @@ found:
|
|
|
nres = 0;
|
|
|
for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
|
|
|
res = &dev->resource[i + PCI_IOV_RESOURCES];
|
|
|
- bar64 = __pci_read_base(dev, pci_bar_unknown, res,
|
|
|
- pos + PCI_SRIOV_BAR + i * 4);
|
|
|
+ /*
|
|
|
+ * If it is already FIXED, don't change it, something
|
|
|
+ * (perhaps EA or header fixups) wants it this way.
|
|
|
+ */
|
|
|
+ if (res->flags & IORESOURCE_PCI_FIXED)
|
|
|
+ bar64 = (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
|
|
|
+ else
|
|
|
+ bar64 = __pci_read_base(dev, pci_bar_unknown, res,
|
|
|
+ pos + PCI_SRIOV_BAR + i * 4);
|
|
|
if (!res->flags)
|
|
|
continue;
|
|
|
if (resource_size(res) & (PAGE_SIZE - 1)) {
|