linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Stephen N Chivers <schivers@csc.com.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Michael Schmitz <schmitzmic@gmail.com>,
	John Stultz <john.stultz@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH v2 00/14] m68k: Drop arch_gettimeoffset and adopt clocksource API
Date: Mon, 19 Nov 2018 12:10:38 +1100	[thread overview]
Message-ID: <cover.1542589838.git.fthain@telegraphics.com.au> (raw)

This series removes "select ARCH_USES_GETTIMEOFFSET" from arch/m68k
and converts users of arch_gettimeoffset to the clocksource API.
Various bugs are fixed along the way.

Those platforms which do not actually implement arch_gettimeoffset
(apollo, q40, sun3, sun3x) use the "jiffies" clocksource by default.

The atari and hp300 platforms have an arch_gettimeoffset() implementation
which can't readily be converted to a clocksource. Getting a workable
clocksource on these platforms will require the insight of a platform
expert.

The difficulty with these patches is the use of the timer interrupt to
update the counter for the clock source. The timer interrupt handler races
with clocksource read method, and both of those functions race with the
timer hardware.

Hence, more testing and code review would be appreciated.

Changed since v1:

 - Dropped patches 1/13 and 2/13. These were a failed attempt to fix
5cfc8ee0bb51 and 4ad4c76b7afb. By adopting the clocksource API we can fix
this issue in mainline. By backporting this series we can fix it for -stable
(for m68k at least).

 - Dropped patch "m68k: hp300: Convert to clocksource API" and added
patch "m68k: hp300: Remove hp300_gettimeoffset".

 - Added a new patch to address an old m68k bug pointed out by Thomas
Gleixner. The bug can arise when a timer interrupt handler gets interrupted.

 - Added new patches to address old mvme16x and mvme147 bugs pointed out
by Thomas Gleixner. The bug could cause the clock to jump backwards.

 - Various other changes summarized in the relevant patches.


Finn Thain (14):
  m68k: Call timer_interrupt() with interrupts disabled
  m68k: mac: Fix VIA timer counter accesses
  m68k: mac: Clean up unused timer definitions
  m68k: apollo, q40, sun3, sun3x: Remove arch_gettimeoffset
    implementations
  m68k: Drop ARCH_USES_GETTIMEOFFSET
  m68k: amiga: Convert to clocksource API
  m68k: atari: Convert to clocksource API
  m68k: bvme6000: Convert to clocksource API
  m68k: hp300: Remove hp300_gettimeoffset()
  m68k: mac: Convert to clocksource API
  m68k: mvme147: Convert to clocksource API
  m68k: mvme147: Handle timer counter overflow
  m68k: mvme16x: Convert to clocksource API
  m68k: mvme16x: Handle timer counter overflow

 arch/m68k/Kconfig                 |   1 -
 arch/m68k/amiga/cia.c             |  10 ++
 arch/m68k/amiga/config.c          |  46 ++++++---
 arch/m68k/apollo/config.c         |   7 --
 arch/m68k/atari/ataints.c         |   4 +-
 arch/m68k/atari/config.c          |   2 -
 arch/m68k/atari/time.c            |  65 +++++++++----
 arch/m68k/bvme6000/config.c       |  70 +++++++++-----
 arch/m68k/hp300/config.c          |   1 -
 arch/m68k/hp300/time.c            |  29 ++----
 arch/m68k/hp300/time.h            |   1 -
 arch/m68k/include/asm/macints.h   |   3 -
 arch/m68k/include/asm/mvme147hw.h |   2 +-
 arch/m68k/mac/config.c            |   3 -
 arch/m68k/mac/via.c               | 150 ++++++++++++++++++++----------
 arch/m68k/mvme147/config.c        |  73 ++++++++++-----
 arch/m68k/mvme16x/config.c        |  97 +++++++++++++------
 arch/m68k/q40/config.c            |   9 --
 arch/m68k/q40/q40ints.c           |   7 +-
 arch/m68k/sun3/config.c           |   2 -
 arch/m68k/sun3/intersil.c         |   7 --
 arch/m68k/sun3/sun3ints.c         |   3 +
 arch/m68k/sun3x/config.c          |   1 -
 arch/m68k/sun3x/time.c            |  21 ++---
 arch/m68k/sun3x/time.h            |   1 -
 25 files changed, 387 insertions(+), 228 deletions(-)

-- 
2.18.1


             reply	other threads:[~2018-11-19  1:23 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  1:10 Finn Thain [this message]
2018-11-19  1:10 ` [RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset() Finn Thain
2018-11-20  9:09   ` Kars de Jong
2018-11-20 23:13     ` Finn Thain
2018-11-21  8:10       ` Geert Uytterhoeven
2018-11-21  8:41         ` Finn Thain
2018-11-21  8:55           ` Geert Uytterhoeven
2018-11-21  9:47             ` Finn Thain
2018-11-21 10:02               ` Geert Uytterhoeven
2018-11-21 11:14                 ` Finn Thain
2018-11-25  1:15                   ` Finn Thain
2018-11-25  2:44                     ` Michael Schmitz
2018-11-25  3:25                       ` Finn Thain
2018-11-21  8:22       ` Kars de Jong
2018-11-19  1:10 ` [RFC PATCH v2 07/14] m68k: atari: Convert to clocksource API Finn Thain
2018-11-19  8:35   ` Michael Schmitz
2018-11-20  8:10   ` Linus Walleij
2018-11-20  8:19     ` Geert Uytterhoeven
2018-11-20  9:30     ` Finn Thain
2018-11-20  9:53       ` Linus Walleij
2018-11-20 10:02     ` Andreas Schwab
2018-11-24  2:03       ` Michael Schmitz
2018-11-24  3:08         ` Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 08/14] m68k: bvme6000: " Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 11/14] m68k: mvme147: " Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 10/14] m68k: mac: " Finn Thain
2018-11-20  8:15   ` Linus Walleij
2018-11-20  9:00     ` Finn Thain
2018-11-20  9:59       ` Linus Walleij
2018-11-19  1:10 ` [RFC PATCH v2 04/14] m68k: apollo, q40, sun3, sun3x: Remove arch_gettimeoffset implementations Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 01/14] m68k: Call timer_interrupt() with interrupts disabled Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 03/14] m68k: mac: Clean up unused timer definitions Finn Thain
2018-11-20  1:02   ` Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 12/14] m68k: mvme147: Handle timer counter overflow Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 13/14] m68k: mvme16x: Convert to clocksource API Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 02/14] m68k: mac: Fix VIA timer counter accesses Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 06/14] m68k: amiga: Convert to clocksource API Finn Thain
2018-11-20  8:04   ` Linus Walleij
2018-11-19  1:10 ` [RFC PATCH v2 05/14] m68k: Drop ARCH_USES_GETTIMEOFFSET Finn Thain
2018-11-19  1:10 ` [RFC PATCH v2 14/14] m68k: mvme16x: Handle timer counter overflow Finn Thain

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=cover.1542589838.git.fthain@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=arnd@arndb.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=geert@linux-m68k.org \
    --cc=john.stultz@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=schivers@csc.com.au \
    --cc=schmitzmic@gmail.com \
    --cc=schwab@linux-m68k.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;
as well as URLs for NNTP newsgroup(s).