mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, benjamin.gaignard@linaro.org
Subject: [PATCH 00/12] clocksource/drivers/stm32: Consolidate the timer
Date: Thu,  4 Jan 2018 13:50:16 +0100	[thread overview]
Message-ID: <1515070228-10481-1-git-send-email-daniel.lezcano@linaro.org> (raw)

This series fixes an issue in the stm32 driver and adds the clocksource.

Previous discussion for the stm32 changes ended up in no consensus because
of the 16bits and 32bits timers. The proposed change were removing the
16bits timers or wasn't providing the changes in a sane way.

This series fixes a bug when several timers are enabled in the DT. Now, the
DT can enable any timer 16bits or 32bits and the time framework will choose
the one with the best rating. So 16bits timer removal is no longer needed.

The fix is written in a way it can picked up for stable@.

When the driver is dealing with a 16bits timer, it computes and sets the
prescaler to a value as the timer was running at 10MHz. It is a good trade
off between wrapping interval and resolution.

The oneshot mode is implemented and the periodic mode of the timer is
replaced by the register comparison, that allows to have a free running
wheel for the clocksource.

After setting the scene by encaspulating the code, the clocksource is
added and again it relies on the time framework to choose the right one.
On this platform, the armv7_systick clocksource is better than the 16bits
timers, so if only 16bits are used, only the clockevents will be used, the
clocksource will be the armv7_systick.

In addition the timer delay is added, it saves 90ms of boot time.

A couple of trivial changes are done in timer-of in order to make the
stm32 code nicer and more self-contained.

Benjamin Gaignard (4):
  clocksource/drivers/stm32: Convert the driver to timer-of
  clocksource/drivers/stm32: Compute a prescaler value with a targeted
    rate
  clocksource/drivers/stm32: Add the oneshot mode
  clocksource/drivers/stm32: Add the clocksource

Daniel Lezcano (8):
  clocksource/drivers/timer-of: Store the device node pointer
  clocksource/drivers/timer-of: Don't request the resource by name
  clocksource/drivers/stm32: Fix kernel panic with multiple timers
  clocksource/drivers/stm32: Use the node name as timer name
  clocksource/drivers/stm32: Encapsulate the timer width sorting out
    function
  clocksource/drivers/stm32: Encapsulate more the clockevent code
  clocksource/drivers/stm32: Add the timer delay
  clocksource/drivers/stm32: Start the timer's counter sooner

 drivers/clocksource/Kconfig       |   1 +
 drivers/clocksource/timer-of.c    |  11 +-
 drivers/clocksource/timer-of.h    |   1 +
 drivers/clocksource/timer-stm32.c | 358 ++++++++++++++++++++++++++------------
 4 files changed, 260 insertions(+), 111 deletions(-)

-- 
2.7.4

             reply	other threads:[~2018-01-04 12:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 12:50 Daniel Lezcano [this message]
2018-01-04 12:50 ` [PATCH 01/12] clocksource/drivers/timer-of: Store the device node pointer Daniel Lezcano
2018-01-04 12:50 ` [PATCH 02/12] clocksource/drivers/timer-of: Don't request the resource by name Daniel Lezcano
2018-01-04 12:50 ` [PATCH 03/12] clocksource/drivers/stm32: Fix kernel panic with multiple timers Daniel Lezcano
2018-01-04 12:50 ` [PATCH 04/12] clocksource/drivers/stm32: Convert the driver to timer-of Daniel Lezcano
2018-01-04 12:50 ` [PATCH 05/12] clocksource/drivers/stm32: Use the node name as timer name Daniel Lezcano
2018-01-04 12:50 ` [PATCH 06/12] clocksource/drivers/stm32: Encapsulate the timer width sorting out function Daniel Lezcano
2018-01-04 12:50 ` [PATCH 07/12] clocksource/drivers/stm32: Compute a prescaler value with a targeted rate Daniel Lezcano
2018-01-04 12:50 ` [PATCH 08/12] clocksource/drivers/stm32: Add the oneshot mode Daniel Lezcano
2018-01-04 12:50 ` [PATCH 09/12] clocksource/drivers/stm32: Encapsulate more the clockevent code Daniel Lezcano
2018-01-04 12:50 ` [PATCH 10/12] clocksource/drivers/stm32: Add the clocksource Daniel Lezcano
2018-01-04 12:50 ` [PATCH 11/12] clocksource/drivers/stm32: Add the timer delay Daniel Lezcano
2018-01-04 12:50 ` [PATCH 12/12] clocksource/drivers/stm32: Start the timer's counter sooner 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=1515070228-10481-1-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=benjamin.gaignard@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome