linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Claudiu.Beznea@microchip.com (Claudiu.Beznea@microchip.com)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection
Date: Wed, 11 Sep 2019 07:18:07 +0000	[thread overview]
Message-ID: <a2aca46a-8eb9-d8a8-de42-9850a8a8f44c@microchip.com> (raw)
In-Reply-To: <CACRpkda4mmpbPWa2nD93CvD6HWzcTUDzyyLdQxC2gNB7XiJF3w@mail.gmail.com>



On 11.09.2019 03:03, Linus Walleij wrote:
> External E-Mail
> 
> 
> On Tue, Sep 10, 2019 at 4:11 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
>> On 10/09/2019 16:08:26+0100, Sudeep Holla wrote:
>>> On Tue, Sep 10, 2019@02:51:50PM +0000, Claudiu.Beznea@microchip.com wrote:
> 
>>> In that case, why can't we identify capability that with the compatibles
>>> for this timer IP ?
>>>
>>> IOW, I don't like the proposal as it's hardware limitation.
>>
>> To be clear, bot timers are exactly the same but can't be clocksource
>> and clockevent at the same time. Why would we have different compatibles
>> for the exact same IP?
> 
> In that case why not just pick the first one you find as clocksource
> and the second one as clock event? As they all come to the
> same timer of init function two simple local state variables can
> solve that:
> 
> static bool registered_clocksource;
> static bool registered_clockevent;
> 
> probe(timer) {
>    if (!registered_clocksource) {
>        register_clocksource(timer);
>        registrered_clocksource = true;
>        return;
>    }
>    if (!registered_clockevent) {
>        register_clockevent(timer);
>        registered_clockevent = true;
>        return;
>    }
>    pr_info("surplus timer %p\n", timer);
> }
> 

That was also my proposal for the driver I'm sending this series for (see
[1]) but it has been proposed to implement a mechanism similar to this one
in this series (see [2] and [3]).

Thank you,
Claudiu Beznea

[1]
https://lore.kernel.org/lkml/1552580772-8499-1-git-send-email-claudiu.beznea at microchip.com/
[2]
https://lore.kernel.org/lkml/a738fce5-1108-34d7-d255-dfcb86f51c56 at linaro.org/
[3]
https://lore.kernel.org/lkml/2f831f1b-c87d-48bd-cf02-2ebb334b964c at linaro.org/

> Clocksource and clockevent are natural singletons so there is
> no need to handle more than one of each in a driver for identical
> hardware.
> 
> With the Integrator AP timer there is a real reason to select one over
> the other but as I replied to that patch it is pretty easy to just identify
> which block has this limitation by simply commenting out the IRQ
> line for it from the device tree.
> 
> Maybe there is something about this I don't understand.
> 
> Yours,
> Linus Walleij
> 

  reply	other threads:[~2019-09-11  7:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 13:47 [PATCH 0/7] add support for clocksource/clockevent DT selection Claudiu Beznea
2019-09-10 13:47 ` [PATCH 1/7] clocksource/drivers/c-sky: request timer_of_init only for probing CPU Claudiu Beznea
2019-09-10 13:47 ` [PATCH 2/7] clocksource: change timer registration macros Claudiu Beznea
2019-09-10 14:49   ` Marc Zyngier
2019-09-10 14:57     ` Claudiu.Beznea
2019-09-10 13:47 ` [PATCH 3/7] clocksource/timer_of: use BIT() macro Claudiu Beznea
2019-09-10 13:47 ` [PATCH 4/7] dt-bindings: chosen: Add clocksource and clockevent selection Claudiu Beznea
2019-09-10 14:32   ` Sudeep Holla
2019-09-10 14:51     ` Claudiu.Beznea
2019-09-10 15:08       ` Sudeep Holla
2019-09-10 15:10         ` Alexandre Belloni
2019-09-11  0:03           ` Linus Walleij
2019-09-11  7:18             ` Claudiu.Beznea [this message]
2019-09-12 14:18               ` Linus Walleij
2019-09-30 14:32               ` Rob Herring
2019-10-02 13:32                 ` Claudiu.Beznea
2019-09-11  7:34   ` Neil Armstrong
2019-09-11  9:14     ` Alexandre Belloni
2019-09-10 13:47 ` [PATCH 5/7] clocksource/drivers/timer-of: add support support for timer's functionalities Claudiu Beznea
2019-09-10 13:47 ` [PATCH 6/7] drivers/clocksource/timer-of: keep declaration on one line Claudiu Beznea
2019-09-10 13:47 ` [PATCH 7/7] clocksource/drivers/integrator-ap: parse the chosen node Claudiu Beznea
2019-09-10 23:48   ` Linus Walleij
2019-09-11  7:14     ` Claudiu.Beznea
2019-09-10 16:05 ` [PATCH 0/7] add support for clocksource/clockevent DT selection John Stultz
2019-09-11  6:52   ` Claudiu.Beznea
2019-09-11 16:06     ` John Stultz
2019-09-25 17:19 ` Daniel Lezcano
2019-09-26  8:42   ` Claudiu.Beznea
2019-10-02 13:35     ` Claudiu.Beznea
2019-10-03 10:43       ` Claudiu.Beznea
2019-10-13 18:16         ` Daniel Lezcano
     [not found]           ` <7071b6fa-f7ed-c879-4a43-44100dbe6121@microchip.com>
2019-10-18 20:24             ` Daniel Lezcano
2019-10-21  8:58               ` Claudiu.Beznea
2019-10-21 14:17                 ` Daniel Lezcano

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=a2aca46a-8eb9-d8a8-de42-9850a8a8f44c@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=linux-snps-arc@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).