Skip to content

Commit bf72697

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
vfio/pci: Use never-managed version of pci_intx()
pci_intx() is a hybrid function which can sometimes be managed through devres. To remove this hybrid nature from pci_intx(), it is necessary to port users to either an always-managed or a never-managed version. vfio enables its PCI device with pci_enable_device(). Thus, it needs the never-managed version. Replace pci_intx() with pci_intx_unmanaged(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Alex Williamson <[email protected]>
1 parent 96ee809 commit bf72697

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/vfio/pci/vfio_pci_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ int vfio_pci_core_enable(struct vfio_pci_core_device *vdev)
498498
if (vfio_pci_nointx(pdev)) {
499499
pci_info(pdev, "Masking broken INTx support\n");
500500
vdev->nointx = true;
501-
pci_intx(pdev, 0);
501+
pci_intx_unmanaged(pdev, 0);
502502
} else
503503
vdev->pci_2_3 = pci_intx_mask_supported(pdev);
504504
}

drivers/vfio/pci/vfio_pci_intrs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_device *vdev)
118118
*/
119119
if (unlikely(!is_intx(vdev))) {
120120
if (vdev->pci_2_3)
121-
pci_intx(pdev, 0);
121+
pci_intx_unmanaged(pdev, 0);
122122
goto out_unlock;
123123
}
124124

@@ -132,7 +132,7 @@ static bool __vfio_pci_intx_mask(struct vfio_pci_core_device *vdev)
132132
* mask, not just when something is pending.
133133
*/
134134
if (vdev->pci_2_3)
135-
pci_intx(pdev, 0);
135+
pci_intx_unmanaged(pdev, 0);
136136
else
137137
disable_irq_nosync(pdev->irq);
138138

@@ -178,7 +178,7 @@ static int vfio_pci_intx_unmask_handler(void *opaque, void *data)
178178
*/
179179
if (unlikely(!is_intx(vdev))) {
180180
if (vdev->pci_2_3)
181-
pci_intx(pdev, 1);
181+
pci_intx_unmanaged(pdev, 1);
182182
goto out_unlock;
183183
}
184184

@@ -296,7 +296,7 @@ static int vfio_intx_enable(struct vfio_pci_core_device *vdev,
296296
*/
297297
ctx->masked = vdev->virq_disabled;
298298
if (vdev->pci_2_3) {
299-
pci_intx(pdev, !ctx->masked);
299+
pci_intx_unmanaged(pdev, !ctx->masked);
300300
irqflags = IRQF_SHARED;
301301
} else {
302302
irqflags = ctx->masked ? IRQF_NO_AUTOEN : 0;
@@ -569,7 +569,7 @@ static void vfio_msi_disable(struct vfio_pci_core_device *vdev, bool msix)
569569
* via their shutdown paths. Restore for NoINTx devices.
570570
*/
571571
if (vdev->nointx)
572-
pci_intx(pdev, 0);
572+
pci_intx_unmanaged(pdev, 0);
573573

574574
vdev->irq_type = VFIO_PCI_NUM_IRQS;
575575
}

0 commit comments

Comments
 (0)