All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rapidio: tsi721: Disable MSI/MSI-X on master port setup failure
@ 2026-12-02 13:28 Haoxiang Li
  2026-12-02 20:49 ` + rapidio-tsi721-disable-msi-msi-x-on-master-port-setup-failure.patch added to mm-nonmm-unstable branch Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Haoxiang Li @ 2026-12-02 13:28 UTC (permalink / raw)
  To: mporter, alex.bou9, error27, akpm; +Cc: linux-kernel, Haoxiang Li

tsi721_setup_mport() enables MSI-X or MSI before tsi721_request_irq().
If any subsequent operation fails, the allocated interrupt vectors
are not released. This leaks interrupt resources and leaves MSI-X or
MSI enabled, which can prevent subsequent probe attempts from enabling
either interrupt mode. Disable MSI-X or MSI on error path.

Fixes: 9eaa3d9bb2c4 ("rapidio/tsi721: add DMA engine support")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
---
 drivers/rapidio/devices/tsi721.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 71b87bf8c31d..1f257bc878a2 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2736,7 +2736,7 @@ static int tsi721_setup_mport(struct tsi721_device *priv)
 	if (err) {
 		tsi_err(&pdev->dev, "Unable to get PCI IRQ %02X (err=0x%x)",
 			pdev->irq, err);
-		return err;
+		goto err_disable_msi;
 	}
 
 #ifdef CONFIG_RAPIDIO_DMA_ENGINE
@@ -2766,6 +2766,11 @@ static int tsi721_setup_mport(struct tsi721_device *priv)
 
 err_exit:
 	tsi721_free_irq(priv);
+err_disable_msi:
+	if (priv->flags & TSI721_USING_MSIX)
+		pci_disable_msix(pdev);
+	else if (priv->flags & TSI721_USING_MSI)
+		pci_disable_msi(pdev);
 	return err;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 13:28 [PATCH] rapidio: tsi721: Disable MSI/MSI-X on master port setup failure Haoxiang Li
2026-12-02 20:49 ` + rapidio-tsi721-disable-msi-msi-x-on-master-port-setup-failure.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.