timers/cleanups for v3.1
Subsystems (13)
Linus,
Please pull the latest timers-cleanup-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git timers-cleanup-for-linus
Thanks,
Ingo
------------------>
Ralf Baechle (12):
i8253: Create linux/i8253.h and use it in all 8253 related files
i8253: Unify all kernel declarations of i8253_lock
i8253: Consolidate all kernel definitions of i8253_lock
i8253: Make pcspkr input driver use the shared i8253_lock
i8253: Make pcsp sound driver use the shared i8253_lock
alpha: i8253: Cleanup remaining users of i8253pit.h
i8253: Alpha, PowerPC: Remove unused asm/8253pit.h
x86: i8253: Consolidate definitions of global_clock_event
i8253: Consolidate definitions of PIT_LATCH
i8253: Move remaining content and delete asm/i8253.h
pcspkr: Cleanup Kconfig dependencies
pcpskr: MIPS: Make config dependencies finer grained
Thomas Gleixner (8):
i8253: Remove I8253_LOCK config
i8253: Export i8253_lock unconditionally
i8253: Create common clockevent implementation
x86: Use common i8253 clockevent
mips: Use common i8253 clockevent
arm: Footbridge: Use common i8253 clockevent
i8253: Cleanup outb/inb magic
mips: Fix i8253 clockevent fallout
arch/alpha/Kconfig | 1 + arch/alpha/include/asm/8253pit.h | 3 - arch/alpha/kernel/sys_ruffian.c | 1 - arch/alpha/kernel/time.c | 1 - arch/arm/include/asm/i8253.h | 15 ---- arch/arm/mach-footbridge/Kconfig | 1 + arch/arm/mach-footbridge/isa-timer.c | 59 +--------------- arch/mips/Kconfig | 4 + arch/mips/cobalt/time.c | 2 +- arch/mips/include/asm/i8253.h | 24 ------- arch/mips/jazz/irq.c | 2 +- arch/mips/kernel/i8253.c | 102 +--------------------------- arch/mips/mti-malta/malta-time.c | 2 +- arch/mips/sgi-ip22/ip22-time.c | 2 +- arch/mips/sni/time.c | 2 +- arch/powerpc/include/asm/8253pit.h | 3 - arch/powerpc/platforms/amigaone/Kconfig | 2 +- arch/powerpc/platforms/chrp/Kconfig | 1 + arch/powerpc/platforms/prep/Kconfig | 1 + arch/powerpc/platforms/pseries/Kconfig | 1 + arch/x86/Kconfig | 2 + arch/x86/include/asm/apb_timer.h | 1 - arch/x86/include/asm/i8253.h | 20 ------ arch/x86/include/asm/time.h | 6 +- arch/x86/kernel/apb_timer.c | 1 + arch/x86/kernel/apic/apic.c | 3 +- arch/x86/kernel/apm_32.c | 8 +- arch/x86/kernel/hpet.c | 3 +- arch/x86/kernel/i8253.c | 99 ++------------------------- arch/x86/kernel/time.c | 2 +- drivers/block/hd.c | 2 +- drivers/clocksource/Kconfig | 9 +++ drivers/clocksource/Makefile | 2 +- drivers/clocksource/i8253.c | 114 ++++++++++++++++++++++++++++-- drivers/input/gameport/gameport.c | 2 +- drivers/input/joystick/analog.c | 2 +- drivers/input/misc/pcspkr.c | 9 +-- include/linux/i8253.h | 29 ++++++++ init/Kconfig | 7 ++- sound/drivers/pcsp/pcsp.h | 8 +-- 40 files changed, 199 insertions(+), 359 deletions(-) delete mode 100644 arch/alpha/include/asm/8253pit.h delete mode 100644 arch/arm/include/asm/i8253.h delete mode 100644 arch/mips/include/asm/i8253.h delete mode 100644 arch/powerpc/include/asm/8253pit.h delete mode 100644 arch/x86/include/asm/i8253.h create mode 100644 include/linux/i8253.h
arch/alpha/Kconfig +1 -0
@@ -6,6 +6,7 @@ config ALPHA select HAVE_OPROFILE select HAVE_SYSCALL_WRAPPERS select HAVE_IRQ_WORK + select HAVE_PCSPKR_PLATFORM select HAVE_PERF_EVENTS select HAVE_DMA_ATTRS select HAVE_GENERIC_HARDIRQS
arch/alpha/include/asm/8253pit.h deleted +0 -3
@@ -1,3 +0,0 @@ -/* -* 8253/8254 Programmable Interval Timer -*/
arch/alpha/kernel/sys_ruffian.c +0 -1
@@ -26,7 +26,6 @@#include <asm/pgtable.h> #include <asm/core_cia.h> #include <asm/tlbflush.h> -#include <asm/8253pit.h> #include "proto.h" #include "irq_impl.h"
arch/alpha/kernel/time.c +0 -1
@@ -46,7 +46,6 @@#include <asm/uaccess.h> #include <asm/io.h> #include <asm/hwrpb.h> -#include <asm/8253pit.h> #include <asm/rtc.h> #include <linux/mc146818rtc.h>
arch/arm/include/asm/i8253.h deleted +0 -15
@@ -1,15 +0,0 @@ -#ifndef __ASMARM_I8253_H -#define __ASMARM_I8253_H - -/* i8253A PIT registers */ -#define PIT_MODE 0x43 -#define PIT_CH0 0x40 - -#define PIT_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ) - -extern raw_spinlock_t i8253_lock; - -#define outb_pit outb_p -#define inb_pit inb_p - -#endif
arch/arm/mach-footbridge/Kconfig +1 -0
@@ -5,6 +5,7 @@ menu "Footbridge Implementations" config ARCH_CATS bool "CATS" select CLKSRC_I8253 + select CLKEVT_I8253 select FOOTBRIDGE_HOST select ISA select ISA_DMA
arch/arm/mach-footbridge/isa-timer.c +4 -55
88 lines not on this page · raw message
arch/mips/Kconfig +4 -0
@@ -185,6 +185,7 @@ config MACH_JAZZ select CSRC_R4K select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN select GENERIC_ISA_DMA + select HAVE_PCSPKR_PLATFORM select IRQ_CPU select I8253 select I8259
@@ -266,6 +267,7 @@ config MIPS_MALTA select CSRC_R4K select DMA_NONCOHERENT select GENERIC_ISA_DMA + select HAVE_PCSPKR_PLATFORM select IRQ_CPU select IRQ_GIC select HW_HAS_PCI
@@ -640,6 +642,7 @@ config SNI_RM select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN select DMA_NONCOHERENT select GENERIC_ISA_DMA + select HAVE_PCSPKR_PLATFORM select HW_HAS_EISA select HW_HAS_PCI select IRQ_CPU
@@ -2388,6 +2391,7 @@ config MMU config I8253 bool select CLKSRC_I8253 + select CLKEVT_I8253 select MIPS_EXTERNAL_TIMER config ZONE_DMA32
arch/mips/cobalt/time.c +1 -1
@@ -17,10 +17,10 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <linux/i8253.h> #include <linux/init.h> #include <asm/gt64120.h> -#include <asm/i8253.h> #include <asm/time.h> #define GT641XX_BASE_CLOCK 50000000/* 50MHz */
arch/mips/include/asm/i8253.h deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* Machine specific IO port address definition for generic. -* Written by Osamu Tomita <[email protected]> -*/ -#ifndef __ASM_I8253_H -#define __ASM_I8253_H - -#include <linux/spinlock.h> - -/* i8253A PIT registers */ -#define PIT_MODE 0x43 -#define PIT_CH0 0x40 -#define PIT_CH2 0x42 - -#define PIT_LATCH LATCH - -extern raw_spinlock_t i8253_lock; - -extern void setup_pit_timer (void ); - -#define inb_pit inb_p -#define outb_pit outb_p - -#endif /* __ASM_I8253_H */
arch/mips/jazz/irq.c +1 -1
@@ -7,6 +7,7 @@* Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle */ #include <linux/clockchips.h> +#include <linux/i8253.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/kernel.h>
@@ -15,7 +16,6 @@#include <linux/irq.h> #include <asm/irq_cpu.h> -#include <asm/i8253.h> #include <asm/i8259.h> #include <asm/io.h> #include <asm/jazz.h>
arch/mips/kernel/i8253.c +3 -99
124 lines not on this page · raw message
arch/mips/mti-malta/malta-time.c +1 -1
@@ -19,6 +19,7 @@*/ #include <linux/types.h> +#include <linux/i8253.h> #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/sched.h>
@@ -31,7 +32,6 @@#include <asm/mipsregs.h> #include <asm/mipsmtregs.h> #include <asm/hardirq.h> -#include <asm/i8253.h> #include <asm/irq.h> #include <asm/div64.h> #include <asm/cpu.h>
arch/mips/sgi-ip22/ip22-time.c +1 -1
@@ -10,6 +10,7 @@* Copyright (C) 2003, 06 Ralf Baechle ([email protected]) */ #include <linux/bcd.h> +#include <linux/i8253.h> #include <linux/init.h> #include <linux/irq.h> #include <linux/kernel.h>
@@ -20,7 +21,6 @@#include <asm/cpu.h> #include <asm/mipsregs.h> -#include <asm/i8253.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/time.h>
arch/mips/sni/time.c +1 -1
@@ -1,11 +1,11 @@#include <linux/types.h> +#include <linux/i8253.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/smp.h> #include <linux/time.h> #include <linux/clockchips.h> -#include <asm/i8253.h> #include <asm/sni.h> #include <asm/time.h> #include <asm-generic/rtc.h>
arch/powerpc/include/asm/8253pit.h deleted +0 -3
@@ -1,3 +0,0 @@ -/* -* 8253/8254 Programmable Interval Timer -*/
arch/powerpc/platforms/amigaone/Kconfig +1 -1
@@ -8,7 +8,7 @@ config AMIGAONE select NOT_COHERENT_CACHE select CHECK_CACHE_COHERENCY select DEFAULT_UIMAGE - select PCSPKR_PLATFORM + select HAVE_PCSPKR_PLATFORM help Select AmigaOne for the following machines: - AmigaOne SE/Teron CX (G3 only)
arch/powerpc/platforms/chrp/Kconfig +1 -0
@@ -1,6 +1,7 @@ config PPC_CHRP bool "Common Hardware Reference Platform (CHRP) based machines" depends on 6xx + select HAVE_PCSPKR_PLATFORM select MPIC select PPC_I8259 select PPC_INDIRECT_PCI
arch/powerpc/platforms/prep/Kconfig +1 -0
@@ -1,6 +1,7 @@ config PPC_PREP bool "PowerPC Reference Platform (PReP) based machines" depends on 6xx && BROKEN + select HAVE_PCSPKR_PLATFORM select MPIC select PPC_I8259 select PPC_INDIRECT_PCI
arch/powerpc/platforms/pseries/Kconfig +1 -0
@@ -1,6 +1,7 @@ config PPC_PSERIES depends on PPC64 && PPC_BOOK3S bool "IBM pSeries & new (POWER5-based) iSeries" + select HAVE_PCSPKR_PLATFORM select MPIC select PCI_MSI select PPC_XICS
arch/x86/Kconfig +2 -0
@@ -20,6 +20,7 @@ config X86 select HAVE_UNSTABLE_SCHED_CLOCK select HAVE_IDE select HAVE_OPROFILE + select HAVE_PCSPKR_PLATFORM select HAVE_PERF_EVENTS select HAVE_IRQ_WORK select HAVE_IOREMAP_PROT
@@ -70,6 +71,7 @@ config X86 select IRQ_FORCED_THREADING select USE_GENERIC_SMP_HELPERS if SMP select HAVE_BPF_JIT if (X86_64 && NET) + select CLKEVT_I8253 config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS)
arch/x86/include/asm/apb_timer.h +0 -1
@@ -50,7 +50,6 @@#define APBT_DEV_USED 1extern void apbt_time_init (void ); -extern struct clock_event_device *global_clock_event;extern unsigned long apbt_quick_calibrate (void );extern int arch_setup_apbt_irqs (int irq,int trigger,int mask,int cpu);extern void apbt_setup_secondary_clock (void );
arch/x86/include/asm/i8253.h deleted +0 -20
@@ -1,20 +0,0 @@ -#ifndef _ASM_X86_I8253_H -#define _ASM_X86_I8253_H - -/* i8253A PIT registers */ -#define PIT_MODE 0x43 -#define PIT_CH0 0x40 -#define PIT_CH2 0x42 - -#define PIT_LATCH LATCH - -extern raw_spinlock_t i8253_lock; - -extern struct clock_event_device *global_clock_event; - -extern void setup_pit_timer (void ); - -#define inb_pit inb_p -#define outb_pit outb_p - -#endif /* _ASM_X86_I8253_H */
arch/x86/include/asm/time.h +4 -2
@@ -1,10 +1,12 @@#ifndef _ASM_X86_TIME_H#define _ASM_X86_TIME_H -extern void hpet_time_init (void ); - +#include <linux/clocksource.h> #include <asm/mc146818rtc.h> +extern void hpet_time_init (void );extern void time_init (void ); +extern struct clock_event_device *global_clock_event; +#endif /* _ASM_X86_TIME_H */
arch/x86/kernel/apb_timer.c +1 -0
@@ -44,6 +44,7 @@#include <asm/fixmap.h> #include <asm/apb_timer.h> #include <asm/mrst.h> +#include <asm/time.h> #define APBT_MASK CLOCKSOURCE_MASK(32)#define APBT_SHIFT 22
arch/x86/kernel/apic/apic.c +2 -1
@@ -27,6 +27,7 @@#include <linux/syscore_ops.h> #include <linux/delay.h> #include <linux/timex.h> +#include <linux/i8253.h> #include <linux/dmar.h> #include <linux/init.h> #include <linux/cpu.h>
@@ -39,7 +40,6 @@#include <asm/pgalloc.h> #include <asm/atomic.h> #include <asm/mpspec.h> -#include <asm/i8253.h> #include <asm/i8259.h> #include <asm/proto.h> #include <asm/apic.h>
@@ -48,6 +48,7 @@#include <asm/hpet.h> #include <asm/idle.h> #include <asm/mtrr.h> +#include <asm/time.h> #include <asm/smp.h> #include <asm/mce.h> #include <asm/tsc.h>
arch/x86/kernel/apm_32.c +4 -4
@@ -229,11 +229,11 @@#include <linux/jiffies.h> #include <linux/acpi.h> #include <linux/syscore_ops.h> +#include <linux/i8253.h> #include <asm/system.h> #include <asm/uaccess.h> #include <asm/desc.h> -#include <asm/i8253.h> #include <asm/olpc.h> #include <asm/paravirt.h> #include <asm/reboot.h>
@@ -1220,11 +1220,11 @@ static void reinit_timer(void)raw_spin_lock_irqsave (&i8253_lock, flags);/* set the clock to HZ */ -outb_pit (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ +outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ udelay (10 ); -outb_pit (LATCH &0xff ,PIT_CH0 );/* LSB */ +outb_p (LATCH &0xff ,PIT_CH0 );/* LSB */ udelay (10 ); -outb_pit (LATCH >>8 ,PIT_CH0 );/* MSB */ +outb_p (LATCH >>8 ,PIT_CH0 );/* MSB */ udelay (10 );raw_spin_unlock_irqrestore (&i8253_lock, flags);#endif
arch/x86/kernel/hpet.c +2 -1
@@ -4,6 +4,7 @@#include <linux/sysdev.h> #include <linux/delay.h> #include <linux/errno.h> +#include <linux/i8253.h> #include <linux/slab.h> #include <linux/hpet.h> #include <linux/init.h>
@@ -12,8 +13,8 @@#include <linux/io.h> #include <asm/fixmap.h> -#include <asm/i8253.h> #include <asm/hpet.h> +#include <asm/time.h> #define HPET_MASK CLOCKSOURCE_MASK(32)
arch/x86/kernel/i8253.c +5 -94
125 lines not on this page · raw message
arch/x86/kernel/time.c +1 -1
@@ -11,13 +11,13 @@#include <linux/clockchips.h> #include <linux/interrupt.h> +#include <linux/i8253.h> #include <linux/time.h> #include <linux/mca.h> #include <asm/vsyscall.h> #include <asm/x86_init.h> #include <asm/i8259.h> -#include <asm/i8253.h> #include <asm/timer.h> #include <asm/hpet.h> #include <asm/time.h>
drivers/block/hd.c +1 -1
@@ -155,7 +155,7 @@ else \#if (HD_DELAY >0 ) -#include <asm/i8253.h> +#include <linux/i8253.h> unsigned long last_req;
drivers/clocksource/Kconfig +9 -0
@@ -1,5 +1,14 @@ config CLKSRC_I8253 bool +config CLKEVT_I8253 + bool + +config I8253_LOCK + bool + +config CLKBLD_I8253 + def_bool y if CLKSRC_I8253 || CLKEVT_I8253 || I8253_LOCK + config CLKSRC_MMIO bool
drivers/clocksource/Makefile +1 -1
@@ -6,5 +6,5 @@ obj-$(CONFIG_CS5535_CLOCK_EVENT_SRC) += cs5535-clockevt.o obj-$(CONFIG_SH_TIMER_CMT) += sh_cmt.o obj-$(CONFIG_SH_TIMER_MTU2) += sh_mtu2.o obj-$(CONFIG_SH_TIMER_TMU) += sh_tmu.o -obj-$(CONFIG_CLKSRC_I8253) += i8253.o +obj-$(CONFIG_CLKBLD_I8253) += i8253.o obj-$(CONFIG_CLKSRC_MMIO) += mmio.o
drivers/clocksource/i8253.c +106 -8
138 lines not on this page · raw message
drivers/input/gameport/gameport.c +1 -1
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(struct gameport *gameport);#if defined(__i386__) -#include <asm/i8253.h> +#include <linux/i8253.h> #define DELTA (x,y) ((y)-(x)+((y)<(x)?1193182/HZ:0))#define GET_TIME (x) do { x = get_time_pit(); } while (0)
drivers/input/joystick/analog.c +1 -1
@@ -136,7 +136,7 @@ struct analog_port {#ifdef __i386__ -#include <asm/i8253.h> +#include <linux/i8253.h> #define GET_TIME (x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)#define DELTA (x,y) (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
drivers/input/misc/pcspkr.c +1 -8
@@ -14,6 +14,7 @@#include <linux/kernel.h> #include <linux/module.h> +#include <linux/i8253.h> #include <linux/init.h> #include <linux/input.h> #include <linux/platform_device.h>
@@ -25,14 +26,6 @@ MODULE_DESCRIPTION("PC Speaker beeper driver");MODULE_LICENSE ("GPL" );MODULE_ALIAS ("platform:pcspkr" ); -#if defined(CONFIG_MIPS ) || defined(CONFIG_X86 ) -/* Use the global PIT lock ! */ -#include <asm/i8253.h> -#else -#include <asm/8253pit.h> -static DEFINE_RAW_SPINLOCK (i8253_lock); -#endif -static int pcspkr_event (struct input_dev *dev,unsigned int type,unsigned int code,int value) {unsigned int count =0 ;
include/linux/i8253.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Machine specific IO port address definition for generic. +* Written by Osamu Tomita <[email protected]> +*/ +#ifndef __LINUX_I8253_H +#define __LINUX_I8253_H + +#include <linux/param.h> +#include <linux/spinlock.h> +#include <linux/timex.h> + +/* i8253A PIT registers */ +#define PIT_MODE 0x43 +#define PIT_CH0 0x40 +#define PIT_CH2 0x42 + +#define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ) + +extern raw_spinlock_t i8253_lock; +extern struct clock_event_device i8253_clockevent; +extern void clockevent_i8253_init (bool oneshot); + +extern void setup_pit_timer (void ); + +#endif /* __LINUX_I8253_H */
init/Kconfig +6 -1
@@ -999,14 +999,19 @@ config ELF_CORE help Enable support for generating core dumps. Disabling saves about 4k. + config PCSPKR_PLATFORM bool "Enable PC-Speaker support" if EXPERT - depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES + depends on HAVE_PCSPKR_PLATFORM + select I8253_LOCK default y help This option allows to disable the internal PC-Speaker support, saving some memory. +config HAVE_PCSPKR_PLATFORM + bool + config BASE_FULL default y bool "Enable full-sized data structures for core" if EXPERT
sound/drivers/pcsp/pcsp.h +1 -7
@@ -10,14 +10,8 @@#define __PCSP_H__#include <linux/hrtimer.h> +#include <linux/i8253.h> #include <linux/timex.h> -#if defined(CONFIG_MIPS ) || defined(CONFIG_X86 ) -/* Use the global PIT lock ! */ -#include <asm/i8253.h> -#else -#include <asm/8253pit.h> -static DEFINE_RAW_SPINLOCK (i8253_lock); -#endif #define PCSP_SOUND_VERSION 0x400/* read 4.00 */ #define PCSP_DEBUG 0