From: Bart Van Assche <bvanassche@acm.org>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v9 2/3] ufs: core: fix error handler process for MCQ abort
Date: Sat, 28 Sep 2024 16:10:01 -0700 [thread overview]
Message-ID: <c014f499-1a5d-4e3a-adc1-a95a38bbe2de@acm.org> (raw)
In-Reply-To: <134227055619610a781d5e46fb14e689f874b7d4.camel@mediatek.com>
On 9/27/24 12:51 AM, Peter Wang (王信友) wrote:
> In this section of the UFSHCI 4.0 specification.
> 4.4.6 (Informative) Processing Abort in MCQ mode: An Implementation
> Example
> There are three case for MCQ abort:
>
> 1. When the host controller has already sent out the SQE
> and the UFS device has already responded with the
> corresponding response, the CQ Entry will automatically
> increment by 1. This case is the simplest, the SQE
> will have a corresponding CQE for the host to cleanup
> resources.
>
> 2. When the host controller has not yet sent out this SQE
> (SQ is not empty), the software can fill in 'nullify' to
> notify the host controller that there is no need to send
> it, and directly fill the corresponding response into the
> CQ with OCS: ABORTED. This scenario is also straightforward,
> the UFS device won't be aware, and only the host controller
> needs to clean up the related resources.
>
> 3. When the host controller has already sent out the SQE
> and is waiting for the response from the UFS device (CQE),
> the software can initiate cleanup to notify the host
> controller that there is no need to wait, and directly fill
> the corresponding response into the CQ with OCS: ABORTED.
Hi Peter,
Thank you for having drawn my attention to the above text. Regarding
the code changes included in your previous email, do you agree that the
completion code must not call scsi_done() if the CQE status is ABORTED
and if the SCSI command has been aborted by the SCSI core since in this
case calling scsi_done() could result in a use-after-free?
Thanks,
Bart.
next prev parent reply other threads:[~2024-09-28 23:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 9:55 [PATCH v9 0/3] fix abort defect peter.wang
2024-09-25 9:55 ` [PATCH v9 1/3] ufs: core: fix the issue of ICU failure peter.wang
2024-09-25 9:55 ` [PATCH v9 2/3] ufs: core: fix error handler process for MCQ abort peter.wang
2024-09-25 16:49 ` Bart Van Assche
2024-09-26 3:45 ` Peter Wang (王信友)
2024-09-26 18:26 ` Bart Van Assche
2024-09-27 7:51 ` Peter Wang (王信友)
2024-09-28 23:10 ` Bart Van Assche [this message]
2024-09-30 6:45 ` Peter Wang (王信友)
2024-09-30 17:25 ` Bart Van Assche
2024-10-01 7:46 ` Peter Wang (王信友)
2024-09-25 9:55 ` [PATCH v9 3/3] ufs: core: add a quirk for MediaTek SDB mode aborted peter.wang
2024-09-25 16:56 ` Bart Van Assche
2024-09-26 3:42 ` Peter Wang (王信友)
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=c014f499-1a5d-4e3a-adc1-a95a38bbe2de@acm.org \
--to=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
--cc=peter.wang@mediatek.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