[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190724191803.918536116@linuxfoundation.org>
Date: Wed, 24 Jul 2019 21:21:42 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Evan Green <evgreen@...omium.org>,
Marc Gonzalez <marc.w.gonzalez@...e.fr>,
Vivek Gautam <vivek.gautam@...eaurora.org>,
Niklas Cassel <niklas.cassel@...aro.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Kishon Vijay Abraham I <kishon@...com>
Subject: [PATCH 5.2 411/413] phy: qcom-qmp: Correct READY_STATUS poll break condition
From: Bjorn Andersson <bjorn.andersson@...aro.org>
commit 885bd765963b42c380db442db7f1c0f2a26076fa upstream.
After issuing a PHY_START request to the QMP, the hardware documentation
states that the software should wait for the PCS_READY_STATUS to become
1.
With the introduction of commit c9b589791fc1 ("phy: qcom: Utilize UFS
reset controller") an additional 1ms delay was introduced between the
start request and the check of the status bit. This greatly increases
the chances for the hardware to actually becoming ready before the
status bit is read.
The result can be seen in that UFS PHY enabling is now reported as a
failure in 10% of the boots on SDM845, which is a clear regression from
the previous rare/occasional failure.
This patch fixes the "break condition" of the poll to check for the
correct state of the status bit.
Unfortunately PCIe on 8996 and 8998 does not specify the mask_pcs_ready
register, which means that the code checks a bit that's always 0. So the
patch also fixes these, in order to not regress these targets.
Fixes: 73d7ec899bd8 ("phy: qcom-qmp: Add msm8998 PCIe QMP PHY support")
Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets")
Cc: stable@...r.kernel.org
Cc: Evan Green <evgreen@...omium.org>
Cc: Marc Gonzalez <marc.w.gonzalez@...e.fr>
Cc: Vivek Gautam <vivek.gautam@...eaurora.org>
Reviewed-by: Evan Green <evgreen@...omium.org>
Reviewed-by: Niklas Cassel <niklas.cassel@...aro.org>
Reviewed-by: Marc Gonzalez <marc.w.gonzalez@...e.fr>
Tested-by: Marc Gonzalez <marc.w.gonzalez@...e.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/phy/qualcomm/phy-qcom-qmp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -1074,6 +1074,7 @@ static const struct qmp_phy_cfg msm8996_
.start_ctrl = PCS_START | PLL_READY_GATE_EN,
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
+ .mask_pcs_ready = PHYSTATUS,
.mask_com_pcs_ready = PCS_READY,
.has_phy_com_ctrl = true,
@@ -1253,6 +1254,7 @@ static const struct qmp_phy_cfg msm8998_
.start_ctrl = SERDES_START | PCS_START,
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
+ .mask_pcs_ready = PHYSTATUS,
.mask_com_pcs_ready = PCS_READY,
};
@@ -1547,7 +1549,7 @@ static int qcom_qmp_phy_enable(struct ph
status = pcs + cfg->regs[QPHY_PCS_READY_STATUS];
mask = cfg->mask_pcs_ready;
- ret = readl_poll_timeout(status, val, !(val & mask), 1,
+ ret = readl_poll_timeout(status, val, val & mask, 1,
PHY_INIT_COMPLETE_TIMEOUT);
if (ret) {
dev_err(qmp->dev, "phy initialization timed-out\n");
Powered by blists - more mailing lists