From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Eric Chanudet <echanude@redhat.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Andrew Halaney <ahalaney@redhat.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
andersson@kernel.org, konrad.dybcio@linaro.org,
jejb@linux.ibm.com, linux-arm-msm@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 6.8 08/98] scsi: ufs: qcom: Avoid re-init quirk when gears match
Date: Fri, 29 Mar 2024 08:36:39 -0400 [thread overview]
Message-ID: <20240329123919.3087149-8-sashal@kernel.org> (raw)
In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org>
From: Eric Chanudet <echanude@redhat.com>
[ Upstream commit 10a39667a117daf0c1baaebcbe589715ee79178b ]
On sa8775p-ride, probing the HBA will go through the
UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH path although the power info is
the same during the second init.
The REINIT quirk only applies starting with controller v4. For these,
ufs_qcom_get_hs_gear() reads the highest supported gear when setting the
host_params. After the negotiation, if the host and device are on the same
gear, it is the highest gear supported between the two. Skip REINIT to save
some time.
Signed-off-by: Eric Chanudet <echanude@redhat.com>
Link: https://lore.kernel.org/r/20240123192854.1724905-4-echanude@redhat.com
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ufs/host/ufs-qcom.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 39eef470f8fa5..f7dba7236c6e5 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -738,8 +738,17 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
* the second init can program the optimal PHY settings. This allows one to start
* the first init with either the minimum or the maximum support gear.
*/
- if (hba->ufshcd_state == UFSHCD_STATE_RESET)
- host->phy_gear = dev_req_params->gear_tx;
+ if (hba->ufshcd_state == UFSHCD_STATE_RESET) {
+ /*
+ * Skip REINIT if the negotiated gear matches with the
+ * initial phy_gear. Otherwise, update the phy_gear to
+ * program the optimal gear setting during REINIT.
+ */
+ if (host->phy_gear == dev_req_params->gear_tx)
+ hba->quirks &= ~UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH;
+ else
+ host->phy_gear = dev_req_params->gear_tx;
+ }
/* enable the device ref clock before changing to HS mode */
if (!ufshcd_is_hs_mode(&hba->pwr_info) &&
--
2.43.0
next parent reply other threads:[~2024-03-29 12:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240329123919.3087149-1-sashal@kernel.org>
2024-03-29 12:36 ` Sasha Levin [this message]
2024-03-29 12:36 ` [PATCH AUTOSEL 6.8 11/98] arm64: dts: qcom: sdm630: add USB QMP PHY support Sasha Levin
2024-03-29 12:36 ` [PATCH AUTOSEL 6.8 12/98] arm64: dts: qcom: sda660-ifc6560: enable USB 3.0 PHY Sasha Levin
2024-03-29 12:36 ` [PATCH AUTOSEL 6.8 13/98] arm64: dts: qcom: Add support for Xiaomi Redmi Note 9S Sasha Levin
2024-03-29 12:37 ` [PATCH AUTOSEL 6.8 33/98] arm64: dts: qcom: qcs6490-rb3gen2: Declare GCC clocks protected Sasha Levin
2024-03-29 12:37 ` [PATCH AUTOSEL 6.8 36/98] arm64: dts: sc8280xp: correct DMIC2 and DMIC3 pin config node names Sasha Levin
2024-04-02 7:23 ` Johan Hovold
2024-04-02 10:17 ` Krzysztof Kozlowski
2024-04-07 23:46 ` Sasha Levin
2024-03-29 12:37 ` [PATCH AUTOSEL 6.8 37/98] arm64: dts: sm8450: " Sasha Levin
2024-03-29 12:37 ` [PATCH AUTOSEL 6.8 38/98] arm64: dts: sm8550: " Sasha Levin
2024-03-29 12:37 ` [PATCH AUTOSEL 6.8 39/98] arm64: dts: sm8650: " Sasha Levin
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=20240329123919.3087149-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=ahalaney@redhat.com \
--cc=andersson@kernel.org \
--cc=echanude@redhat.com \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
/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