From: Hongyan Xu <getshell@seu.edu.cn>
To: Hannes Reinecke <hare@kernel.org>,
"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, jianhao.xu@seu.edu.cn,
Hongyan Xu <getshell@seu.edu.cn>
Subject: [PATCH] scsi: myrb: quiesce the SCSI host before controller teardown
Date: Thu, 6 Aug 2026 14:06:58 +0800 [thread overview]
Message-ID: <20260806060659.1852-1-getshell@seu.edu.cn> (raw)
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
reply other threads:[~2026-08-06 6:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260806060659.1852-1-getshell@seu.edu.cn \
--to=getshell@seu.edu.cn \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hare@kernel.org \
--cc=jianhao.xu@seu.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox