|
@@ -399,10 +399,6 @@ static int sriov_init(struct pci_dev *dev, int pos)
|
|
ssleep(1);
|
|
ssleep(1);
|
|
}
|
|
}
|
|
|
|
|
|
- pci_read_config_word(dev, pos + PCI_SRIOV_TOTAL_VF, &total);
|
|
|
|
- if (!total)
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
ctrl = 0;
|
|
ctrl = 0;
|
|
list_for_each_entry(pdev, &dev->bus->devices, bus_list)
|
|
list_for_each_entry(pdev, &dev->bus->devices, bus_list)
|
|
if (pdev->is_physfn)
|
|
if (pdev->is_physfn)
|
|
@@ -420,6 +416,10 @@ found:
|
|
if (!offset || (total > 1 && !stride))
|
|
if (!offset || (total > 1 && !stride))
|
|
return -EIO;
|
|
return -EIO;
|
|
|
|
|
|
|
|
+ pci_read_config_word(dev, pos + PCI_SRIOV_TOTAL_VF, &total);
|
|
|
|
+ if (!total)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
pci_read_config_dword(dev, pos + PCI_SRIOV_SUP_PGSIZE, &pgsz);
|
|
pci_read_config_dword(dev, pos + PCI_SRIOV_SUP_PGSIZE, &pgsz);
|
|
i = PAGE_SHIFT > 12 ? PAGE_SHIFT - 12 : 0;
|
|
i = PAGE_SHIFT > 12 ? PAGE_SHIFT - 12 : 0;
|
|
pgsz &= ~((1 << i) - 1);
|
|
pgsz &= ~((1 << i) - 1);
|