linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [4.4-rc][PATCH] ARM: dts: am4372: fix clock source for arm twd and global timers
Date: Mon, 30 Nov 2015 10:25:56 +0200	[thread overview]
Message-ID: <565C0814.3000001@ti.com> (raw)
In-Reply-To: <1448653468-24908-1-git-send-email-grygorii.strashko@ti.com>

On 11/27/2015 09:44 PM, Grygorii Strashko wrote:
> ARM TWD and Global timer are clocked by PERIPHCLK which is MPU_CLK/2.
> But now they are clocked by dpll_mpu_m2_ck == MPU_CLK and, as result.
> Timekeeping core misbehaves. For example, execution of command
> "sleep 5" will take 10 sec instead of 5.
>
> Hence, fix it by adding mpu_periphclk ("fixed-factor-clock") and use
> it for clocking ARM TWD and Global timer (same way as on OMAP4).
>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Tero Kristo <t-kristo@ti.com>
> Fixes:commit 8cbd4c2f6a99 ("arm: boot: dts: am4372: add ARM timers and SCU nodes")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
>   arch/arm/boot/dts/am4372.dtsi        | 4 ++--
>   arch/arm/boot/dts/am43xx-clocks.dtsi | 8 ++++++++
>   2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
> index d83ff9c..de8791a 100644
> --- a/arch/arm/boot/dts/am4372.dtsi
> +++ b/arch/arm/boot/dts/am4372.dtsi
> @@ -74,7 +74,7 @@
>   		reg = <0x48240200 0x100>;
>   		interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
>   		interrupt-parent = <&gic>;
> -		clocks = <&dpll_mpu_m2_ck>;
> +		clocks = <&mpu_periphclk>;
>   	};
>
>   	local_timer: timer at 48240600 {
> @@ -82,7 +82,7 @@
>   		reg = <0x48240600 0x100>;
>   		interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
>   		interrupt-parent = <&gic>;
> -		clocks = <&dpll_mpu_m2_ck>;
> +		clocks = <&mpu_periphclk>;
>   	};
>
>   	l2-cache-controller at 48242000 {
> diff --git a/arch/arm/boot/dts/am43xx-clocks.dtsi b/arch/arm/boot/dts/am43xx-clocks.dtsi
> index cc88728..2ff58b1 100644
> --- a/arch/arm/boot/dts/am43xx-clocks.dtsi
> +++ b/arch/arm/boot/dts/am43xx-clocks.dtsi
> @@ -259,6 +259,14 @@
>   		ti,invert-autoidle-bit;
>   	};
>
> +	mpu_periphclk: mpu_periphclk {
> +		#clock-cells = <0>;
> +		compatible = "fixed-factor-clock";
> +		clocks = <&dpll_mpu_ck>;

I don't think this is correct, ARM core is fed dpll_mpu_m2_ck, where the 
divisor value can potentially differ from 1. If you feed this clock 
directly from dpll_mpu_ck, you bypass this divisor.

Did you check what is the impact of cpufreq on the ARM TWD/timers?

-Tero

> +		clock-mult = <1>;
> +		clock-div = <2>;
> +	};
> +
>   	dpll_ddr_ck: dpll_ddr_ck {
>   		#clock-cells = <0>;
>   		compatible = "ti,am3-dpll-clock";
>

  reply	other threads:[~2015-11-30  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 19:44 [4.4-rc][PATCH] ARM: dts: am4372: fix clock source for arm twd and global timers Grygorii Strashko
2015-11-30  8:25 ` Tero Kristo [this message]
2015-11-30 11:53   ` Grygorii Strashko
2015-11-30 13:32     ` Tero Kristo
2015-11-30 13:49       ` Grygorii Strashko
2015-11-30 14:02         ` Tero Kristo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565C0814.3000001@ti.com \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).