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>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"mani@kernel.org" <mani@kernel.org>,
"avri.altman@sandisk.com" <avri.altman@sandisk.com>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"quic_nguyenb@quicinc.com" <quic_nguyenb@quicinc.com>,
"adrian.hunter@intel.com" <adrian.hunter@intel.com>
Subject: Re: [PATCH 4/4] ufs: core: Rename ufshcd_wait_for_doorbell_clr()
Date: Thu, 14 Aug 2025 08:00:36 +0000 [thread overview]
Message-ID: <c0e7d95206e44cad332b65cc722700c327585eb0.camel@mediatek.com> (raw)
In-Reply-To: <b707f40c-707f-4ef4-af9d-915dd8d5ea52@acm.org>
On Wed, 2025-08-13 at 09:04 -0700, Bart Van Assche wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On 8/12/25 2:03 AM, Peter Wang (王信友) wrote:
> > According to the UFS specification, switching gears does not
> > require waiting for IO to complete. Therefore, should we consider
> > removing this function entirely?
>
> I don't think so. Switching gears involves submitting an UIC power
> mode
> change. From the UFSHCI 4.1 standard: "The Adapt is always performed
> in
> conjunction with Power Mode Change. During the Power Mode Change
> (and hence for the whole duration of the Adapt sequence) there will
> be
> no data traffic on the link."
>
> Bart.
Hi Bart,
According to the MIPI UniPro Specification v2.0:
5.3.2.3 PA_DL_PAUSE.ind
This primitive informs the PA Service User, the DL Layer in this case,
that the PA Layer was requested to
execute a operation that requires the usage of the Link, e.g. Power
Mode change or PACP frame transmission.
This primitive is one in the group of primitives defining the handshake
procedure used between PA Layer
and DL Layer to coordinate the Link usage. After generating this
primitive, the PA Layer shall wait for the
reception of the PA_DL_PAUSE.rsp_L before taking any further action.
5.3.2.5 PA_DL_RESUME.ind
This primitive informs the PA Service User, the DL Layer in this case,
that 1125 the PA Layer has completed its
operation and the DL Layer may continue to use the Link.
The semantics of this primitive are:
PA_DL_RESUME.ind( PAResult )
When Generated
This primitive shall be generated by the PA Layer when it has completed
its operation. The parameter is set
to TRUE if the operation completed successfully, otherwise the
parameter is set to FALSE.
For the detailed flow, please refer to Figure 52: Power Mode Change
Using PACP_PWR_req and PACP_PWR_cnf.
In short,
The PA has IO data traffic (power mode change)
-> The DL layer receives PA_DL_PAUSE.ind
-> The DL layer pauses and responds The PA layer sends
PA_DL_PAUSE.rsp_L
-> waits until the PA’s work is completed
-> The PA then notifies the DL layer with PA_DL_Resume.ind
That is, if a power mode change happens during ongoing IO data traffic,
the PA and DL layers will execute pause and resume operations to ensure
that the ongoing IO is properly halted and then continued.
However, I believe this is a separate topic, and I also doubt that
every UFSHCI
host or device can perfectly implement the flow as described in the
specification.
Therefore, it’s better to keep the current implementation for now.
Mediatek will submit a patch to optimize this flow in the future, and
may use a
quirk to retain the original behavior.
Hence,
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Thanks.
Peter
prev parent reply other threads:[~2025-08-14 8:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 15:46 [PATCH 0/4] UFS driver bug fixes Bart Van Assche
2025-08-11 15:46 ` [PATCH 1/4] ufs: core: Fix IRQ lock inversion for the SCSI host lock Bart Van Assche
2025-08-11 15:46 ` [PATCH 2/4] ufs: core: Remove WARN_ON_ONCE() call from ufshcd_uic_cmd_compl() Bart Van Assche
2025-08-12 9:01 ` Peter Wang (王信友)
2025-08-11 15:46 ` [PATCH 3/4] ufs: core: Fix the return value documentation Bart Van Assche
2025-08-12 9:02 ` Peter Wang (王信友)
2025-08-12 15:27 ` Bart Van Assche
2025-08-11 15:46 ` [PATCH 4/4] ufs: core: Rename ufshcd_wait_for_doorbell_clr() Bart Van Assche
2025-08-12 9:03 ` Peter Wang (王信友)
2025-08-13 16:04 ` Bart Van Assche
2025-08-14 8:00 ` Peter Wang (王信友) [this message]
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=c0e7d95206e44cad332b65cc722700c327585eb0.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=linux-scsi@vger.kernel.org \
--cc=mani@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;
as well as URLs for NNTP newsgroup(s).