Linux-Clk Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] clk: qcom: smd: Add missing pnoc clock
@ 2019-11-07 19:06 Jeffrey Hugo
  2019-11-07 21:42 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey Hugo @ 2019-11-07 19:06 UTC (permalink / raw)
  To: mturquette, sboyd
  Cc: agross, bjorn.andersson, sibis, linux-arm-msm, linux-clk,
	linux-kernel, Jeffrey Hugo

When MSM8998 support was added, and analysis was done to determine what
clocks would be consumed.  That analysis had a flaw, which caused the
pnoc to be skipped.  The pnoc clock needs to be on to access the uart
for the console.  The clock is on from boot, but has no consumer votes
in the RPM.  When we attempt to boot the modem, it causes the RPM to
turn off pnoc, which kills our access to the console and causes CPU hangs.

We need pnoc to be defined, so that clk_smd_rpm_handoff() will put in
an implicit vote for linux and prevent issues when booting modem.
Hopefully pnoc can be consumed by the interconnect framework in future
so that Linux can rely on explicit votes.

Fixes: 6131dc81211c ("clk: qcom: smd: Add support for MSM8998 rpm clocks")
Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
---
 drivers/clk/qcom/clk-smd-rpm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
index fef5e8157061..930fa4a4c52a 100644
--- a/drivers/clk/qcom/clk-smd-rpm.c
+++ b/drivers/clk/qcom/clk-smd-rpm.c
@@ -648,6 +648,7 @@ static const struct rpm_smd_clk_desc rpm_clk_qcs404 = {
 };
 
 /* msm8998 */
+DEFINE_CLK_SMD_RPM(msm8998, pcnoc_clk, pcnoc_a_clk, QCOM_SMD_RPM_BUS_CLK, 0);
 DEFINE_CLK_SMD_RPM(msm8998, snoc_clk, snoc_a_clk, QCOM_SMD_RPM_BUS_CLK, 1);
 DEFINE_CLK_SMD_RPM(msm8998, cnoc_clk, cnoc_a_clk, QCOM_SMD_RPM_BUS_CLK, 2);
 DEFINE_CLK_SMD_RPM(msm8998, ce1_clk, ce1_a_clk, QCOM_SMD_RPM_CE_CLK, 0);
@@ -670,6 +671,8 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk2_pin, rf_clk2_a_pin, 5);
 DEFINE_CLK_SMD_RPM_XO_BUFFER(msm8998, rf_clk3, rf_clk3_a, 6);
 DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk3_pin, rf_clk3_a_pin, 6);
 static struct clk_smd_rpm *msm8998_clks[] = {
+	[RPM_SMD_PCNOC_CLK] = &msm8998_pcnoc_clk,
+	[RPM_SMD_PCNOC_A_CLK] = &msm8998_pcnoc_a_clk,
 	[RPM_SMD_SNOC_CLK] = &msm8998_snoc_clk,
 	[RPM_SMD_SNOC_A_CLK] = &msm8998_snoc_a_clk,
 	[RPM_SMD_CNOC_CLK] = &msm8998_cnoc_clk,
-- 
2.17.1


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

* Re: [PATCH] clk: qcom: smd: Add missing pnoc clock
  2019-11-07 19:06 [PATCH] clk: qcom: smd: Add missing pnoc clock Jeffrey Hugo
@ 2019-11-07 21:42 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2019-11-07 21:42 UTC (permalink / raw)
  To: Jeffrey Hugo, mturquette
  Cc: agross, bjorn.andersson, sibis, linux-arm-msm, linux-clk,
	linux-kernel, Jeffrey Hugo

Quoting Jeffrey Hugo (2019-11-07 11:06:15)
> When MSM8998 support was added, and analysis was done to determine what
> clocks would be consumed.  That analysis had a flaw, which caused the
> pnoc to be skipped.  The pnoc clock needs to be on to access the uart
> for the console.  The clock is on from boot, but has no consumer votes
> in the RPM.  When we attempt to boot the modem, it causes the RPM to
> turn off pnoc, which kills our access to the console and causes CPU hangs.
> 
> We need pnoc to be defined, so that clk_smd_rpm_handoff() will put in
> an implicit vote for linux and prevent issues when booting modem.
> Hopefully pnoc can be consumed by the interconnect framework in future
> so that Linux can rely on explicit votes.
> 
> Fixes: 6131dc81211c ("clk: qcom: smd: Add support for MSM8998 rpm clocks")
> Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
> ---

Applied to clk-next


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 19:06 [PATCH] clk: qcom: smd: Add missing pnoc clock Jeffrey Hugo
2019-11-07 21:42 ` 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
	public-inbox-index linux-clk

Example config snippet for mirrors

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.git