Re: m68k using deprecated internal APIs?

2018-11-18 Thread Geert Uytterhoeven
Hi Linus, On Fri, Nov 16, 2018 at 10:33 PM Linus Walleij wrote: > On Fri, Nov 16, 2018 at 8:44 PM Geert Uytterhoeven > wrote: > > On Fri, Nov 16, 2018 at 12:13 PM Linus Walleij > > wrote: > > > I mean that whole thing should go away by abstracting those LEDs > > > (for the systems that have

Re: [RFC PATCH 13/13] m68k: mvme16x: Convert to clocksource APIy

2018-11-18 Thread Thomas Gleixner
Finn, On Wed, 14 Nov 2018, Finn Thain wrote: > On Tue, 13 Nov 2018, Thomas Gleixner wrote: > > Urgh. Then you have more serious trouble. If the interrupting handler > > calls any of the time accessor functions then you can actually live lock > > when the interrupt happens in the middle of the

[RFC PATCH v2 05/14] m68k: Drop ARCH_USES_GETTIMEOFFSET

2018-11-18 Thread Finn Thain
The functions that implement arch_gettimeoffset are re-used by new clocksource drivers in subsequent patches. Signed-off-by: Finn Thain Acked-by: Linus Walleij --- arch/m68k/Kconfig | 1 - arch/m68k/amiga/config.c| 3 --- arch/m68k/atari/config.c| 2 --

[RFC PATCH v2 04/14] m68k: apollo, q40, sun3, sun3x: Remove arch_gettimeoffset implementations

2018-11-18 Thread Finn Thain
These dummy implementations are no better than default_arch_gettimeoffset() so remove them. Signed-off-by: Finn Thain --- arch/m68k/apollo/config.c | 7 --- arch/m68k/q40/config.c| 9 - arch/m68k/sun3/config.c | 2 -- arch/m68k/sun3/intersil.c | 7 ---

[RFC PATCH v2 11/14] m68k: mvme147: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Signed-off-by: Finn Thain Acked-by: Linus Walleij --- Changed since v1: - Moved clk_total access to within the irq lock. - Use type u32 for tick counter. --- arch/m68k/include/asm/mvme147hw.h | 1 -

[RFC PATCH v2 01/14] m68k: Call timer_interrupt() with interrupts disabled

2018-11-18 Thread Finn Thain
Some platforms execute their timer handler with the interrupt priority level below 6. That means the handler could be interrupted by another driver and this could lead to re-entry of the timer core. Avoid this by use of local_irq_save/restore for timer interrupt dispatch. This provides mutual

[RFC PATCH v2 13/14] m68k: mvme16x: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Signed-off-by: Finn Thain Acked-by: Linus Walleij --- Changed since v1: - Moved clk_total access to within the irq lock. --- arch/m68k/mvme16x/config.c | 39 +++--- 1 file

[RFC PATCH v2 08/14] m68k: bvme6000: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Signed-off-by: Finn Thain Acked-by: Linus Walleij --- Changed since v1: - Moved clk_total access to within the irq lock. --- arch/m68k/bvme6000/config.c | 52 +++-- 1 file

[RFC PATCH v2 09/14] m68k: hp300: Remove hp300_gettimeoffset()

2018-11-18 Thread Finn Thain
hp300_gettimeoffset() never checks the timer interrupt flag and will fail to notice when the timer counter gets reloaded. That means the clock could jump backwards. Remove this code and leave this platform on the 'jiffies' clocksource. Note that this amounts to a regression in clock precision.

[RFC PATCH v2 12/14] m68k: mvme147: Handle timer counter overflow

2018-11-18 Thread Finn Thain
Reading the timer counter races with timer overflow (and the corresponding interrupt). This is resolved by reading the overflow register and taking this value into account. The interrupt handler must clear the overflow register when it eventually executes. Suggested-by: Thomas Gleixner

[RFC PATCH v2 02/14] m68k: mac: Fix VIA timer counter accesses

2018-11-18 Thread Finn Thain
This resolves some bugs that affect VIA timer counter accesses. Avoid lost interrupts caused by reading the counter low byte register. Make allowance for the fact that the counter will be decremented to 0x before being reloaded. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Finn

[RFC PATCH v2 07/14] m68k: atari: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Normally the MFP timer C interrupt flag would be used to check for timer counter wrap-around. Unfortunately, that flag gets cleared by the MFP itself (due to automatic EOI mode). This means that

[RFC PATCH v2 10/14] m68k: mac: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Signed-off-by: Finn Thain Acked-by: Linus Walleij Tested-by: Stan Johnson --- Changed since v1: - Moved clk_total access to within the irq lock. - Use type u32 for tick counter. --- arch/m68k/mac/via.c |

[RFC PATCH v2 03/14] m68k: mac: Clean up unused timer definitions

2018-11-18 Thread Finn Thain
Signed-off-by: Finn Thain --- arch/m68k/include/asm/macints.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h index cddb2d3ea49b..4da172bd048c 100644 --- a/arch/m68k/include/asm/macints.h +++

[RFC PATCH v2 06/14] m68k: amiga: Convert to clocksource API

2018-11-18 Thread Finn Thain
Add a platform clocksource by adapting the existing arch_gettimeoffset implementation. Signed-off-by: Finn Thain Acked-by: Linus Walleij --- Changed since v1: - Moved clk_total access to within the irq lock. --- arch/m68k/amiga/config.c | 43 1 file

[RFC PATCH v2 00/14] m68k: Drop arch_gettimeoffset and adopt clocksource API

2018-11-18 Thread Finn Thain
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