From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "bvanassche@acm.org" <bvanassche@acm.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"john.g.garry@oracle.com" <john.g.garry@oracle.com>,
"avri.altman@sandisk.com" <avri.altman@sandisk.com>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>
Subject: Re: [PATCH v2 1/2] ufs: core: Only call scsi_host_busy() after the SCSI host has been added
Date: Tue, 13 Jan 2026 07:25:01 +0000 [thread overview]
Message-ID: <c00386a9fb2e9b15be970d1ec957e87828c8013f.camel@mediatek.com> (raw)
In-Reply-To: <20260109205104.496478-2-bvanassche@acm.org>
On Fri, 2026-01-09 at 12:51 -0800, Bart Van Assche wrote:
> scsi_host_busy() iterates over the host tag set. The host tag set is
> initialized by scsi_mq_setup_tags(). The latter function is called by
> scsi_add_host(). Hence only call scsi_host_busy() after the SCSI host
> has been added. This patch prepares for reverting commit a0b7780602b1
> ("scsi: core: Fix a regression triggered by scsi_host_busy()").
>
> Reviewed-by: John Garry <john.g.garry@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/ufs/core/ufshcd.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 562d8cffc6f6..69630677b23f 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -283,7 +283,8 @@ static bool ufshcd_has_pending_tasks(struct
> ufs_hba *hba)
>
> static bool ufshcd_is_ufs_dev_busy(struct ufs_hba *hba)
> {
> - return scsi_host_busy(hba->host) ||
> ufshcd_has_pending_tasks(hba);
> + return (hba->scsi_host_added && scsi_host_busy(hba->host)) ||
> + ufshcd_has_pending_tasks(hba);
> }
>
> static const struct ufs_dev_quirk ufs_fixups[] = {
> @@ -678,7 +679,8 @@ static void ufshcd_print_host_state(struct
> ufs_hba *hba)
>
> dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);
> dev_err(hba->dev, "%d outstanding reqs, tasks=0x%lx\n",
> - scsi_host_busy(hba->host), hba->outstanding_tasks);
> + hba->scsi_host_added ? scsi_host_busy(hba->host) : 0,
> + hba->outstanding_tasks);
> dev_err(hba->dev, "saved_err=0x%x, saved_uic_err=0x%x\n",
> hba->saved_err, hba->saved_uic_err);
> dev_err(hba->dev, "Device power mode=%d, UIC link
> state=%d\n",
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
next prev parent reply other threads:[~2026-01-13 7:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 20:51 [PATCH v2 0/2] Call scsi_host_busy() after the SCSI host has been added Bart Van Assche
2026-01-09 20:51 ` [PATCH v2 1/2] ufs: core: Only call " Bart Van Assche
2026-01-13 7:25 ` Peter Wang (王信友) [this message]
2026-01-09 20:51 ` [PATCH v2 2/2] scsi: core: Revert "Fix a regression triggered by scsi_host_busy()" Bart Van Assche
2026-01-10 8:01 ` John Garry
2026-01-12 3:08 ` [PATCH v2 0/2] Call scsi_host_busy() after the SCSI host has been added Martin K. Petersen
2026-01-17 4:36 ` Martin K. Petersen
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=c00386a9fb2e9b15be970d1ec957e87828c8013f.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adrian.hunter@intel.com \
--cc=avri.altman@sandisk.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=john.g.garry@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_nguyenb@quicinc.com \
/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