mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer
@ 2023-12-04  9:55 Stephan Gerhold
  2023-12-04 11:00 ` Konrad Dybcio
  2023-12-17 17:21 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Stephan Gerhold @ 2023-12-04  9:55 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Andy Gross, Konrad Dybcio, Shawn Guo, Benjamin Li, James Willcox,
	Bryan O'Donoghue, Leo Yan, Vincent Knecht, Jun Nie,
	linux-arm-msm, devicetree, linux-kernel, Stephan Gerhold

Looks like not all firmware versions used for MSM8939 program the timer
frequency for both broadcast/MMIO timers, causing a WARNING at runtime:

WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:38 cev_delta2ns+0x74/0x90
pc : cev_delta2ns+0x74/0x90
lr : clockevents_config.part.0+0x64/0x8c
Call trace:
 cev_delta2ns+0x74/0x90
 clockevents_config_and_register+0x20/0x34
 arch_timer_mem_of_init+0x374/0x534
 timer_probe+0x88/0x110
 time_init+0x14/0x4c
 start_kernel+0x2c0/0x640

Unfortunately there is no way to fix the firmware on most of these
devices since it's proprietary and signed. As a workaround, specify the
clock-frequency explicitly in the DT to fix the warning.

Fixes: 61550c6c156c ("arm64: dts: qcom: Add msm8939 SoC")
Reported-by: Vincent Knecht <vincent.knecht@mailoo.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
 arch/arm64/boot/dts/qcom/msm8939.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index 95610a32750a..4ba115eecfd5 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -2195,6 +2195,8 @@ timer@b120000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
+			/* Necessary because firmware does not configure this correctly */
+			clock-frequency = <19200000>;
 
 			frame@b121000 {
 				reg = <0x0b121000 0x1000>,

---
base-commit: adcad44bd1c73a5264bff525e334e2f6fc01bb9b
change-id: 20231204-msm8939-timer-c8c218aa2440

Best regards,
-- 
Stephan Gerhold <stephan@gerhold.net>


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

* Re: [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer
  2023-12-04  9:55 [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer Stephan Gerhold
@ 2023-12-04 11:00 ` Konrad Dybcio
  2023-12-17 17:21 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2023-12-04 11:00 UTC (permalink / raw)
  To: Stephan Gerhold, Bjorn Andersson
  Cc: Andy Gross, Shawn Guo, Benjamin Li, James Willcox,
	Bryan O'Donoghue, Leo Yan, Vincent Knecht, Jun Nie,
	linux-arm-msm, devicetree, linux-kernel

On 4.12.2023 10:55, Stephan Gerhold wrote:
> Looks like not all firmware versions used for MSM8939 program the timer
> frequency for both broadcast/MMIO timers, causing a WARNING at runtime:
> 
> WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:38 cev_delta2ns+0x74/0x90
> pc : cev_delta2ns+0x74/0x90
> lr : clockevents_config.part.0+0x64/0x8c
> Call trace:
>  cev_delta2ns+0x74/0x90
>  clockevents_config_and_register+0x20/0x34
>  arch_timer_mem_of_init+0x374/0x534
>  timer_probe+0x88/0x110
>  time_init+0x14/0x4c
>  start_kernel+0x2c0/0x640
> 
> Unfortunately there is no way to fix the firmware on most of these
> devices since it's proprietary and signed. As a workaround, specify the
> clock-frequency explicitly in the DT to fix the warning.
> 
> Fixes: 61550c6c156c ("arm64: dts: qcom: Add msm8939 SoC")
> Reported-by: Vincent Knecht <vincent.knecht@mailoo.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
Ouch.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer
  2023-12-04  9:55 [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer Stephan Gerhold
  2023-12-04 11:00 ` Konrad Dybcio
@ 2023-12-17 17:21 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2023-12-17 17:21 UTC (permalink / raw)
  To: Stephan Gerhold
  Cc: Andy Gross, Konrad Dybcio, Shawn Guo, Benjamin Li, James Willcox,
	Bryan O'Donoghue, Leo Yan, Vincent Knecht, Jun Nie,
	linux-arm-msm, devicetree, linux-kernel


On Mon, 04 Dec 2023 10:55:53 +0100, Stephan Gerhold wrote:
> Looks like not all firmware versions used for MSM8939 program the timer
> frequency for both broadcast/MMIO timers, causing a WARNING at runtime:
> 
> WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:38 cev_delta2ns+0x74/0x90
> pc : cev_delta2ns+0x74/0x90
> lr : clockevents_config.part.0+0x64/0x8c
> Call trace:
>  cev_delta2ns+0x74/0x90
>  clockevents_config_and_register+0x20/0x34
>  arch_timer_mem_of_init+0x374/0x534
>  timer_probe+0x88/0x110
>  time_init+0x14/0x4c
>  start_kernel+0x2c0/0x640
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer
      commit: 12844ac08c593c2dd232b1b0d96ee21944dfb044

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2023-12-17 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04  9:55 [PATCH] arm64: dts: qcom: msm8939: Add clock-frequency for broadcast timer Stephan Gerhold
2023-12-04 11:00 ` Konrad Dybcio
2023-12-17 17:21 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®