提交 6c88f174 编写于 作者: S shanghui.lsh 提交者: Caspar Zhang

alinux: pci/iohub-sriov: fix iohub-sriov VF probe issue

fix #26111716

When doing VF probing, it will fail when calling pci_enable_sriov()
function, as we should only call this function for physfn. Fix this
issue by adding physfn check before the call.

Fixes: 4a5d2b59 ("alinux: pci/iohub-sriov: Support for Alibaba PCIe IOHub SRIOV")
Signed-off-by: Nshanghui.lsh <shanghui.lsh@alibaba-inc.com>
Reviewed-by: Nluanshi <zhangliguang@linux.alibaba.com>
[ caspar: modify the commit log]
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 31be0087
......@@ -56,11 +56,13 @@ xdragon_sriov_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
}
/* VF number fixed as 255, will change to a parameter later */
err = pci_enable_sriov(dev, 255);
if (err) {
dev_err(&dev->dev, "Failed to enable PCI sriov: %d\n",
err);
goto error;
if (dev->is_physfn) {
err = pci_enable_sriov(dev, 255);
if (err) {
dev_err(&dev->dev, "Failed to enable PCI sriov: %d\n",
err);
goto error;
}
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册