linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Serge Semin <fancer.lancer@gmail.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	Paul Burton <paulburton@kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Arnd Bergmann <arnd@arndb.de>, Rob Herring <robh+dt@kernel.org>,
	"open list:BROADCOM NVRAM DRIVER" <linux-mips@vger.kernel.org>,
	linux-rtc@vger.kernel.org,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	Paul Cercueil <paul@crapouillou.net>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Randy Dunlap <rdunlap@infradead.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Maarten ter Huurne <maarten@treewalker.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 7/7] clocksource: mips-gic-timer: Mark GIC timer as unstable if ref clock changes
Date: Thu, 21 May 2020 11:09:50 +0200	[thread overview]
Message-ID: <CAMuHMdW5TqfDTZZCscXCK-Fkd7Gq1Ciyu1_sDzzR0B+_W-2hfg@mail.gmail.com> (raw)
In-Reply-To: <20200521005321.12129-8-Sergey.Semin@baikalelectronics.ru>

Hi Serge,

On Thu, May 21, 2020 at 2:54 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
> Currently clocksource framework doesn't support the clocks with variable
> frequency. Since MIPS GIC timer ticks rate might be unstable on some
> platforms, we must make sure that it justifies the clocksource
> requirements. MIPS GIC timer is incremented with the CPU cluster reference
> clocks rate. So in case if CPU frequency changes, the MIPS GIC tick rate
> changes synchronously. Due to this the clocksource subsystem can't rely on
> the timer to measure system clocks anymore. This commit marks the MIPS GIC
> based clocksource as unstable if reference clock (normally it's a CPU
> reference clocks) rate changes. The clocksource will execute a watchdog
> thread, which lowers the MIPS GIC timer rating to zero and fallbacks to a
> new stable one.
>
> Note we don't need to set the CLOCK_SOURCE_MUST_VERIFY flag to the MIPS
> GIC clocksource since normally the timer is stable. The only reason why
> it gets unstable is due to the ref clock rate change, which event we
> detect here in the driver by means of the clocks event notifier.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

Thanks for your patch!

> --- a/drivers/clocksource/mips-gic-timer.c
> +++ b/drivers/clocksource/mips-gic-timer.c
> @@ -24,6 +24,9 @@
>  static DEFINE_PER_CPU(struct clock_event_device, gic_clockevent_device);
>  static int gic_timer_irq;
>  static unsigned int gic_frequency;
> +static bool __read_mostly gic_clock_unstable;
> +
> +static void git_clocksource_unstable(char *reason);

gic_clocksource_unstable? (everywhere)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-05-21  9:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21  0:53 [PATCH v4 0/7] clocksource: Fix MIPS GIC and DW APB Timer for Baikal-T1 SoC support Serge Semin
2020-05-21  0:53 ` [PATCH v4 1/7] dt-bindings: rtc: Convert snps,dw-apb-timer to DT schema Serge Semin
2020-05-21  0:53 ` [PATCH v4 2/7] dt-bindings: timer: Move snps,dw-apb-timer DT schema from rtc Serge Semin
2020-05-21  0:53 ` [PATCH v4 3/7] dt-bindings: interrupt-controller: Convert mti,gic to DT schema Serge Semin
2020-05-21  0:53 ` [PATCH v4 4/7] clocksource: dw_apb_timer: Set clockevent any-possible-CPU mask Serge Semin
2020-05-21 15:04   ` Serge Semin
2020-05-21  0:53 ` [PATCH v4 5/7] clocksource: dw_apb_timer_of: Fix missing clockevent timers Serge Semin
2020-05-21  0:53 ` [PATCH v4 6/7] clocksource: mips-gic-timer: Register as sched_clock Serge Semin
2020-05-21  0:53 ` [PATCH v4 7/7] clocksource: mips-gic-timer: Mark GIC timer as unstable if ref clock changes Serge Semin
2020-05-21  9:09   ` Geert Uytterhoeven [this message]
2020-05-21 14:22     ` Serge Semin

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=CAMuHMdW5TqfDTZZCscXCK-Fkd7Gq1Ciyu1_sDzzR0B+_W-2hfg@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=claudiu.beznea@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=maarten@treewalker.org \
    --cc=paul@crapouillou.net \
    --cc=paulburton@kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --cc=vincenzo.frascino@arm.com \
    /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).