All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: myrb: quiesce the SCSI host before controller teardown
@ 2026-08-06  6:06 Hongyan Xu
  2026-08-06  6:20 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Hongyan Xu @ 2026-08-06  6:06 UTC (permalink / raw)
  To: Hannes Reinecke, James E . J . Bottomley, Martin K . Petersen
  Cc: linux-scsi, linux-kernel, stable, jianhao.xu, Hongyan Xu

myrb_remove() tears down the controller resources and drops the host
reference without first removing the SCSI host. The registered host can
therefore continue to dispatch queuecommand callbacks that use the
controller MMIO mappings and DMA pools after teardown. The monitor work is
also canceled only after the MMIO mappings have been released.

Remove the SCSI host before issuing the final controller command. Then stop
the monitor and destroy its pools before unmapping the hardware and
dropping the host reference.

Fixes: 081ff398c56c ("scsi: myrb: Add Mylex RAID controller (block interface)")
Cc: stable@vger.kernel.org
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
 drivers/scsi/myrb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index 3678b66310ed..adb2fadf9146 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -3496,9 +3496,10 @@ static void myrb_remove(struct pci_dev *pdev)
 	struct myrb_hba *cb = pci_get_drvdata(pdev);
 
 	shost_printk(KERN_NOTICE, cb->host, "Flushing Cache...");
+	scsi_remove_host(cb->host);
 	myrb_exec_type3(cb, MYRB_CMD_FLUSH, 0);
-	myrb_cleanup(cb);
 	myrb_destroy_mempools(cb);
+	myrb_cleanup(cb);
 }
 
 
-- 
2.50.1.windows.1


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

end of thread, other threads:[~2026-08-06  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  6:06 [PATCH] scsi: myrb: quiesce the SCSI host before controller teardown Hongyan Xu
2026-08-06  6:20 ` sashiko-bot

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.