All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS
@ 2019-12-09 22:00 Evan Green
  2019-12-10 18:49 ` Evan Green
  2019-12-10 19:02 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Evan Green @ 2019-12-09 22:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Bjorn Andersson
  Cc: Can Guo, Douglas Anderson, Evan Green, linux-kernel, Andy Gross,
	linux-arm-msm

The SDM845 UFS phy seems to want to do a low transition to become
ready, rather than a high transition. Without this, I am unable to
enumerate UFS on SDM845 when booted from USB.

Fixes: 14ced7e3a1a ('phy: qcom-qmp: Correct ready status, again')

Signed-off-by: Evan Green <evgreen@chromium.org>
---

Bjorn,
At this point I'm super confused on what the correct behavior
should be. Lack of documentation doesn't help. I'm worried that this
change breaks UFS on some other platforms, so I'm hoping you or some
PHY folks might have some advice on what the right thing to do is.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
index 091e20303a14d..c4f4294360b6e 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -1657,7 +1657,7 @@ static int qcom_qmp_phy_enable(struct phy *phy)
 	if (cfg->type == PHY_TYPE_UFS) {
 		status = pcs + cfg->regs[QPHY_PCS_READY_STATUS];
 		mask = PCS_READY;
-		ready = PCS_READY;
+		ready = 0;
 	} else {
 		status = pcs + cfg->regs[QPHY_PCS_STATUS];
 		mask = PHYSTATUS;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS
  2019-12-09 22:00 [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS Evan Green
@ 2019-12-10 18:49 ` Evan Green
  2019-12-10 19:02 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Evan Green @ 2019-12-10 18:49 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Bjorn Andersson
  Cc: Can Guo, Douglas Anderson, LKML, Andy Gross, linux-arm-msm

On Mon, Dec 9, 2019 at 2:00 PM Evan Green <evgreen@chromium.org> wrote:
>
> The SDM845 UFS phy seems to want to do a low transition to become
> ready, rather than a high transition. Without this, I am unable to
> enumerate UFS on SDM845 when booted from USB.
>
> Fixes: 14ced7e3a1a ('phy: qcom-qmp: Correct ready status, again')
>
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---
>
> Bjorn,
> At this point I'm super confused on what the correct behavior
> should be. Lack of documentation doesn't help. I'm worried that this
> change breaks UFS on some other platforms, so I'm hoping you or some
> PHY folks might have some advice on what the right thing to do is.

Disregard this patch. Bjorn pointed me to the patch below, which is
the right fix for my issue:
https://lore.kernel.org/linux-arm-msm/20191107000917.1092409-3-bjorn.andersson@linaro.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS
  2019-12-09 22:00 [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS Evan Green
  2019-12-10 18:49 ` Evan Green
@ 2019-12-10 19:02 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2019-12-10 19:02 UTC (permalink / raw)
  To: Evan Green
  Cc: Kishon Vijay Abraham I, Can Guo, Douglas Anderson, linux-kernel,
	Andy Gross, linux-arm-msm

On Mon 09 Dec 14:00 PST 2019, Evan Green wrote:

> The SDM845 UFS phy seems to want to do a low transition to become
> ready, rather than a high transition. Without this, I am unable to
> enumerate UFS on SDM845 when booted from USB.
> 
> Fixes: 14ced7e3a1a ('phy: qcom-qmp: Correct ready status, again')
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>

As concluded offline, the current logic is correct, but for some reason
we need a longer timeout on this particular device.

Regards,
Bjorn

> ---
> 
> Bjorn,
> At this point I'm super confused on what the correct behavior
> should be. Lack of documentation doesn't help. I'm worried that this
> change breaks UFS on some other platforms, so I'm hoping you or some
> PHY folks might have some advice on what the right thing to do is.
> 
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
> index 091e20303a14d..c4f4294360b6e 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
> @@ -1657,7 +1657,7 @@ static int qcom_qmp_phy_enable(struct phy *phy)
>  	if (cfg->type == PHY_TYPE_UFS) {
>  		status = pcs + cfg->regs[QPHY_PCS_READY_STATUS];
>  		mask = PCS_READY;
> -		ready = PCS_READY;
> +		ready = 0;
>  	} else {
>  		status = pcs + cfg->regs[QPHY_PCS_STATUS];
>  		mask = PHYSTATUS;
> -- 
> 2.21.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-10 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 22:00 [PATCH] phy: ufs-qcom: Invert PCS ready logic for SDM845 UFS Evan Green
2019-12-10 18:49 ` Evan Green
2019-12-10 19:02 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.