* [PATCH v8 00/10] Enable HS-G5 support on SM8550
@ 2023-12-02 12:36 Can Guo
2023-12-02 12:36 ` [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Can Guo @ 2023-12-02 12:36 UTC (permalink / raw)
To: quic_cang, bvanassche, mani, adrian.hunter, vkoul, beanhuo,
avri.altman, junwoo80.lee, martin.petersen
Cc: linux-scsi, linux-arm-msm, Matthias Brugger,
AngeloGioacchino Del Regno,
open list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek
This series enables HS-G5 support on SM8550.
This series is rebased on below changes from Mani -
https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-1-manivannan.sadhasivam@linaro.org/
https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-2-manivannan.sadhasivam@linaro.org/
This series is tested on below HW combinations -
SM8550 MTP + UFS4.0
SM8550 QRD + UFS3.1
SM8450 MTP + UFS3.1 (for regression test)
SM8350 MTP + UFS3.1 (for regression test)
Note that during reboot test on above platforms, I occasinally hit PA (PHY)
error during the 2nd init, this is not related with this series. A fix for
this is mentioned in below patchwork -
https://patchwork.kernel.org/project/linux-scsi/patch/1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com/
Also note that on platforms, which have two sets of UFS PHY settings are
provided (say G4 and no-G4, G5 and no-G5). The two sets of PHY settings are
basically programming different values to different registers, mixing the
two sets and/or overwriting one set with another set is definitely not
blessed by UFS PHY designers. For SM8550, this series will make sure we
honor the rule. However, for old targets Mani and I will fix them in
another series in future.
v7 -> v8:
In "scsi: ufs: ufs-qcom: Add support for UFS device version detection", fixed a BUG introduced from v6 -> v7. The spare register is added since HW ver 5, although reading the spare register on HW ver 4 is just getting 0x0, to be on the safe side, we are exluding HW ver 4.
v6 -> v7:
1. Rebased on linux-next, based SM8650 PHY settings are merged there, no changes to patches for UFS driver
2. Addressed comments from Mani
v5 -> v6:
1. Rebased on scsi-queue-6.8
2. Addressed comments from Dmitry and Mani in patches to phy-qcom-qmp-ufs.c
v4 -> v5:
Removed two useless debug prints in patch #9
v3 -> v4:
Used .tbls_hs_overlay array instead of adding more tables with different names like .tbls_hs_g5
v2 -> v3:
1. Addressed comments from Andrew, Mani and Bart in patch #1
2. Added patch #2 as per request from Andrew and Mani
3. Added patch #4 to fix a common issue on old targets, it is not necessary
for this series, but put in this series only because it would be easier
to maintain and no need to rebase
4. Addressed comments from Dmitry and Mani in patches to phy-qcom-qmp-ufs.c
v1 -> v2:
1. Removed 2 changes which were exposing power info in sysfs
2. Removed 1 change which was moving data structs to phy-qcom-qmp-ufs.h
3. Added one new change (the 1st one) to clean up usage of ufs_dev_params based on comments from Mani
4. Adjusted the logic of UFS device version detection according to comments from Mani:
4.1 For HW version < 0x5, go through dual init
4.2 For HW version >= 0x5
a. If UFS device version is populated, one init is required
b. If UFS device version is not populated, go through dual init
Bao D. Nguyen (1):
scsi: ufs: ufs-qcom: Add support for UFS device version detection
Can Guo (9):
scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
scsi: ufs: ufs-qcom: No need to set hs_rate after
ufshcd_init_host_param()
scsi: ufs: ufs-qcom: Setup host power mode during init
scsi: ufs: ufs-qcom: Allow the first init start with the maximum
supported gear
scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5
scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 4
and newer
scsi: ufs: ufs-qcom: Check return value of phy_set_mode_ext()
phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings
phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for
SM8550
drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h | 2 +
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h | 2 +
.../qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h | 9 +
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 191 ++++++++++++++++++---
drivers/ufs/host/ufs-exynos.c | 7 +-
drivers/ufs/host/ufs-hisi.c | 11 +-
drivers/ufs/host/ufs-mediatek.c | 12 +-
drivers/ufs/host/ufs-qcom.c | 97 ++++++++---
drivers/ufs/host/ufs-qcom.h | 7 +-
drivers/ufs/host/ufshcd-pltfrm.c | 69 ++++----
drivers/ufs/host/ufshcd-pltfrm.h | 10 +-
11 files changed, 309 insertions(+), 108 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
@ 2023-12-02 12:36 ` Can Guo
2023-12-04 2:53 ` Peter Wang (王信友)
2023-12-07 8:22 ` [PATCH v8 00/10] Enable HS-G5 support on SM8550 neil.armstrong
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Can Guo @ 2023-12-02 12:36 UTC (permalink / raw)
To: quic_cang, bvanassche, mani, adrian.hunter, vkoul, beanhuo,
avri.altman, junwoo80.lee, martin.petersen
Cc: linux-scsi, linux-arm-msm, Alim Akhtar, James E.J. Bottomley,
Krzysztof Kozlowski, Peter Wang, Stanley Jhu, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Matthias Brugger,
AngeloGioacchino Del Regno, Stanley Chu, Uwe Kleine-König,
Nitin Rawat, Brian Masney,
moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES,
open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES,
open list,
moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER...
Structure ufs_dev_params is actually used in UFS host vendor drivers to
declare host specific power mode parameters, like ufs_<vendor>_params or
host_cap, which makes the code not very straightforward to read. Rename the
structure ufs_dev_params to ufs_host_params and unify the declarations in
all vendor drivers to host_params.
In addition, rename the two functions ufshcd_init_pwr_dev_param() and
ufshcd_get_pwr_dev_param() which work based on the ufs_host_params to
ufshcd_init_host_params() and ufshcd_negotiate_pwr_params() respectively to
avoid confusions.
This change does not change any functionalities or logic.
Acked-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Nitin Rawat <quic_nitirawa@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Can Guo <quic_cang@quicinc.com>
---
drivers/ufs/host/ufs-exynos.c | 7 ++--
drivers/ufs/host/ufs-hisi.c | 11 +++----
drivers/ufs/host/ufs-mediatek.c | 12 +++----
drivers/ufs/host/ufs-qcom.c | 12 +++----
drivers/ufs/host/ufshcd-pltfrm.c | 69 ++++++++++++++++++++--------------------
drivers/ufs/host/ufshcd-pltfrm.h | 10 +++---
6 files changed, 57 insertions(+), 64 deletions(-)
diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c
index 71bd6db..734d40f 100644
--- a/drivers/ufs/host/ufs-exynos.c
+++ b/drivers/ufs/host/ufs-exynos.c
@@ -765,7 +765,7 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
{
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
struct phy *generic_phy = ufs->phy;
- struct ufs_dev_params ufs_exynos_cap;
+ struct ufs_host_params host_params;
int ret;
if (!dev_req_params) {
@@ -774,10 +774,9 @@ static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
goto out;
}
- ufshcd_init_pwr_dev_param(&ufs_exynos_cap);
+ ufshcd_init_host_params(&host_params);
- ret = ufshcd_get_pwr_dev_param(&ufs_exynos_cap,
- dev_max_params, dev_req_params);
+ ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params);
if (ret) {
pr_err("%s: failed to determine capabilities\n", __func__);
goto out;
diff --git a/drivers/ufs/host/ufs-hisi.c b/drivers/ufs/host/ufs-hisi.c
index 0229ac0..5ee73ff 100644
--- a/drivers/ufs/host/ufs-hisi.c
+++ b/drivers/ufs/host/ufs-hisi.c
@@ -293,9 +293,9 @@ static int ufs_hisi_link_startup_notify(struct ufs_hba *hba,
return err;
}
-static void ufs_hisi_set_dev_cap(struct ufs_dev_params *hisi_param)
+static void ufs_hisi_set_dev_cap(struct ufs_host_params *host_params)
{
- ufshcd_init_pwr_dev_param(hisi_param);
+ ufshcd_init_host_params(host_params);
}
static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)
@@ -365,7 +365,7 @@ static int ufs_hisi_pwr_change_notify(struct ufs_hba *hba,
struct ufs_pa_layer_attr *dev_max_params,
struct ufs_pa_layer_attr *dev_req_params)
{
- struct ufs_dev_params ufs_hisi_cap;
+ struct ufs_host_params host_params;
int ret = 0;
if (!dev_req_params) {
@@ -377,9 +377,8 @@ static int ufs_hisi_pwr_change_notify(struct ufs_hba *hba,
switch (status) {
case PRE_CHANGE:
- ufs_hisi_set_dev_cap(&ufs_hisi_cap);
- ret = ufshcd_get_pwr_dev_param(&ufs_hisi_cap,
- dev_max_params, dev_req_params);
+ ufs_hisi_set_dev_cap(&host_params);
+ ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params);
if (ret) {
dev_err(hba->dev,
"%s: failed to determine capabilities\n", __func__);
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index fc61790..776bca4 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -996,16 +996,14 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
- struct ufs_dev_params host_cap;
+ struct ufs_host_params host_params;
int ret;
- ufshcd_init_pwr_dev_param(&host_cap);
- host_cap.hs_rx_gear = UFS_HS_G5;
- host_cap.hs_tx_gear = UFS_HS_G5;
+ ufshcd_init_host_params(&host_params);
+ host_params.hs_rx_gear = UFS_HS_G5;
+ host_params.hs_tx_gear = UFS_HS_G5;
- ret = ufshcd_get_pwr_dev_param(&host_cap,
- dev_max_params,
- dev_req_params);
+ ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params);
if (ret) {
pr_info("%s: failed to determine capabilities\n",
__func__);
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 96cb8b5..197c5a5 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -898,7 +898,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
struct ufs_pa_layer_attr *dev_req_params)
{
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
- struct ufs_dev_params ufs_qcom_cap;
+ struct ufs_host_params host_params;
int ret = 0;
if (!dev_req_params) {
@@ -908,15 +908,13 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
switch (status) {
case PRE_CHANGE:
- ufshcd_init_pwr_dev_param(&ufs_qcom_cap);
- ufs_qcom_cap.hs_rate = UFS_QCOM_LIMIT_HS_RATE;
+ ufshcd_init_host_params(&host_params);
+ host_params.hs_rate = UFS_QCOM_LIMIT_HS_RATE;
/* This driver only supports symmetic gear setting i.e., hs_tx_gear == hs_rx_gear */
- ufs_qcom_cap.hs_tx_gear = ufs_qcom_cap.hs_rx_gear = ufs_qcom_get_hs_gear(hba);
+ host_params.hs_tx_gear = host_params.hs_rx_gear = ufs_qcom_get_hs_gear(hba);
- ret = ufshcd_get_pwr_dev_param(&ufs_qcom_cap,
- dev_max_params,
- dev_req_params);
+ ret = ufshcd_negotiate_pwr_params(&host_params, dev_max_params, dev_req_params);
if (ret) {
dev_err(hba->dev, "%s: failed to determine capabilities\n",
__func__);
diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index da2558e..1633edc 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -285,61 +285,60 @@ static int ufshcd_parse_operating_points(struct ufs_hba *hba)
}
/**
- * ufshcd_get_pwr_dev_param - get finally agreed attributes for
- * power mode change
- * @pltfrm_param: pointer to platform parameters
+ * ufshcd_negotiate_pwr_params - find power mode settings that are supported by
+ both the controller and the device
+ * @host_params: pointer to host parameters
* @dev_max: pointer to device attributes
* @agreed_pwr: returned agreed attributes
*
* Return: 0 on success, non-zero value on failure.
*/
-int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *pltfrm_param,
- const struct ufs_pa_layer_attr *dev_max,
- struct ufs_pa_layer_attr *agreed_pwr)
+int ufshcd_negotiate_pwr_params(const struct ufs_host_params *host_params,
+ const struct ufs_pa_layer_attr *dev_max,
+ struct ufs_pa_layer_attr *agreed_pwr)
{
- int min_pltfrm_gear;
+ int min_host_gear;
int min_dev_gear;
bool is_dev_sup_hs = false;
- bool is_pltfrm_max_hs = false;
+ bool is_host_max_hs = false;
if (dev_max->pwr_rx == FAST_MODE)
is_dev_sup_hs = true;
- if (pltfrm_param->desired_working_mode == UFS_HS_MODE) {
- is_pltfrm_max_hs = true;
- min_pltfrm_gear = min_t(u32, pltfrm_param->hs_rx_gear,
- pltfrm_param->hs_tx_gear);
+ if (host_params->desired_working_mode == UFS_HS_MODE) {
+ is_host_max_hs = true;
+ min_host_gear = min_t(u32, host_params->hs_rx_gear,
+ host_params->hs_tx_gear);
} else {
- min_pltfrm_gear = min_t(u32, pltfrm_param->pwm_rx_gear,
- pltfrm_param->pwm_tx_gear);
+ min_host_gear = min_t(u32, host_params->pwm_rx_gear,
+ host_params->pwm_tx_gear);
}
/*
- * device doesn't support HS but
- * pltfrm_param->desired_working_mode is HS,
- * thus device and pltfrm_param don't agree
+ * device doesn't support HS but host_params->desired_working_mode is HS,
+ * thus device and host_params don't agree
*/
- if (!is_dev_sup_hs && is_pltfrm_max_hs) {
+ if (!is_dev_sup_hs && is_host_max_hs) {
pr_info("%s: device doesn't support HS\n",
__func__);
return -ENOTSUPP;
- } else if (is_dev_sup_hs && is_pltfrm_max_hs) {
+ } else if (is_dev_sup_hs && is_host_max_hs) {
/*
* since device supports HS, it supports FAST_MODE.
- * since pltfrm_param->desired_working_mode is also HS
+ * since host_params->desired_working_mode is also HS
* then final decision (FAST/FASTAUTO) is done according
* to pltfrm_params as it is the restricting factor
*/
- agreed_pwr->pwr_rx = pltfrm_param->rx_pwr_hs;
+ agreed_pwr->pwr_rx = host_params->rx_pwr_hs;
agreed_pwr->pwr_tx = agreed_pwr->pwr_rx;
} else {
/*
- * here pltfrm_param->desired_working_mode is PWM.
+ * here host_params->desired_working_mode is PWM.
* it doesn't matter whether device supports HS or PWM,
- * in both cases pltfrm_param->desired_working_mode will
+ * in both cases host_params->desired_working_mode will
* determine the mode
*/
- agreed_pwr->pwr_rx = pltfrm_param->rx_pwr_pwm;
+ agreed_pwr->pwr_rx = host_params->rx_pwr_pwm;
agreed_pwr->pwr_tx = agreed_pwr->pwr_rx;
}
@@ -349,9 +348,9 @@ int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *pltfrm_param,
* the same decision will be made for rx
*/
agreed_pwr->lane_tx = min_t(u32, dev_max->lane_tx,
- pltfrm_param->tx_lanes);
+ host_params->tx_lanes);
agreed_pwr->lane_rx = min_t(u32, dev_max->lane_rx,
- pltfrm_param->rx_lanes);
+ host_params->rx_lanes);
/* device maximum gear is the minimum between device rx and tx gears */
min_dev_gear = min_t(u32, dev_max->gear_rx, dev_max->gear_tx);
@@ -364,26 +363,26 @@ int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *pltfrm_param,
* what is the gear, as it is the one that also decided previously what
* pwr the device will be configured to.
*/
- if ((is_dev_sup_hs && is_pltfrm_max_hs) ||
- (!is_dev_sup_hs && !is_pltfrm_max_hs)) {
+ if ((is_dev_sup_hs && is_host_max_hs) ||
+ (!is_dev_sup_hs && !is_host_max_hs)) {
agreed_pwr->gear_rx =
- min_t(u32, min_dev_gear, min_pltfrm_gear);
+ min_t(u32, min_dev_gear, min_host_gear);
} else if (!is_dev_sup_hs) {
agreed_pwr->gear_rx = min_dev_gear;
} else {
- agreed_pwr->gear_rx = min_pltfrm_gear;
+ agreed_pwr->gear_rx = min_host_gear;
}
agreed_pwr->gear_tx = agreed_pwr->gear_rx;
- agreed_pwr->hs_rate = pltfrm_param->hs_rate;
+ agreed_pwr->hs_rate = host_params->hs_rate;
return 0;
}
-EXPORT_SYMBOL_GPL(ufshcd_get_pwr_dev_param);
+EXPORT_SYMBOL_GPL(ufshcd_negotiate_pwr_params);
-void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param)
+void ufshcd_init_host_params(struct ufs_host_params *host_params)
{
- *dev_param = (struct ufs_dev_params){
+ *host_params = (struct ufs_host_params){
.tx_lanes = UFS_LANE_2,
.rx_lanes = UFS_LANE_2,
.hs_rx_gear = UFS_HS_G3,
@@ -398,7 +397,7 @@ void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param)
.desired_working_mode = UFS_HS_MODE,
};
}
-EXPORT_SYMBOL_GPL(ufshcd_init_pwr_dev_param);
+EXPORT_SYMBOL_GPL(ufshcd_init_host_params);
/**
* ufshcd_pltfrm_init - probe routine of the driver
diff --git a/drivers/ufs/host/ufshcd-pltfrm.h b/drivers/ufs/host/ufshcd-pltfrm.h
index a86a3ad..df387be 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.h
+++ b/drivers/ufs/host/ufshcd-pltfrm.h
@@ -10,7 +10,7 @@
#define UFS_PWM_MODE 1
#define UFS_HS_MODE 2
-struct ufs_dev_params {
+struct ufs_host_params {
u32 pwm_rx_gear; /* pwm rx gear to work in */
u32 pwm_tx_gear; /* pwm tx gear to work in */
u32 hs_rx_gear; /* hs rx gear to work in */
@@ -25,10 +25,10 @@ struct ufs_dev_params {
u32 desired_working_mode;
};
-int ufshcd_get_pwr_dev_param(const struct ufs_dev_params *dev_param,
- const struct ufs_pa_layer_attr *dev_max,
- struct ufs_pa_layer_attr *agreed_pwr);
-void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param);
+int ufshcd_negotiate_pwr_params(const struct ufs_host_params *host_params,
+ const struct ufs_pa_layer_attr *dev_max,
+ struct ufs_pa_layer_attr *agreed_pwr);
+void ufshcd_init_host_params(struct ufs_host_params *host_params);
int ufshcd_pltfrm_init(struct platform_device *pdev,
const struct ufs_hba_variant_ops *vops);
int ufshcd_populate_vreg(struct device *dev, const char *name,
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
2023-12-02 12:36 ` [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
@ 2023-12-04 2:53 ` Peter Wang (王信友)
0 siblings, 0 replies; 8+ messages in thread
From: Peter Wang (王信友) @ 2023-12-04 2:53 UTC (permalink / raw)
To: beanhuo@micron.com, avri.altman@wdc.com, bvanassche@acm.org,
martin.petersen@oracle.com, junwoo80.lee@samsung.com,
mani@kernel.org, vkoul@kernel.org, quic_cang@quicinc.com,
adrian.hunter@intel.com
Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mediatek@lists.infradead.org,
u.kleine-koenig@pengutronix.de, jejb@linux.ibm.com,
quic_nitirawa@quicinc.com, linux-arm-msm@vger.kernel.org,
krzysztof.kozlowski@linaro.org, linux-scsi@vger.kernel.org,
alim.akhtar@samsung.com, chu.stanley@gmail.com,
linux-arm-kernel@lists.infradead.org,
Stanley Chu (朱原陞), bmasney@redhat.com,
konrad.dybcio@linaro.org, matthias.bgg@gmail.com,
andersson@kernel.org, agross@kernel.org,
angelogioacchino.delregno@collabora.com
On Sat, 2023-12-02 at 04:36 -0800, Can Guo wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Structure ufs_dev_params is actually used in UFS host vendor drivers
> to
> declare host specific power mode parameters, like ufs_<vendor>_params
> or
> host_cap, which makes the code not very straightforward to read.
> Rename the
> structure ufs_dev_params to ufs_host_params and unify the
> declarations in
> all vendor drivers to host_params.
>
> In addition, rename the two functions ufshcd_init_pwr_dev_param() and
> ufshcd_get_pwr_dev_param() which work based on the ufs_host_params to
> ufshcd_init_host_params() and ufshcd_negotiate_pwr_params()
> respectively to
> avoid confusions.
>
> This change does not change any functionalities or logic.
>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v8 00/10] Enable HS-G5 support on SM8550
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
2023-12-02 12:36 ` [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
@ 2023-12-07 8:22 ` neil.armstrong
2023-12-07 8:26 ` Can Guo
2023-12-14 3:44 ` Martin K. Petersen
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: neil.armstrong @ 2023-12-07 8:22 UTC (permalink / raw)
To: Can Guo, bvanassche, mani, adrian.hunter, vkoul, beanhuo,
avri.altman, junwoo80.lee, martin.petersen
Cc: linux-scsi, linux-arm-msm, Matthias Brugger,
AngeloGioacchino Del Regno,
open list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek
Hi Can,
On 02/12/2023 13:36, Can Guo wrote:
> This series enables HS-G5 support on SM8550.
>
> This series is rebased on below changes from Mani -
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-1-manivannan.sadhasivam@linaro.org/
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-2-manivannan.sadhasivam@linaro.org/
>
> This series is tested on below HW combinations -
> SM8550 MTP + UFS4.0
> SM8550 QRD + UFS3.1
> SM8450 MTP + UFS3.1 (for regression test)
> SM8350 MTP + UFS3.1 (for regression test)
>
> Note that during reboot test on above platforms, I occasinally hit PA (PHY)
> error during the 2nd init, this is not related with this series. A fix for
> this is mentioned in below patchwork -
>
> https://patchwork.kernel.org/project/linux-scsi/patch/1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com/
>
> Also note that on platforms, which have two sets of UFS PHY settings are
> provided (say G4 and no-G4, G5 and no-G5). The two sets of PHY settings are
> basically programming different values to different registers, mixing the
> two sets and/or overwriting one set with another set is definitely not
> blessed by UFS PHY designers. For SM8550, this series will make sure we
> honor the rule. However, for old targets Mani and I will fix them in
> another series in future.
You dropped my tested-by tags, but I did a new test with v8 and:
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD
Thanks,
Neil
>
> v7 -> v8:
> In "scsi: ufs: ufs-qcom: Add support for UFS device version detection", fixed a BUG introduced from v6 -> v7. The spare register is added since HW ver 5, although reading the spare register on HW ver 4 is just getting 0x0, to be on the safe side, we are exluding HW ver 4.
>
> v6 -> v7:
> 1. Rebased on linux-next, based SM8650 PHY settings are merged there, no changes to patches for UFS driver
> 2. Addressed comments from Mani
>
> v5 -> v6:
> 1. Rebased on scsi-queue-6.8
> 2. Addressed comments from Dmitry and Mani in patches to phy-qcom-qmp-ufs.c
>
> v4 -> v5:
> Removed two useless debug prints in patch #9
>
> v3 -> v4:
> Used .tbls_hs_overlay array instead of adding more tables with different names like .tbls_hs_g5
>
> v2 -> v3:
> 1. Addressed comments from Andrew, Mani and Bart in patch #1
> 2. Added patch #2 as per request from Andrew and Mani
> 3. Added patch #4 to fix a common issue on old targets, it is not necessary
> for this series, but put in this series only because it would be easier
> to maintain and no need to rebase
> 4. Addressed comments from Dmitry and Mani in patches to phy-qcom-qmp-ufs.c
>
> v1 -> v2:
> 1. Removed 2 changes which were exposing power info in sysfs
> 2. Removed 1 change which was moving data structs to phy-qcom-qmp-ufs.h
> 3. Added one new change (the 1st one) to clean up usage of ufs_dev_params based on comments from Mani
> 4. Adjusted the logic of UFS device version detection according to comments from Mani:
> 4.1 For HW version < 0x5, go through dual init
> 4.2 For HW version >= 0x5
> a. If UFS device version is populated, one init is required
> b. If UFS device version is not populated, go through dual init
>
> Bao D. Nguyen (1):
> scsi: ufs: ufs-qcom: Add support for UFS device version detection
>
> Can Guo (9):
> scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
> scsi: ufs: ufs-qcom: No need to set hs_rate after
> ufshcd_init_host_param()
> scsi: ufs: ufs-qcom: Setup host power mode during init
> scsi: ufs: ufs-qcom: Allow the first init start with the maximum
> supported gear
> scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5
> scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 4
> and newer
> scsi: ufs: ufs-qcom: Check return value of phy_set_mode_ext()
> phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings
> phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for
> SM8550
>
> drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h | 2 +
> drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h | 2 +
> .../qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h | 9 +
> drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 191 ++++++++++++++++++---
> drivers/ufs/host/ufs-exynos.c | 7 +-
> drivers/ufs/host/ufs-hisi.c | 11 +-
> drivers/ufs/host/ufs-mediatek.c | 12 +-
> drivers/ufs/host/ufs-qcom.c | 97 ++++++++---
> drivers/ufs/host/ufs-qcom.h | 7 +-
> drivers/ufs/host/ufshcd-pltfrm.c | 69 ++++----
> drivers/ufs/host/ufshcd-pltfrm.h | 10 +-
> 11 files changed, 309 insertions(+), 108 deletions(-)
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v8 00/10] Enable HS-G5 support on SM8550
2023-12-07 8:22 ` [PATCH v8 00/10] Enable HS-G5 support on SM8550 neil.armstrong
@ 2023-12-07 8:26 ` Can Guo
0 siblings, 0 replies; 8+ messages in thread
From: Can Guo @ 2023-12-07 8:26 UTC (permalink / raw)
To: neil.armstrong, bvanassche, mani, adrian.hunter, vkoul, beanhuo,
avri.altman, junwoo80.lee, martin.petersen
Cc: linux-scsi, linux-arm-msm, Matthias Brugger,
AngeloGioacchino Del Regno,
open list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek
Hi Neil,
On 12/7/2023 4:22 PM, neil.armstrong@linaro.org wrote:
> Hi Can,
>
> On 02/12/2023 13:36, Can Guo wrote:
>> This series enables HS-G5 support on SM8550.
>>
>> This series is rebased on below changes from Mani -
>> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-1-manivannan.sadhasivam@linaro.org/
>> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-2-manivannan.sadhasivam@linaro.org/
>>
>> This series is tested on below HW combinations -
>> SM8550 MTP + UFS4.0
>> SM8550 QRD + UFS3.1
>> SM8450 MTP + UFS3.1 (for regression test)
>> SM8350 MTP + UFS3.1 (for regression test)
>>
>> Note that during reboot test on above platforms, I occasinally hit PA
>> (PHY)
>> error during the 2nd init, this is not related with this series. A fix
>> for
>> this is mentioned in below patchwork -
>>
>> https://patchwork.kernel.org/project/linux-scsi/patch/1698145815-17396-1-git-send-email-quic_ziqichen@quicinc.com/
>>
>> Also note that on platforms, which have two sets of UFS PHY settings are
>> provided (say G4 and no-G4, G5 and no-G5). The two sets of PHY
>> settings are
>> basically programming different values to different registers, mixing the
>> two sets and/or overwriting one set with another set is definitely not
>> blessed by UFS PHY designers. For SM8550, this series will make sure we
>> honor the rule. However, for old targets Mani and I will fix them in
>> another series in future.
>
> You dropped my tested-by tags, but I did a new test with v8 and:
>
> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD
> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD
>
Thank you so much for testing this series.
I am sorry that I dropped the tested-by tags, since I slightly updated
the last patch in this series, so I thought I should not apply the
Tested-by tags from you.
Thanks,
Can Guo.
> Thanks,
> Neil
>
>>
>> v7 -> v8:
>> In "scsi: ufs: ufs-qcom: Add support for UFS device version
>> detection", fixed a BUG introduced from v6 -> v7. The spare register
>> is added since HW ver 5, although reading the spare register on HW ver
>> 4 is just getting 0x0, to be on the safe side, we are exluding HW ver 4.
>>
>> v6 -> v7:
>> 1. Rebased on linux-next, based SM8650 PHY settings are merged there,
>> no changes to patches for UFS driver
>> 2. Addressed comments from Mani
>>
>> v5 -> v6:
>> 1. Rebased on scsi-queue-6.8
>> 2. Addressed comments from Dmitry and Mani in patches to
>> phy-qcom-qmp-ufs.c
>>
>> v4 -> v5:
>> Removed two useless debug prints in patch #9
>>
>> v3 -> v4:
>> Used .tbls_hs_overlay array instead of adding more tables with
>> different names like .tbls_hs_g5
>>
>> v2 -> v3:
>> 1. Addressed comments from Andrew, Mani and Bart in patch #1
>> 2. Added patch #2 as per request from Andrew and Mani
>> 3. Added patch #4 to fix a common issue on old targets, it is not
>> necessary
>> for this series, but put in this series only because it would be
>> easier
>> to maintain and no need to rebase
>> 4. Addressed comments from Dmitry and Mani in patches to
>> phy-qcom-qmp-ufs.c
>>
>> v1 -> v2:
>> 1. Removed 2 changes which were exposing power info in sysfs
>> 2. Removed 1 change which was moving data structs to phy-qcom-qmp-ufs.h
>> 3. Added one new change (the 1st one) to clean up usage of
>> ufs_dev_params based on comments from Mani
>> 4. Adjusted the logic of UFS device version detection according to
>> comments from Mani:
>> 4.1 For HW version < 0x5, go through dual init
>> 4.2 For HW version >= 0x5
>> a. If UFS device version is populated, one init is required
>> b. If UFS device version is not populated, go through dual init
>>
>> Bao D. Nguyen (1):
>> scsi: ufs: ufs-qcom: Add support for UFS device version detection
>>
>> Can Guo (9):
>> scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
>> scsi: ufs: ufs-qcom: No need to set hs_rate after
>> ufshcd_init_host_param()
>> scsi: ufs: ufs-qcom: Setup host power mode during init
>> scsi: ufs: ufs-qcom: Allow the first init start with the maximum
>> supported gear
>> scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5
>> scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 4
>> and newer
>> scsi: ufs: ufs-qcom: Check return value of phy_set_mode_ext()
>> phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings
>> phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for
>> SM8550
>>
>> drivers/phy/qualcomm/phy-qcom-qmp-pcs-ufs-v6.h | 2 +
>> drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-v6.h | 2 +
>> .../qualcomm/phy-qcom-qmp-qserdes-txrx-ufs-v6.h | 9 +
>> drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 191
>> ++++++++++++++++++---
>> drivers/ufs/host/ufs-exynos.c | 7 +-
>> drivers/ufs/host/ufs-hisi.c | 11 +-
>> drivers/ufs/host/ufs-mediatek.c | 12 +-
>> drivers/ufs/host/ufs-qcom.c | 97 ++++++++---
>> drivers/ufs/host/ufs-qcom.h | 7 +-
>> drivers/ufs/host/ufshcd-pltfrm.c | 69 ++++----
>> drivers/ufs/host/ufshcd-pltfrm.h | 10 +-
>> 11 files changed, 309 insertions(+), 108 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v8 00/10] Enable HS-G5 support on SM8550
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
2023-12-02 12:36 ` [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
2023-12-07 8:22 ` [PATCH v8 00/10] Enable HS-G5 support on SM8550 neil.armstrong
@ 2023-12-14 3:44 ` Martin K. Petersen
2023-12-19 2:18 ` Martin K. Petersen
2023-12-21 17:15 ` (subset) " Vinod Koul
4 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2023-12-14 3:44 UTC (permalink / raw)
To: Can Guo
Cc: bvanassche, mani, adrian.hunter, vkoul, beanhuo, avri.altman,
junwoo80.lee, martin.petersen, linux-scsi, linux-arm-msm,
Matthias Brugger, AngeloGioacchino Del Regno,
open list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek,
moderated list:ARM/Mediatek SoC support:Keyword:mediatek
Can,
> This series enables HS-G5 support on SM8550.
Applied patches 1-8 to 6.8/scsi-staging, thanks!
The phy patches didn't apply. I assume they'll go through the phy tree.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v8 00/10] Enable HS-G5 support on SM8550
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
` (2 preceding siblings ...)
2023-12-14 3:44 ` Martin K. Petersen
@ 2023-12-19 2:18 ` Martin K. Petersen
2023-12-21 17:15 ` (subset) " Vinod Koul
4 siblings, 0 replies; 8+ messages in thread
From: Martin K. Petersen @ 2023-12-19 2:18 UTC (permalink / raw)
To: bvanassche, mani, adrian.hunter, vkoul, beanhuo, avri.altman,
junwoo80.lee, Can Guo
Cc: Martin K . Petersen, linux-scsi, linux-arm-msm, Matthias Brugger,
AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
linux-mediatek
On Sat, 02 Dec 2023 04:36:06 -0800, Can Guo wrote:
> This series enables HS-G5 support on SM8550.
>
> This series is rebased on below changes from Mani -
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-1-manivannan.sadhasivam@linaro.org/
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-2-manivannan.sadhasivam@linaro.org/
>
> This series is tested on below HW combinations -
> SM8550 MTP + UFS4.0
> SM8550 QRD + UFS3.1
> SM8450 MTP + UFS3.1 (for regression test)
> SM8350 MTP + UFS3.1 (for regression test)
>
> [...]
Applied to 6.8/scsi-queue, thanks!
[01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params
https://git.kernel.org/mkp/scsi/c/fa3dca8251c4
[02/10] scsi: ufs: ufs-qcom: No need to set hs_rate after ufshcd_init_host_param()
https://git.kernel.org/mkp/scsi/c/dc604b4c9d60
[03/10] scsi: ufs: ufs-qcom: Setup host power mode during init
https://git.kernel.org/mkp/scsi/c/55820a7f2cb9
[04/10] scsi: ufs: ufs-qcom: Allow the first init start with the maximum supported gear
https://git.kernel.org/mkp/scsi/c/743e1f596ccc
[05/10] scsi: ufs: ufs-qcom: Limit HS-G5 Rate-A to hosts with HW version 5
https://git.kernel.org/mkp/scsi/c/9d8528a833fc
[06/10] scsi: ufs: ufs-qcom: Set initial PHY gear to max HS gear for HW ver 4 and newer
https://git.kernel.org/mkp/scsi/c/0bd3cb895d19
[07/10] scsi: ufs: ufs-qcom: Check return value of phy_set_mode_ext()
https://git.kernel.org/mkp/scsi/c/a68abdadfe13
[08/10] scsi: ufs: ufs-qcom: Add support for UFS device version detection
https://git.kernel.org/mkp/scsi/c/dc7c948d74e1
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: (subset) [PATCH v8 00/10] Enable HS-G5 support on SM8550
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
` (3 preceding siblings ...)
2023-12-19 2:18 ` Martin K. Petersen
@ 2023-12-21 17:15 ` Vinod Koul
4 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2023-12-21 17:15 UTC (permalink / raw)
To: bvanassche, mani, adrian.hunter, beanhuo, avri.altman,
junwoo80.lee, martin.petersen, Can Guo
Cc: linux-scsi, linux-arm-msm, Matthias Brugger,
AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
linux-mediatek
On Sat, 02 Dec 2023 04:36:06 -0800, Can Guo wrote:
> This series enables HS-G5 support on SM8550.
>
> This series is rebased on below changes from Mani -
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-1-manivannan.sadhasivam@linaro.org/
> https://patchwork.kernel.org/project/linux-scsi/patch/20230908145329.154024-2-manivannan.sadhasivam@linaro.org/
>
> This series is tested on below HW combinations -
> SM8550 MTP + UFS4.0
> SM8550 QRD + UFS3.1
> SM8450 MTP + UFS3.1 (for regression test)
> SM8350 MTP + UFS3.1 (for regression test)
>
> [...]
Applied, thanks!
[09/10] phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings
commit: 5301b7a04040b0a6191856c765146e0a9ab88ebc
[10/10] phy: qualcomm: phy-qcom-qmp-ufs: Add High Speed Gear 5 support for SM8550
(no commit info)
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-12-21 17:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 12:36 [PATCH v8 00/10] Enable HS-G5 support on SM8550 Can Guo
2023-12-02 12:36 ` [PATCH v8 01/10] scsi: ufs: host: Rename structure ufs_dev_params to ufs_host_params Can Guo
2023-12-04 2:53 ` Peter Wang (王信友)
2023-12-07 8:22 ` [PATCH v8 00/10] Enable HS-G5 support on SM8550 neil.armstrong
2023-12-07 8:26 ` Can Guo
2023-12-14 3:44 ` Martin K. Petersen
2023-12-19 2:18 ` Martin K. Petersen
2023-12-21 17:15 ` (subset) " Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox