Thread (19 messages) 19 messages, 4 authors, 2021-08-24

Re: [PATCH V3 06/13] vfio/pci: Split the pci_driver code out of vfio_pci_core.c

From: Alex Williamson <hidden>
Date: 2021-08-23 15:16:31
Also in: linux-doc, linux-kbuild, linux-pci, linux-s390

On Sun, 22 Aug 2021 17:35:55 +0300
Yishai Hadas [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
new file mode 100644
index 000000000000..15474ebadd98
--- /dev/null
+++ b/drivers/vfio/pci/vfio_pci.c
...
+static int vfio_pci_sriov_configure(struct pci_dev *pdev, int nr_virtfn)
+{
+	might_sleep();
+
+	if (!enable_sriov)
+		return -ENOENT;
+
+	return vfio_pci_core_sriov_configure(pdev, nr_virtfn);
+}
As noted in previous version, why do we need the might_sleep() above
when the core code below includes it and there's nothing above that
might sleep before that?  Thanks,

Alex
quoted hunk ↗ jump to hunk
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index 94f062818e0c..87d1960d0d61 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
...
-static int vfio_pci_sriov_configure(struct pci_dev *pdev, int nr_virtfn)
+int vfio_pci_core_sriov_configure(struct pci_dev *pdev, int nr_virtfn)
 {
 	struct vfio_device *device;
 	int ret = 0;
 
 	might_sleep();
 
-	if (!enable_sriov)
-		return -ENOENT;
-
 	device = vfio_device_get_from_dev(&pdev->dev);
 	if (!device)
 		return -ENODEV;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help