[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/13] PCI: MSI: 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>, Chen Ni <nichen@xxxxxxxxxxx>, Mario Limonciello <mario.limonciello@xxxxxxx>, Philipp Stanner <pstanner@xxxxxxxxxx>, 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>, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Mostafa Saleh <smostafa@xxxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Yi Liu <yi.l.liu@xxxxxxxxx>, Christian Brauner <brauner@xxxxxxxxxx>, Ankit Agrawal <ankita@xxxxxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, Reinette Chatre <reinette.chatre@xxxxxxxxx>, Ye Bin <yebin10@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>, Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx>, Rui Salvaterra <rsalvaterra@xxxxxxxxx>
- From: Philipp Stanner <pstanner@xxxxxxxxxx>
- Date: Tue, 15 Oct 2024 20:51:18 +0200
- Cc: linux-ide@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-input@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-wireless@xxxxxxxxxxxxxxx, ntb@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-sound@xxxxxxxxxxxxxxx
- Delivery-date: Tue, 15 Oct 2024 18:52:14 +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.
MSI sets up its own separate devres callback implicitly in
pcim_setup_msi_release(). This callback ultimately uses pci_intx(),
which is problematic since the callback of course runs on driver-detach.
That problem has last been described here:
https://lore.kernel.org/all/ee44ea7ac760e73edad3f20b30b4d2fff66c1a85.camel@xxxxxxxxxx/
Replace the call to pci_intx() with one to the never-managed version
pci_intx_unmanaged().
Signed-off-by: Philipp Stanner <pstanner@xxxxxxxxxx>
---
drivers/pci/msi/api.c | 2 +-
drivers/pci/msi/msi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/msi/api.c b/drivers/pci/msi/api.c
index b956ce591f96..c95e2e7dc9ab 100644
--- a/drivers/pci/msi/api.c
+++ b/drivers/pci/msi/api.c
@@ -289,7 +289,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev,
unsigned int min_vecs,
*/
if (affd)
irq_create_affinity_masks(1, affd);
- pci_intx(dev, 1);
+ pci_intx_unmanaged(dev, 1);
return 1;
}
}
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index 3a45879d85db..53f13b09db50 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -268,7 +268,7 @@ EXPORT_SYMBOL_GPL(pci_write_msi_msg);
static void pci_intx_for_msi(struct pci_dev *dev, int enable)
{
if (!(dev->dev_flags & PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG))
- pci_intx(dev, enable);
+ pci_intx_unmanaged(dev, enable);
}
static void pci_msi_set_enable(struct pci_dev *dev, int enable)
--
2.47.0
|