From: Bart Van Assche <bvanassche@acm.org>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "Powen Kao (高伯文)" <Powen.Kao@mediatek.com>,
"chu.stanley@gmail.com" <chu.stanley@gmail.com>,
"alok.a.tiwari@oracle.com" <alok.a.tiwari@oracle.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: Tue, 28 Oct 2025 06:46:22 -0700 [thread overview]
Message-ID: <37a7d14c-5e6f-4fb4-a850-af3ca322ae99@acm.org> (raw)
In-Reply-To: <dae8ac46abd89f4d48e649cee0a6b301504bcdac.camel@mediatek.com>
On 10/28/25 6:05 AM, Peter Wang (王信友) wrote:
> On Mon, 2025-10-27 at 08:44 -0700, Bart Van Assche wrote:
>> ufshcd_mcq_sq_cleanup() must return 0 if the command with tag
>> 'task_tag'
>> is no longer in a submission queue. Check whether or not a command is
>> still pending by calling ufshcd_mcq_sqe_search().
>
> Hi Bart,
>
> What if the tag is not in the submission queue, but the
> completion queue is still waiting for the tag's response?
> If we return 0, it may cause ufshcd_abort to think it
> succeeded, even though the tag is still in an error state?
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.
next prev parent reply other threads:[~2025-10-28 13:46 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 [this message]
2025-10-29 7:18 ` Peter Wang (王信友)
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=37a7d14c-5e6f-4fb4-a850-af3ca322ae99@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Powen.Kao@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=alok.a.tiwari@oracle.com \
--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=peter.wang@mediatek.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