summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-09-27 09:33:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-09-27 09:33:55 -0700
commitb6cd17050bc0817c79924f23716198b2e935556e (patch)
treeb30fcdf4f87c03b92d48811f53a8816e6085dbdb /drivers
parent0e945134b680040b8613e962f586d91b6d40292d (diff)
parentc777b11d34e0f47dbbc4b018ef65ad030f2b283a (diff)
Merge tag 'vfio-v6.6-rc4' of https://github.com/awilliam/linux-vfio
Pull VFIO fixes from Alex Williamson: - The new PDS vfio-pci variant driver only supports SR-IOV VF devices and incorrectly made a direct reference to the physfn field of the pci_dev. Fix this both by making the Kconfig depend on IOV support as well as using the correct wrapper for this access (Shixiong Ou) - Resolve an error path issue where on unwind of the mdev registration the created kset is not unregistered and the wrong error code is returned (Jinjie Ruan) * tag 'vfio-v6.6-rc4' of https://github.com/awilliam/linux-vfio: vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() vfio/pds: Use proper PF device access helper vfio/pds: Add missing PCI_IOV depends
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vfio/mdev/mdev_sysfs.c3
-rw-r--r--drivers/vfio/pci/pds/Kconfig2
-rw-r--r--drivers/vfio/pci/pds/vfio_dev.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
index e4490639d383..9d2738e10c0b 100644
--- a/drivers/vfio/mdev/mdev_sysfs.c
+++ b/drivers/vfio/mdev/mdev_sysfs.c
@@ -233,7 +233,8 @@ int parent_create_sysfs_files(struct mdev_parent *parent)
out_err:
while (--i >= 0)
mdev_type_remove(parent->types[i]);
- return 0;
+ kset_unregister(parent->mdev_types_kset);
+ return ret;
}
static ssize_t remove_store(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/vfio/pci/pds/Kconfig b/drivers/vfio/pci/pds/Kconfig
index 407b3fd32733..6eceef7b028a 100644
--- a/drivers/vfio/pci/pds/Kconfig
+++ b/drivers/vfio/pci/pds/Kconfig
@@ -3,7 +3,7 @@
config PDS_VFIO_PCI
tristate "VFIO support for PDS PCI devices"
- depends on PDS_CORE
+ depends on PDS_CORE && PCI_IOV
select VFIO_PCI_CORE
help
This provides generic PCI support for PDS devices using the VFIO
diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c
index b46174f5eb09..649b18ee394b 100644
--- a/drivers/vfio/pci/pds/vfio_dev.c
+++ b/drivers/vfio/pci/pds/vfio_dev.c
@@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev)
pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn);
dev_dbg(&pdev->dev,
"%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n",
- __func__, pci_dev_id(pdev->physfn), pci_id, vf_id,
+ __func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id,
pci_domain_nr(pdev->bus), pds_vfio);
return 0;