[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 07/13] vfio/pci: Use never-managed version of pci_intx()
- To: Damien Le Moal <dlemoal@xxxxxxxxxx>, Niklas Cassel <cassel@xxxxxxxxxx>, Sergey Shtylyov <s.shtylyov@xxxxxx>, Basavaraj Natikar <basavaraj.natikar@xxxxxxx>, Jiri Kosina <jikos@xxxxxxxxxx>, Benjamin Tissoires <bentiss@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Alex Dubov <oakad@xxxxxxxxx>, Sudarsana Kalluru <skalluru@xxxxxxxxxxx>, Manish Chopra <manishc@xxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Eric Dumazet <edumazet@xxxxxxxxxx>, Jakub Kicinski <kuba@xxxxxxxxxx>, Paolo Abeni <pabeni@xxxxxxxxxx>, Rasesh Mody <rmody@xxxxxxxxxxx>, GR-Linux-NIC-Dev@xxxxxxxxxxx, Igor Mitsyanko <imitsyanko@xxxxxxxxxxxxx>, Sergey Matyukevich <geomatsi@xxxxxxxxx>, Kalle Valo <kvalo@xxxxxxxxxx>, Sanjay R Mehta <sanju.mehta@xxxxxxx>, Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>, Jon Mason <jdmason@xxxxxxxx>, Dave Jiang <dave.jiang@xxxxxxxxx>, Allen Hubbe <allenbh@xxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Alex Williamson <alex.williamson@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Jaroslav Kysela <perex@xxxxxxxx>, Takashi Iwai <tiwai@xxxxxxxx>, Philipp Stanner <pstanner@xxxxxxxxxx>, Mario Limonciello <mario.limonciello@xxxxxxx>, Chen Ni <nichen@xxxxxxxxxxx>, Ricky Wu <ricky_wu@xxxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, Breno Leitao <leitao@xxxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>, Mostafa Saleh <smostafa@xxxxxxxxxx>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Hannes Reinecke <hare@xxxxxxx>, John Garry <john.g.garry@xxxxxxxxxx>, Soumya Negi <soumya.negi97@xxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Yi Liu <yi.l.liu@xxxxxxxxx>, "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx>, Christian Brauner <brauner@xxxxxxxxxx>, Ankit Agrawal <ankita@xxxxxxxxxx>, Reinette Chatre <reinette.chatre@xxxxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, Ye Bin <yebin10@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx>, Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>, Rui Salvaterra <rsalvaterra@xxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>
- From: Philipp Stanner <pstanner@xxxxxxxxxx>
- Date: Wed, 9 Oct 2024 10:35:13 +0200
- Cc: linux-ide@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, ntb@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, linux-staging@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx
- Delivery-date: Wed, 09 Oct 2024 08:37:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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().
Signed-off-by: Philipp Stanner <pstanner@xxxxxxxxxx>
---
drivers/vfio/pci/vfio_pci_core.c | 2 +-
drivers/vfio/pci/vfio_pci_intrs.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index 1ab58da9f38a..90240c8d51aa 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -498,7 +498,7 @@ int vfio_pci_core_enable(struct vfio_pci_core_device *vdev)
if (vfio_pci_nointx(pdev)) {
pci_info(pdev, "Masking broken INTx support\n");
vdev->nointx = true;
- pci_intx(pdev, 0);
+ pci_intx_unmanaged(pdev, 0);
} else
vdev->pci_2_3 = pci_intx_mask_supported(pdev);
}
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c
b/drivers/vfio/pci/vfio_pci_intrs.c
index 8382c5834335..40abb0b937a2 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -118,7 +118,7 @@ static bool __vfio_pci_intx_mask(struct
vfio_pci_core_device *vdev)
*/
if (unlikely(!is_intx(vdev))) {
if (vdev->pci_2_3)
- pci_intx(pdev, 0);
+ pci_intx_unmanaged(pdev, 0);
goto out_unlock;
}
@@ -132,7 +132,7 @@ static bool __vfio_pci_intx_mask(struct
vfio_pci_core_device *vdev)
* mask, not just when something is pending.
*/
if (vdev->pci_2_3)
- pci_intx(pdev, 0);
+ pci_intx_unmanaged(pdev, 0);
else
disable_irq_nosync(pdev->irq);
@@ -178,7 +178,7 @@ static int vfio_pci_intx_unmask_handler(void *opaque, void
*data)
*/
if (unlikely(!is_intx(vdev))) {
if (vdev->pci_2_3)
- pci_intx(pdev, 1);
+ pci_intx_unmanaged(pdev, 1);
goto out_unlock;
}
@@ -296,7 +296,7 @@ static int vfio_intx_enable(struct vfio_pci_core_device
*vdev,
*/
ctx->masked = vdev->virq_disabled;
if (vdev->pci_2_3) {
- pci_intx(pdev, !ctx->masked);
+ pci_intx_unmanaged(pdev, !ctx->masked);
irqflags = IRQF_SHARED;
} else {
irqflags = ctx->masked ? IRQF_NO_AUTOEN : 0;
@@ -569,7 +569,7 @@ static void vfio_msi_disable(struct vfio_pci_core_device
*vdev, bool msix)
* via their shutdown paths. Restore for NoINTx devices.
*/
if (vdev->nointx)
- pci_intx(pdev, 0);
+ pci_intx_unmanaged(pdev, 0);
vdev->irq_type = VFIO_PCI_NUM_IRQS;
}
--
2.46.1
|