From: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
mani@kernel.org, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH V1 2/3] ufs: ufs-qcom: Align programming sequence for UFS controller v6.2
Date: Wed, 26 Aug 2026 10:57:36 +0530 [thread overview]
Message-ID: <c3e802f9-4657-4595-92a7-14436d2d2fb6@oss.qualcomm.com> (raw)
In-Reply-To: <883a2f40-a945-47f0-8022-20ad4146acf3@oss.qualcomm.com>
On 1/22/2026 8:39 PM, Konrad Dybcio wrote:
> On 1/22/26 3:13 PM, Nitin Rawat wrote:
>> UFS controller v6.2 requires bit 31 in the spare configuration register
>> to be set for high-speed link startup mode, as per the Hardware
>> Programming Guide (HPG).
Hi Konrad,
I've revived this patch. Sorry for the delayed response. Thanks for your
previous comments on this patch.
>
> Please stick a "Qualcomm" before mentioning UFS controller v6.2, I
> don't think that is immediately obvious without looking at the code..
>
>> The spare register value is read during host driver initialization but
>> gets cleared after UFS reset. To align with the UFS v6.2 programming
>> sequence, preserve the spare register value during initialization and
>> restore it during link startup to ensure proper high-speed mode
>
> I believe you're supposed to write the value yourself, depending on the
> state of the controller, it's 0 at reset.
The link startup mode (HS LSS - high-speed link startup, or LS LSS -
low-speed link startup) is decided during the boot stage based on a
bootconfig GPIO. This selection is carried forward through the secondary
stage bootloaders and finally to HLOS via this register.
This register is only configured by the bootloader — no kernel code
writes other fields to it. The kernel reads it during initialization to
capture the configured link startup mode, and restores it after UFS
reset (which clears the register to 0) so that the bootloader's
selection is preserved for link startup.
>
>> Signed-off-by: Nitin Rawat <nitin.rawat@oss.qualcomm.com>
>> ---
>> drivers/ufs/host/ufs-qcom.c | 11 ++++++++---
>> drivers/ufs/host/ufs-qcom.h | 1 +
>> 2 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
>> index c43bb75d208c..ab5aed241913 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -686,6 +686,7 @@ static int ufs_qcom_cfg_timers(struct ufs_hba *hba, bool is_pre_scale_up, unsign
>> static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
>> enum ufs_notify_change_status status)
>> {
>> + struct ufs_qcom_host *host = ufshcd_get_variant(hba);
>> int err = 0;
>>
>> switch (status) {
>> @@ -708,6 +709,10 @@ static int ufs_qcom_link_startup_notify(struct ufs_hba *hba,
>> */
>> err = ufshcd_disable_host_tx_lcc(hba);
>>
>> + /* Update REG_UFS_DEBUG_SPARE_CFG to set HS-LSS mode in link startup */
>
> "HS/LS"?
I've Change wording ("HS/LS" instead of "HS-LSS") in next patchset.
>
>> + if (host->hw_ver.major == 0x6 && host->hw_ver.minor == 0x2)
>> + ufshcd_writel(hba, host->spare_cfg,
>> + REG_UFS_DEBUG_SPARE_CFG);
>
> Is that a "only on v6.2", or "starting with v6.2"?
I've Change version check from "only v6.2" to "starting with v6.2" in
next patchset.
>
> Also, I see that this register has more than just this one field, with
> the previous question in mind, I think a rmw would be desired here
I'm using ufshcd_writel since this register is only configured by the
bootloader and no kernel code writes other fields to it, ufshcd_writel
is sufficient as there are no kernel written bits to preserve via rmw.
Thanks,
Nitin
>
> Konrad
next prev parent reply other threads:[~2026-08-26 5:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 14:13 [PATCH V1 0/3] ufs: ufs-qcom: Fixes and optimizations for Qualcomm UFS platform Nitin Rawat
2026-01-22 14:13 ` [PATCH V1 1/3] ufs: ufs-qcom: Add UFS ESI CPU affinity support Nitin Rawat
2026-01-23 0:57 ` Bart Van Assche
2026-01-22 14:13 ` [PATCH V1 2/3] ufs: ufs-qcom: Align programming sequence for UFS controller v6.2 Nitin Rawat
2026-01-22 15:09 ` Konrad Dybcio
2026-08-26 5:27 ` Nitin Rawat [this message]
2026-01-22 14:13 ` [PATCH V1 3/3] ufs: ufs-qcom: Fix sequential read variance Nitin Rawat
2026-01-22 15:11 ` Konrad Dybcio
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=c3e802f9-4657-4595-92a7-14436d2d2fb6@oss.qualcomm.com \
--to=nitin.rawat@oss.qualcomm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.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