[PATCH 1/2] scsi: mvumi: stop the controller bus-mastering before freeing its buffers

From: Yehyeong Lee

Date: Fri Nov 13 2026 - 20:45:29 EST


mvumi_detach_one() frees the controller's buffers before stopping its DMA:

mvumi_release_fw(mhba); /* frees them */
scsi_host_put(host);
pci_disable_device(pdev); /* stops the DMA */

mvumi_release_fw() frees everything on mhba->res_list and the handshake
page. The controller is given those addresses during the handshake and
may read or write them for as long as it is bus-mastering, and only
pci_disable_device() stops that.

Disable the device first. Nothing in mvumi_release_fw() needs it
enabled: it contains no ioread32() or iowrite32() at all.

I have no mvumi hardware.

Fixes: f0c568a478f0 ("[SCSI] mvumi: Add Marvell UMI driver")
Signed-off-by: Yehyeong Lee <yhlee@xxxxxxxxxxxxxxxxxx>
---
Disabling the device before scsi_host_put() is the order myrb, myrs,
hptiop, wd719x, qla1280, dc395x, fnic, snic, atp870u and am53c974
already use. Freeing first and disabling
afterwards is the more common order in drivers/scsi, because a driver with
nothing outstanding at teardown does not need the device stopped in order
to free safely. mvumi cannot assume that, which is what 2/2 is about.

mvumi_probe_one()'s failure paths are left alone: they reach
pci_disable_device() from labels that have no Scsi_Host to put.
mvumi_shutdown(), mvumi_suspend() and mvumi_resume() call neither
pci_disable_device() nor scsi_host_put(), so nothing else moves.

drivers/scsi/mvumi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 91c2db697c6913..8d22d370d8608f 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2548,9 +2548,9 @@ static void mvumi_detach_one(struct pci_dev *pdev)

mhba->instancet->disable_intr(mhba);
free_irq(mhba->pdev->irq, mhba);
+ pci_disable_device(pdev);
mvumi_release_fw(mhba);
scsi_host_put(host);
- pci_disable_device(pdev);
dev_dbg(&pdev->dev, "driver is removed!\n");
}

--
2.43.0