PCI: Remove reset argument from pci_iov_{add,remove}_virtfn()
The "reset" argument passed to pci_iov_add_virtfn() and pci_iov_remove_virtfn() is always zero since 46cb7b1bd86f ("PCI: Remove unused SR-IOV VF Migration support") Remove the argument together with the associated code. Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Russell Currey <ruscur@russell.cc>
This commit is contained in:
parent
9e66317d3c
commit
753f612471
@ -441,7 +441,7 @@ static void *eeh_add_virt_device(void *data, void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PPC_POWERNV
|
#ifdef CONFIG_PPC_POWERNV
|
||||||
pci_iov_add_virtfn(edev->physfn, pdn->vf_index, 0);
|
pci_iov_add_virtfn(edev->physfn, pdn->vf_index);
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -499,7 +499,7 @@ static void *eeh_rmv_device(void *data, void *userdata)
|
|||||||
#ifdef CONFIG_PPC_POWERNV
|
#ifdef CONFIG_PPC_POWERNV
|
||||||
struct pci_dn *pdn = eeh_dev_to_pdn(edev);
|
struct pci_dn *pdn = eeh_dev_to_pdn(edev);
|
||||||
|
|
||||||
pci_iov_remove_virtfn(edev->physfn, pdn->vf_index, 0);
|
pci_iov_remove_virtfn(edev->physfn, pdn->vf_index);
|
||||||
edev->pdev = NULL;
|
edev->pdev = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -113,7 +113,7 @@ resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
|
|||||||
return dev->sriov->barsz[resno - PCI_IOV_RESOURCES];
|
return dev->sriov->barsz[resno - PCI_IOV_RESOURCES];
|
||||||
}
|
}
|
||||||
|
|
||||||
int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
|
int pci_iov_add_virtfn(struct pci_dev *dev, int id)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int rc = -ENOMEM;
|
int rc = -ENOMEM;
|
||||||
@ -157,9 +157,6 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
|
|||||||
BUG_ON(rc);
|
BUG_ON(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset)
|
|
||||||
__pci_reset_function(virtfn);
|
|
||||||
|
|
||||||
pci_device_add(virtfn, virtfn->bus);
|
pci_device_add(virtfn, virtfn->bus);
|
||||||
|
|
||||||
pci_bus_add_device(virtfn);
|
pci_bus_add_device(virtfn);
|
||||||
@ -187,7 +184,7 @@ failed:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pci_iov_remove_virtfn(struct pci_dev *dev, int id, int reset)
|
void pci_iov_remove_virtfn(struct pci_dev *dev, int id)
|
||||||
{
|
{
|
||||||
char buf[VIRTFN_ID_LEN];
|
char buf[VIRTFN_ID_LEN];
|
||||||
struct pci_dev *virtfn;
|
struct pci_dev *virtfn;
|
||||||
@ -198,11 +195,6 @@ void pci_iov_remove_virtfn(struct pci_dev *dev, int id, int reset)
|
|||||||
if (!virtfn)
|
if (!virtfn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (reset) {
|
|
||||||
device_release_driver(&virtfn->dev);
|
|
||||||
__pci_reset_function(virtfn);
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(buf, "virtfn%u", id);
|
sprintf(buf, "virtfn%u", id);
|
||||||
sysfs_remove_link(&dev->dev.kobj, buf);
|
sysfs_remove_link(&dev->dev.kobj, buf);
|
||||||
/*
|
/*
|
||||||
@ -317,7 +309,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
|
|||||||
pci_cfg_access_unlock(dev);
|
pci_cfg_access_unlock(dev);
|
||||||
|
|
||||||
for (i = 0; i < initial; i++) {
|
for (i = 0; i < initial; i++) {
|
||||||
rc = pci_iov_add_virtfn(dev, i, 0);
|
rc = pci_iov_add_virtfn(dev, i);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@ -329,7 +321,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
|
|||||||
|
|
||||||
failed:
|
failed:
|
||||||
while (i--)
|
while (i--)
|
||||||
pci_iov_remove_virtfn(dev, i, 0);
|
pci_iov_remove_virtfn(dev, i);
|
||||||
|
|
||||||
err_pcibios:
|
err_pcibios:
|
||||||
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
|
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
|
||||||
@ -356,7 +348,7 @@ static void sriov_disable(struct pci_dev *dev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < iov->num_VFs; i++)
|
for (i = 0; i < iov->num_VFs; i++)
|
||||||
pci_iov_remove_virtfn(dev, i, 0);
|
pci_iov_remove_virtfn(dev, i);
|
||||||
|
|
||||||
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
|
iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
|
||||||
pci_cfg_access_lock(dev);
|
pci_cfg_access_lock(dev);
|
||||||
|
@ -1958,8 +1958,8 @@ int pci_iov_virtfn_devfn(struct pci_dev *dev, int id);
|
|||||||
|
|
||||||
int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
|
int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
|
||||||
void pci_disable_sriov(struct pci_dev *dev);
|
void pci_disable_sriov(struct pci_dev *dev);
|
||||||
int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset);
|
int pci_iov_add_virtfn(struct pci_dev *dev, int id);
|
||||||
void pci_iov_remove_virtfn(struct pci_dev *dev, int id, int reset);
|
void pci_iov_remove_virtfn(struct pci_dev *dev, int id);
|
||||||
int pci_num_vf(struct pci_dev *dev);
|
int pci_num_vf(struct pci_dev *dev);
|
||||||
int pci_vfs_assigned(struct pci_dev *dev);
|
int pci_vfs_assigned(struct pci_dev *dev);
|
||||||
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
|
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
|
||||||
@ -1976,12 +1976,12 @@ static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id)
|
|||||||
}
|
}
|
||||||
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
|
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
|
||||||
{ return -ENODEV; }
|
{ return -ENODEV; }
|
||||||
static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)
|
static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id)
|
||||||
{
|
{
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
static inline void pci_iov_remove_virtfn(struct pci_dev *dev,
|
static inline void pci_iov_remove_virtfn(struct pci_dev *dev,
|
||||||
int id, int reset) { }
|
int id) { }
|
||||||
static inline void pci_disable_sriov(struct pci_dev *dev) { }
|
static inline void pci_disable_sriov(struct pci_dev *dev) { }
|
||||||
static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
|
static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
|
||||||
static inline int pci_vfs_assigned(struct pci_dev *dev)
|
static inline int pci_vfs_assigned(struct pci_dev *dev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user