Linux-Clk Archive on lore.kernel.org
 help / Atom feed
* [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998
@ 2019-01-04 16:50 Jeffrey Hugo
  2019-01-09 18:59 ` Stephen Boyd
  2019-01-09 18:59 ` Stephen Boyd
  0 siblings, 2 replies; 4+ messages in thread
From: Jeffrey Hugo @ 2019-01-04 16:50 UTC (permalink / raw)
  To: mturquette, sboyd
  Cc: bjorn.andersson, andy.gross, david.brown, linux-arm-msm,
	linux-clk, linux-kernel, kishon, robh+dt, mark.rutland,
	devicetree, gregkh, balbi, linux-usb, Jeffrey Hugo

The gcc_usb3_phy_pipe_clk is generated by the phy, but is also used by
the phy during init.  The clock needs to be enabled during the init
sequence, but may not be fully active until after the init sequence is
complete.  This causes a catch-22 if the clock status is checked during
enable.  As a result, skip the checks to avoid the troubling situation.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
---
 drivers/clk/qcom/gcc-msm8998.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c
index 42de947..1a1806a 100644
--- a/drivers/clk/qcom/gcc-msm8998.c
+++ b/drivers/clk/qcom/gcc-msm8998.c
@@ -2496,7 +2496,7 @@ enum {
 
 static struct clk_branch gcc_usb3_phy_pipe_clk = {
 	.halt_reg = 0x50004,
-	.halt_check = BRANCH_HALT,
+	.halt_check = BRANCH_HALT_SKIP,
 	.clkr = {
 		.enable_reg = 0x50004,
 		.enable_mask = BIT(0),
-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.


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

* Re: [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998
  2019-01-04 16:50 [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998 Jeffrey Hugo
@ 2019-01-09 18:59 ` Stephen Boyd
  2019-01-09 19:28   ` Jeffrey Hugo
  2019-01-09 18:59 ` Stephen Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2019-01-09 18:59 UTC (permalink / raw)
  To: Jeffrey Hugo, mturquette
  Cc: bjorn.andersson, andy.gross, david.brown, linux-arm-msm,
	linux-clk, linux-kernel, kishon, robh+dt, mark.rutland,
	devicetree, gregkh, balbi, linux-usb, Jeffrey Hugo

Quoting Jeffrey Hugo (2019-01-04 08:50:15)
> The gcc_usb3_phy_pipe_clk is generated by the phy, but is also used by
> the phy during init.  The clock needs to be enabled during the init
> sequence, but may not be fully active until after the init sequence is
> complete.  This causes a catch-22 if the clock status is checked during
> enable.  As a result, skip the checks to avoid the troubling situation.

I will ask again, is anyone going to fix this in the phy driver? In
theory it isn't needed if the phy driver can do things differently, but
last time I checked I was told that the phy team said it had to be done
this way.


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

* Re: [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998
  2019-01-04 16:50 [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998 Jeffrey Hugo
  2019-01-09 18:59 ` Stephen Boyd
@ 2019-01-09 18:59 ` Stephen Boyd
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2019-01-09 18:59 UTC (permalink / raw)
  To: Jeffrey Hugo, mturquette
  Cc: bjorn.andersson, andy.gross, david.brown, linux-arm-msm,
	linux-clk, linux-kernel, kishon, robh+dt, mark.rutland,
	devicetree, gregkh, balbi, linux-usb, Jeffrey Hugo

Quoting Jeffrey Hugo (2019-01-04 08:50:15)
> The gcc_usb3_phy_pipe_clk is generated by the phy, but is also used by
> the phy during init.  The clock needs to be enabled during the init
> sequence, but may not be fully active until after the init sequence is
> complete.  This causes a catch-22 if the clock status is checked during
> enable.  As a result, skip the checks to avoid the troubling situation.
> 
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---

Applied to clk-next


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

* Re: [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998
  2019-01-09 18:59 ` Stephen Boyd
@ 2019-01-09 19:28   ` Jeffrey Hugo
  0 siblings, 0 replies; 4+ messages in thread
From: Jeffrey Hugo @ 2019-01-09 19:28 UTC (permalink / raw)
  To: Stephen Boyd, mturquette
  Cc: bjorn.andersson, andy.gross, david.brown, linux-arm-msm,
	linux-clk, linux-kernel, kishon, robh+dt, mark.rutland,
	devicetree, gregkh, balbi, linux-usb

On 1/9/2019 11:59 AM, Stephen Boyd wrote:
> Quoting Jeffrey Hugo (2019-01-04 08:50:15)
>> The gcc_usb3_phy_pipe_clk is generated by the phy, but is also used by
>> the phy during init.  The clock needs to be enabled during the init
>> sequence, but may not be fully active until after the init sequence is
>> complete.  This causes a catch-22 if the clock status is checked during
>> enable.  As a result, skip the checks to avoid the troubling situation.
> 
> I will ask again, is anyone going to fix this in the phy driver? In
> theory it isn't needed if the phy driver can do things differently, but
> last time I checked I was told that the phy team said it had to be done
> this way.
> 

Interesting.  I was unaware of past discussion(s) on this.  Thank you 
for taking the change, but I'll try having a look to see if maybe I can 
prove your theory going forward.

-- 
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm 
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04 16:50 [PATCH v1 2/6] clk: qcom: Skip halt checks on gcc_usb3_phy_pipe_clk for 8998 Jeffrey Hugo
2019-01-09 18:59 ` Stephen Boyd
2019-01-09 19:28   ` Jeffrey Hugo
2019-01-09 18:59 ` Stephen Boyd

Linux-Clk Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-clk/0 linux-clk/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-clk linux-clk/ https://lore.kernel.org/linux-clk \
		linux-clk@vger.kernel.org linux-clk@archiver.kernel.org
	public-inbox-index linux-clk


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-clk


AGPL code for this site: git clone https://public-inbox.org/ public-inbox