Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v3 3/3] scsi: mvumi: flush the event work before the host is freed
Date: Tue, 17 Nov 2026 13:57:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-218911@kernel.org> (raw)
In-Reply-To: <20261117134227.2077013-4-yhlee@isslab.korea.ac.kr>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] scsi: mvumi: 45s hang draining work_q after free_irq() in
  probe and detach
--

commit fea1f9d38eeeed5d46b0fb512a378a51f64fd086
Author: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

scsi: mvumi: flush the event work before the host is freed

This commit gives mvumi its own per-HBA workqueue for event notifications
and drains or destroys it on probe failure and device removal before the
host is freed.

> diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
> index fe3f63a1088dc..79086e2dd22e3 100644
> --- a/drivers/scsi/mvumi.c
> +++ b/drivers/scsi/mvumi.c

[ ... ]

> @@ -2570,9 +2577,14 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  fail_io_attach:
>  	mhba->instancet->disable_intr(mhba);
>  	free_irq(mhba->pdev->irq, mhba);
> +	flush_workqueue(mhba->work_q);
>  fail_init_irq:
> +	/* mvumi_release_fw() frees buffers the controller was given */
> +	pci_clear_master(pdev);
>  	mvumi_release_fw(mhba);
>  fail_init_fw:
> +	destroy_workqueue(mhba->work_q);
> +fail_alloc_workqueue:
>  	scsi_host_put(host);
>  
>  fail_alloc_instance:
> @@ -2600,6 +2612,7 @@ static void mvumi_detach_one(struct pci_dev *pdev)
>  
>  	mhba->instancet->disable_intr(mhba);
>  	free_irq(mhba->pdev->irq, mhba);
> +	destroy_workqueue(mhba->work_q);
>  	pci_disable_device(pdev);
>  	mvumi_release_fw(mhba);
>  	scsi_host_put(host);

[Severity: Medium]
Does draining mhba->work_q after disable_intr() and free_irq() cause a
45-second hang when an event work item is pending or in flight?

mvumi_scan_events() calls mvumi_get_event() -> mvumi_issue_blocked_cmd(),
which waits on mhba->int_cmd_wait_q for MVUMI_INTERNAL_CMD_WAIT_TIME * HZ
(45 seconds).  That wait queue is only woken by mvumi_complete_internal_cmd()
from mvumi_isr_handler().  Because interrupts have already been masked and
freed in both fail_io_attach and mvumi_detach_one(), any queued
mvumi_scan_events() work item cannot receive its completion interrupt and
blocks until the 45-second timeout expires.  In mvumi_detach_one(), a
pending work item will also submit a new APICDB0_EVENT command after
mvumi_flush_cache() has already sent CDB_CORE_SHUTDOWN.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117134227.2077013-1-yhlee@isslab.korea.ac.kr?part=3

  reply	other threads:[~2026-11-17 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:42 [PATCH v3 0/3] scsi: mvumi: do not free or reuse buffers a timed-out command left with the device Yehyeong Lee
2026-11-17 13:42 ` [PATCH v3 1/3] scsi: mvumi: stop the controller bus-mastering before freeing its buffers Yehyeong Lee
2026-11-17 13:42 ` [PATCH v3 2/3] scsi: mvumi: quarantine a timed-out internal command's buffers Yehyeong Lee
2026-11-17 13:42 ` [PATCH v3 3/3] scsi: mvumi: flush the event work before the host is freed Yehyeong Lee
2026-11-17 13:57   ` sashiko-bot [this message]
2026-11-17 14:05     ` Yehyeong Lee

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=sashiko-outbox-218911@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yhlee@isslab.korea.ac.kr \
    /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