Merge tag 'regulator-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
[cascardo/linux.git] / drivers / pci / iov.c
index 1fe2d6f..9dce7c5 100644 (file)
@@ -84,6 +84,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
        virtfn->dev.parent = dev->dev.parent;
        virtfn->physfn = pci_dev_get(dev);
        virtfn->is_virtfn = 1;
+       virtfn->multifunction = 0;
 
        for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
                res = dev->resource + PCI_IOV_RESOURCES + i;
@@ -441,6 +442,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
 
 found:
        pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, ctrl);
+       pci_write_config_word(dev, pos + PCI_SRIOV_NUM_VF, 0);
        pci_read_config_word(dev, pos + PCI_SRIOV_VF_OFFSET, &offset);
        pci_read_config_word(dev, pos + PCI_SRIOV_VF_STRIDE, &stride);
        if (!offset || (total > 1 && !stride))