linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin GAIGNARD <benjamin.gaignard@st.com>
To: Marc Zyngier <maz@kernel.org>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: dts: stm32: Enable high resolution timer
Date: Mon, 14 Oct 2019 09:31:14 +0000	[thread overview]
Message-ID: <61dda183-cd53-153b-8ed1-e2ecb8f96e03@st.com> (raw)
In-Reply-To: <e376301a8e9ec02dfd7713748abed83e@www.loen.fr>


On 9/27/19 2:59 PM, Marc Zyngier wrote:
> On 2019-09-27 13:44, Benjamin GAIGNARD wrote:
>> On 9/27/19 2:41 PM, Marc Zyngier wrote:
>>> On 2019-09-27 13:36, Benjamin GAIGNARD wrote:
>>>> On 9/27/19 1:22 PM, Marc Zyngier wrote:
>>>>> On 2019-09-27 09:48, Benjamin Gaignard wrote:
>>>>>> Adding always-on makes arm arch_timer claim to be an high resolution
>>>>>> timer.
>>>>>> That is possible because power mode won't stop clocking the timer.
>>>>>
>>>>> The "always-on" is not about the clock. It is about the comparator.
>>>>> The clock itself is *guaranteed* to always tick. If it didn't,
>>>>> that'd be
>>>>> an integration bug, and a pretty bad one.
>>>>>
>>>>> What you're claiming here is that your CPU never enters a low-power
>>>>> mode?
>>>>> Ever? I find this very hard to believe.
>>>>>
>>>>> Furthermore, claiming that always-on is the way to force the 
>>>>> arch-timer
>>>>> to be an hrtimer is factually wrong. This is what happens *if* 
>>>>> this is
>>>>> the only timer in the system. The only case this is true is for 
>>>>> virtual
>>>>> machines. Anything else has a global timer somewhere that will allow
>>>>> the arch timers to be used as an hrtimer.
>>>>>
>>>>> I'm pretty sure you too have a global timer somewhere in your system.
>>>>> Enable it, and enjoy hrtimers without having to lie about the
>>>>> properties
>>>>> of your system! ;-)
>>>>
>>>> Hi Marc,
>>>>
>>>> This SoC doesn't have any other global timer. Use arch_time is the 
>>>> only
>>>> we have to provide hrtimer on this system.
>>>
>>> And you don't have any form of power management either? What happens 
>>> when
>>> your CPU goes into idle? If your system does any form of power 
>>> management
>>> *and* doesn't have a separate timer, it is remarkably broken.
>>
>> Even in low-power modes this timer is always powered and clocked so it
>> is working fine.
>
> You're missing the point again. It is not about the clock, but the 
> comparator
> that is internal to the CPU, and not functional when the CPU is in its 
> lowest
> power mode. See also the verbiage in [1] (44.3 STGEN functional 
> description),
> which indicates that the clock source actually dies in low-power mode 
> (going
> against the architecture which mandates it to be always-on).
>
> Also, coming back to your earlier assertion ("This SoC doesn't have 
> any other
> global timer"): The documentation at [1] shows at least 17 timers that 
> could
> be used and avoid this dirty hack.
>
> So for what it is worth, NAK to this patch.


Hi Marc,

I have listen your remarks and propose another way to solve this issue:

https://lkml.org/lkml/2019/10/9/690

Thanks,

Benjamin


>
>         M.
>
> [1] https://www.st.com/resource/en/reference_manual/dm00366355.pdf
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-10-14  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  8:48 [PATCH] ARM: dts: stm32: Enable high resolution timer Benjamin Gaignard
2019-09-27 11:22 ` Marc Zyngier
2019-09-27 12:36   ` Benjamin GAIGNARD
2019-09-27 12:41     ` Marc Zyngier
2019-09-27 12:44       ` Benjamin GAIGNARD
2019-09-27 12:59         ` Marc Zyngier
2019-10-14  9:31           ` Benjamin GAIGNARD [this message]
2019-10-14 13:48             ` Marc Zyngier
2019-09-27 12:59         ` Sudeep Holla

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=61dda183-cd53-153b-8ed1-e2ecb8f96e03@st.com \
    --to=benjamin.gaignard@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=robh+dt@kernel.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).