[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241113124158.22863-9-pstanner@redhat.com>
Date: Wed, 13 Nov 2024 13:41:55 +0100
From: Philipp Stanner <pstanner@...hat.com>
To: Damien Le Moal <dlemoal@...nel.org>,
Niklas Cassel <cassel@...nel.org>,
Basavaraj Natikar <basavaraj.natikar@....com>,
Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <bentiss@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alex Dubov <oakad@...oo.com>,
Sudarsana Kalluru <skalluru@...vell.com>,
Manish Chopra <manishc@...vell.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Rasesh Mody <rmody@...vell.com>,
GR-Linux-NIC-Dev@...vell.com,
Igor Mitsyanko <imitsyanko@...ntenna.com>,
Sergey Matyukevich <geomatsi@...il.com>,
Kalle Valo <kvalo@...nel.org>,
Sanjay R Mehta <sanju.mehta@....com>,
Shyam Sundar S K <Shyam-sundar.S-k@....com>,
Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Alex Williamson <alex.williamson@...hat.com>,
Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Philipp Stanner <pstanner@...hat.com>,
Mario Limonciello <mario.limonciello@....com>,
Chen Ni <nichen@...as.ac.cn>,
Ricky Wu <ricky_wu@...ltek.com>,
Al Viro <viro@...iv.linux.org.uk>,
Breno Leitao <leitao@...ian.org>,
Kevin Tian <kevin.tian@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Mostafa Saleh <smostafa@...gle.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Yi Liu <yi.l.liu@...el.com>,
Kunwu Chan <chentao@...inos.cn>,
Ankit Agrawal <ankita@...dia.com>,
Christian Brauner <brauner@...nel.org>,
Reinette Chatre <reinette.chatre@...el.com>,
Eric Auger <eric.auger@...hat.com>,
Ye Bin <yebin10@...wei.com>
Cc: linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org,
netdev@...r.kernel.org,
linux-wireless@...r.kernel.org,
ntb@...ts.linux.dev,
linux-pci@...r.kernel.org,
kvm@...r.kernel.org,
xen-devel@...ts.xenproject.org
Subject: [PATCH v2 07/11] PCI: MSI: 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.
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@redhat.com/
Replace the call to pci_intx() with one to the never-managed version
pci_intx_unmanaged().
Signed-off-by: Philipp Stanner <pstanner@...hat.com>
---
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
Powered by blists - more mailing lists