From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "bvanassche@acm.org" <bvanassche@acm.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "Powen Kao (高伯文)" <Powen.Kao@mediatek.com>,
"alok.a.tiwari@oracle.com" <alok.a.tiwari@oracle.com>,
"chu.stanley@gmail.com" <chu.stanley@gmail.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"chenyuan0y@gmail.com" <chenyuan0y@gmail.com>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"ping.gao@samsung.com" <ping.gao@samsung.com>,
"mani@kernel.org" <mani@kernel.org>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH] ufs: core: Fix the UFSHCD_QUIRK_MCQ_BROKEN_RTC implementation
Date: Wed, 29 Oct 2025 07:18:42 +0000 [thread overview]
Message-ID: <7d955a693d11424d527fcdaf4f05ffd792e1edfa.camel@mediatek.com> (raw)
In-Reply-To: <37a7d14c-5e6f-4fb4-a850-af3ca322ae99@acm.org>
On Tue, 2025-10-28 at 06:46 -0700, Bart Van Assche wrote:
> ufshcd_mcq_sqe_search() only searches the submission queue. Examining
> completion queues is not something ufshcd_mcq_sqe_search() must do.
>
> The UFSHCI driver is based on the assumption that the UFSHCI
> controller
> works correctly and hence passes completions quickly to the host. The
> SCSI core only tries to abort a SCSI command after the SCSI timeout
> has
> expired. The smallest SCSI timeout that can be configured is one
> second.
> This is several orders of magnitude larger than the typical time for
> passing a completion from the UFSHCI to the host. Hence, I think it
> is
> very unlikely that a completion is present in the host controller and
> has not yet reached the host by the time the SCSI core aborts a SCSI
> command.
>
> Bart.
Hi Bart,
The probability is indeed quite low, but it can still happen,
especially when the timeout is set low. For example, the dev
command only has 1.5 seconds. Some device dev commands may be
delayed by normal read/write commands and eventually reach
this timeout.
By the way,
ufshcd_mcq_sqe_search will return true if UFSHCD_QUIRK_MCQ_BROKEN_RTC.
Therefore, this code:
+ if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
+ return ufshcd_mcq_sqe_search(hba, hwq, task_tag) ? -
ETIMEDOUT :
+ 0;
+
should be equivalent to:
- if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
- return -ETIMEDOUT;
-
am I right?
Thanks
Peter
next prev parent reply other threads:[~2025-10-29 7:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 15:44 [PATCH] ufs: core: Fix the UFSHCD_QUIRK_MCQ_BROKEN_RTC implementation Bart Van Assche
2025-10-28 13:05 ` Peter Wang (王信友)
2025-10-28 13:46 ` Bart Van Assche
2025-10-29 7:18 ` Peter Wang (王信友) [this message]
2025-10-29 15:50 ` Bart Van Assche
2025-10-30 6:38 ` Peter Wang (王信友)
2025-10-30 16:11 ` Bart Van Assche
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=7d955a693d11424d527fcdaf4f05ffd792e1edfa.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Powen.Kao@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=alok.a.tiwari@oracle.com \
--cc=bvanassche@acm.org \
--cc=chenyuan0y@gmail.com \
--cc=chu.stanley@gmail.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ping.gao@samsung.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