linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 00/14] Sort out i8253 and PC speaker locking and headers
@ 2011-06-01 18:04 ralf
  2011-06-01 18:04 ` ralf
                   ` (15 more replies)
  0 siblings, 16 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-alpha, linuxppc-dev, linux-mips

No longer terribly relevant these days but still broken and just an eyesore
mess of neglience just as I've already raised it a few days ago.  Time to
sort this.

drivers/input/misc/pcspkr.c:

#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

sound/drivers/pcsp/pcsp.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);

$ git grep -F pcsp.h sound/drivers/pcsp
sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
$ git grep -w i8253_lock sound/drivers/pcsp/
sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_input.c:        raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);

Locks are great, everybody should have their own lock!

$ find . -name 8253pit.h
./arch/powerpc/include/asm/8253pit.h
./arch/alpha/include/asm/8253pit.h
$ cat arch/*/include/asm/8253pit.h
/*
 * 8253/8254 Programmable Interval Timer
 */
/*
 * 8253/8254 Programmable Interval Timer
 */
$

Eh...

$ git grep -w PCSPKR_PLATFORM 
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
init/Kconfig:config PCSPKR_PLATFORM
sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS

So the status is:

 Alpha:		There is no PCSPKR_PLATFORM so while a platform device is
		being installed no drivers will be built.  I don't know
		which Alpha platforms or even if all of Alpha should be
		doing a PCSPKR_PLATFORM so I haven't even tried to sort
		this.
 ARM:		No PC speaker supported, yeah :)
 PowerPC:	Should compile but the locking is wrong but only the AmigaOne
   		platforms should be affected.
 MIPS:		Ok.
 x86:		Ok.
 All others:	No PC speaker supported

Also only the plain old IBM PC XT was using a i8253; every later system
had i8254.  So maybe this is the time for renaming the support code?

  Ralf

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
@ 2011-06-01 18:04 ` ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-alpha, linuxppc-dev, linux-mips

No longer terribly relevant these days but still broken and just an eyesore
mess of neglience just as I've already raised it a few days ago.  Time to
sort this.

drivers/input/misc/pcspkr.c:

#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

sound/drivers/pcsp/pcsp.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);

$ git grep -F pcsp.h sound/drivers/pcsp
sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
$ git grep -w i8253_lock sound/drivers/pcsp/
sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_input.c:        raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock, flags
sound/drivers/pcsp/pcsp_lib.c:          raw_spin_unlock_irqrestore(&i8253_lock, 
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);

Locks are great, everybody should have their own lock!

$ find . -name 8253pit.h
./arch/powerpc/include/asm/8253pit.h
./arch/alpha/include/asm/8253pit.h
$ cat arch/*/include/asm/8253pit.h
/*
 * 8253/8254 Programmable Interval Timer
 */
/*
 * 8253/8254 Programmable Interval Timer
 */
$

Eh...

$ git grep -w PCSPKR_PLATFORM 
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/mips/Kconfig:      select PCSPKR_PLATFORM
arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
init/Kconfig:config PCSPKR_PLATFORM
sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS

So the status is:

 Alpha:		There is no PCSPKR_PLATFORM so while a platform device is
		being installed no drivers will be built.  I don't know
		which Alpha platforms or even if all of Alpha should be
		doing a PCSPKR_PLATFORM so I haven't even tried to sort
		this.
 ARM:		No PC speaker supported, yeah :)
 PowerPC:	Should compile but the locking is wrong but only the AmigaOne
   		platforms should be affected.
 MIPS:		Ok.
 x86:		Ok.
 All others:	No PC speaker supported

Also only the plain old IBM PC XT was using a i8253; every later system
had i8254.  So maybe this is the time for renaming the support code?

  Ralf


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
  2011-06-01 18:04 ` ralf
@ 2011-06-01 18:04 ` ralf
  2011-06-01 18:04   ` ralf
  2011-06-01 18:04 ` [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h> ralf
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, John Stultz,
	linux-mips

[-- Attachment #1: i8253-add-shared-header.patch --]
[-- Type: text/plain, Size: 10801 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: John Stultz <johnstul@us.ibm.com>
Cc: linux-mips@linux-mips.org

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- /dev/null
+++ linux-mips/include/linux/i8253.h
@@ -0,0 +1,11 @@
+/*
+ * 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.
+ */
+#ifndef __LINUX_I8253_H
+#define __LINUX_I8253_H
+
+#include <asm/i8253.h>
+
+#endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/mach-footbridge/isa-timer.c
===================================================================
--- linux-mips.orig/arch/arm/mach-footbridge/isa-timer.c
+++ linux-mips/arch/arm/mach-footbridge/isa-timer.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -14,7 +15,6 @@
 #include <linux/timex.h>
 
 #include <asm/irq.h>
-#include <asm/i8253.h>
 #include <asm/mach/time.h>
 
 #include "common.h"
Index: linux-mips/arch/mips/cobalt/time.c
===================================================================
--- linux-mips.orig/arch/mips/cobalt/time.c
+++ linux-mips/arch/mips/cobalt/time.c
@@ -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 */
Index: linux-mips/arch/mips/jazz/irq.c
===================================================================
--- linux-mips.orig/arch/mips/jazz/irq.c
+++ linux-mips/arch/mips/jazz/irq.c
@@ -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>
Index: linux-mips/arch/mips/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/i8253.c
+++ linux-mips/arch/mips/kernel/i8253.c
@@ -3,6 +3,7 @@
  *
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
@@ -12,7 +13,6 @@
 #include <linux/irq.h>
 
 #include <asm/delay.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/time.h>
 
Index: linux-mips/arch/mips/mti-malta/malta-time.c
===================================================================
--- linux-mips.orig/arch/mips/mti-malta/malta-time.c
+++ linux-mips/arch/mips/mti-malta/malta-time.c
@@ -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>
Index: linux-mips/arch/mips/sgi-ip22/ip22-time.c
===================================================================
--- linux-mips.orig/arch/mips/sgi-ip22/ip22-time.c
+++ linux-mips/arch/mips/sgi-ip22/ip22-time.c
@@ -10,6 +10,7 @@
  * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
  */
 #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>
Index: linux-mips/arch/mips/sni/time.c
===================================================================
--- linux-mips.orig/arch/mips/sni/time.c
+++ linux-mips/arch/mips/sni/time.c
@@ -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>
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -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>
Index: linux-mips/arch/x86/kernel/apm_32.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apm_32.c
+++ linux-mips/arch/x86/kernel/apm_32.c
@@ -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>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -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,7 +13,6 @@
 #include <linux/io.h>
 
 #include <asm/fixmap.h>
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/delay.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
Index: linux-mips/arch/x86/kernel/time.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/time.c
+++ linux-mips/arch/x86/kernel/time.c
@@ -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>
Index: linux-mips/drivers/block/hd.c
===================================================================
--- linux-mips.orig/drivers/block/hd.c
+++ linux-mips/drivers/block/hd.c
@@ -155,7 +155,7 @@ else \
 
 #if (HD_DELAY > 0)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 unsigned long last_req;
 
Index: linux-mips/drivers/clocksource/i8253.c
===================================================================
--- linux-mips.orig/drivers/clocksource/i8253.c
+++ linux-mips/drivers/clocksource/i8253.c
@@ -7,7 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/timex.h>
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 /*
  * Since the PIT overflows every tick, its not very useful
Index: linux-mips/drivers/input/gameport/gameport.c
===================================================================
--- linux-mips.orig/drivers/input/gameport/gameport.c
+++ linux-mips/drivers/input/gameport/gameport.c
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(str
 
 #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)
Index: linux-mips/drivers/input/joystick/analog.c
===================================================================
--- linux-mips.orig/drivers/input/joystick/analog.c
+++ linux-mips/drivers/input/joystick/analog.c
@@ -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)))
Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ MODULE_ALIAS("platform:pcspkr");
 
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);
Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -13,7 +13,7 @@
 #include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it.
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
@ 2011-06-01 18:04   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, John Stultz,
	linux-mips

[-- Attachment #1: i8253-add-shared-header.patch --]
[-- Type: text/plain, Size: 10803 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: John Stultz <johnstul@us.ibm.com>
Cc: linux-mips@linux-mips.org

 arch/arm/mach-footbridge/isa-timer.c |    2 +-
 arch/mips/cobalt/time.c              |    2 +-
 arch/mips/jazz/irq.c                 |    2 +-
 arch/mips/kernel/i8253.c             |    2 +-
 arch/mips/mti-malta/malta-time.c     |    2 +-
 arch/mips/sgi-ip22/ip22-time.c       |    2 +-
 arch/mips/sni/time.c                 |    2 +-
 arch/x86/kernel/apic/apic.c          |    2 +-
 arch/x86/kernel/apm_32.c             |    2 +-
 arch/x86/kernel/hpet.c               |    2 +-
 arch/x86/kernel/i8253.c              |    2 +-
 arch/x86/kernel/time.c               |    2 +-
 drivers/block/hd.c                   |    2 +-
 drivers/clocksource/i8253.c          |    2 +-
 drivers/input/gameport/gameport.c    |    2 +-
 drivers/input/joystick/analog.c      |    2 +-
 drivers/input/misc/pcspkr.c          |    2 +-
 include/linux/i8253.h                |   11 +++++++++++
 sound/drivers/pcsp/pcsp.h            |    2 +-
 19 files changed, 29 insertions(+), 18 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- /dev/null
+++ linux-mips/include/linux/i8253.h
@@ -0,0 +1,11 @@
+/*
+ * 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.
+ */
+#ifndef __LINUX_I8253_H
+#define __LINUX_I8253_H
+
+#include <asm/i8253.h>
+
+#endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/mach-footbridge/isa-timer.c
===================================================================
--- linux-mips.orig/arch/arm/mach-footbridge/isa-timer.c
+++ linux-mips/arch/arm/mach-footbridge/isa-timer.c
@@ -6,6 +6,7 @@
  */
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -14,7 +15,6 @@
 #include <linux/timex.h>
 
 #include <asm/irq.h>
-#include <asm/i8253.h>
 #include <asm/mach/time.h>
 
 #include "common.h"
Index: linux-mips/arch/mips/cobalt/time.c
===================================================================
--- linux-mips.orig/arch/mips/cobalt/time.c
+++ linux-mips/arch/mips/cobalt/time.c
@@ -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 */
Index: linux-mips/arch/mips/jazz/irq.c
===================================================================
--- linux-mips.orig/arch/mips/jazz/irq.c
+++ linux-mips/arch/mips/jazz/irq.c
@@ -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>
Index: linux-mips/arch/mips/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/i8253.c
+++ linux-mips/arch/mips/kernel/i8253.c
@@ -3,6 +3,7 @@
  *
  */
 #include <linux/clockchips.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
@@ -12,7 +13,6 @@
 #include <linux/irq.h>
 
 #include <asm/delay.h>
-#include <asm/i8253.h>
 #include <asm/io.h>
 #include <asm/time.h>
 
Index: linux-mips/arch/mips/mti-malta/malta-time.c
===================================================================
--- linux-mips.orig/arch/mips/mti-malta/malta-time.c
+++ linux-mips/arch/mips/mti-malta/malta-time.c
@@ -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>
Index: linux-mips/arch/mips/sgi-ip22/ip22-time.c
===================================================================
--- linux-mips.orig/arch/mips/sgi-ip22/ip22-time.c
+++ linux-mips/arch/mips/sgi-ip22/ip22-time.c
@@ -10,6 +10,7 @@
  * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org)
  */
 #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>
Index: linux-mips/arch/mips/sni/time.c
===================================================================
--- linux-mips.orig/arch/mips/sni/time.c
+++ linux-mips/arch/mips/sni/time.c
@@ -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>
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -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>
Index: linux-mips/arch/x86/kernel/apm_32.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apm_32.c
+++ linux-mips/arch/x86/kernel/apm_32.c
@@ -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>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -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,7 +13,6 @@
 #include <linux/io.h>
 
 #include <asm/fixmap.h>
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -9,10 +9,10 @@
 #include <linux/module.h>
 #include <linux/timex.h>
 #include <linux/delay.h>
+#include <linux/i8253.h>
 #include <linux/init.h>
 #include <linux/io.h>
 
-#include <asm/i8253.h>
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
Index: linux-mips/arch/x86/kernel/time.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/time.c
+++ linux-mips/arch/x86/kernel/time.c
@@ -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>
Index: linux-mips/drivers/block/hd.c
===================================================================
--- linux-mips.orig/drivers/block/hd.c
+++ linux-mips/drivers/block/hd.c
@@ -155,7 +155,7 @@ else \
 
 #if (HD_DELAY > 0)
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 unsigned long last_req;
 
Index: linux-mips/drivers/clocksource/i8253.c
===================================================================
--- linux-mips.orig/drivers/clocksource/i8253.c
+++ linux-mips/drivers/clocksource/i8253.c
@@ -7,7 +7,7 @@
 #include <linux/spinlock.h>
 #include <linux/timex.h>
 
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 
 /*
  * Since the PIT overflows every tick, its not very useful
Index: linux-mips/drivers/input/gameport/gameport.c
===================================================================
--- linux-mips.orig/drivers/input/gameport/gameport.c
+++ linux-mips/drivers/input/gameport/gameport.c
@@ -47,7 +47,7 @@ static void gameport_disconnect_port(str
 
 #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)
Index: linux-mips/drivers/input/joystick/analog.c
===================================================================
--- linux-mips.orig/drivers/input/joystick/analog.c
+++ linux-mips/drivers/input/joystick/analog.c
@@ -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)))
Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -27,7 +27,7 @@ MODULE_ALIAS("platform:pcspkr");
 
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);
Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -13,7 +13,7 @@
 #include <linux/timex.h>
 #if defined(CONFIG_MIPS) || defined(CONFIG_X86)
 /* Use the global PIT lock ! */
-#include <asm/i8253.h>
+#include <linux/i8253.h>
 #else
 #include <asm/8253pit.h>
 static DEFINE_RAW_SPINLOCK(i8253_lock);



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h>.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
  2011-06-01 18:04 ` ralf
  2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
@ 2011-06-01 18:04 ` ralf
  2011-06-01 18:04   ` ralf
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-arm-kernel, linux-mips

[-- Attachment #1: i8253-move-common-declarations-to-new-header.patch --]
[-- Type: text/plain, Size: 3140 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    9 ---------
 arch/mips/include/asm/i8253.h |   12 ------------
 arch/x86/include/asm/i8253.h  |   10 ----------
 include/linux/i8253.h         |   14 ++++++++++++++
 4 files changed, 14 insertions(+), 31 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -2,10 +2,24 @@
  * 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 <tomita@cinet.co.jp>
  */
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/spinlock.h>
 #include <asm/i8253.h>
 
+/* i8253A PIT registers */
+#define PIT_MODE	0x43
+#define PIT_CH0		0x40
+#define PIT_CH2		0x42
+
+#define inb_pit         inb_p
+#define outb_pit        outb_p
+
+extern raw_spinlock_t i8253_lock;
+
 #endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,15 +1,6 @@
 #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
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,20 +5,8 @@
 #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 */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,20 +1,10 @@
 #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 */

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h>.
  2011-06-01 18:04 ` [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h> ralf
@ 2011-06-01 18:04   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-arm-kernel, linux-mips

[-- Attachment #1: i8253-move-common-declarations-to-new-header.patch --]
[-- Type: text/plain, Size: 3142 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    9 ---------
 arch/mips/include/asm/i8253.h |   12 ------------
 arch/x86/include/asm/i8253.h  |   10 ----------
 include/linux/i8253.h         |   14 ++++++++++++++
 4 files changed, 14 insertions(+), 31 deletions(-)

Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -2,10 +2,24 @@
  * 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 <tomita@cinet.co.jp>
  */
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/spinlock.h>
 #include <asm/i8253.h>
 
+/* i8253A PIT registers */
+#define PIT_MODE	0x43
+#define PIT_CH0		0x40
+#define PIT_CH2		0x42
+
+#define inb_pit         inb_p
+#define outb_pit        outb_p
+
+extern raw_spinlock_t i8253_lock;
+
 #endif /* __LINUX_I8253_H */
Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,15 +1,6 @@
 #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
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,20 +5,8 @@
 #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 */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,20 +1,10 @@
 #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 */



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (2 preceding siblings ...)
  2011-06-01 18:04 ` [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h> ralf
@ 2011-06-01 18:04 ` ralf
  2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-arch

[-- Attachment #1: i8253-add-shared-lock.patch --]
[-- Type: text/plain, Size: 1633 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org

 lib/Kconfig      |    6 ++++++
 lib/Makefile     |    1 +
 lib/i8253-lock.c |   11 +++++++++++
 3 files changed, 18 insertions(+)

Index: linux-i8253/lib/i8253-lock.c
===================================================================
--- /dev/null
+++ linux-i8253/lib/i8253-lock.c
@@ -0,0 +1,11 @@
+#include <linux/spinlock.h>
+#include <linux/module.h>
+
+/*
+ * Protects access to I/O ports
+ *
+ * 0040-0043 : timer0, i8253 / i8254
+ * 0061-0061 : NMI Control Register which contains two speaker control bits.
+ */
+DEFINE_RAW_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
Index: linux-i8253/lib/Makefile
===================================================================
--- linux-i8253.orig/lib/Makefile
+++ linux-i8253/lib/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o 
 obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o
 obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o
 obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock_debug.o
+obj-$(CONFIG_I8253_LOCK) += i8253-lock.o
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
 
Index: linux-i8253/lib/Kconfig
===================================================================
--- linux-i8253.orig/lib/Kconfig
+++ linux-i8253/lib/Kconfig
@@ -237,6 +237,12 @@ config CPU_RMAP
 	bool
 	depends on SMP
 
+config I8253_LOCK
+	bool
+	help
+	  Enable the shared lock for the i8253 PIT.  Any system that uses
+	  the i8253 should select this.
+
 #
 # Netlink attribute parsing support is select'ed if needed
 #

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 04/14] i8253: Make MIPS use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (3 preceding siblings ...)
  2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: linux-mips

[-- Attachment #1: i8253-move-mips-to-shared-lock.patch --]
[-- Type: text/plain, Size: 919 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org

 arch/mips/Kconfig        |    1 +
 arch/mips/kernel/i8253.c |    3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -2388,6 +2388,7 @@ config MMU
 config I8253
 	bool
 	select CLKSRC_I8253
+	select I8253_LOCK
 	select MIPS_EXTERNAL_TIMER
 
 config ZONE_DMA32
Index: linux-mips/arch/mips/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/mips/kernel/i8253.c
+++ linux-mips/arch/mips/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/io.h>
 #include <asm/time.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * Initialize the PIT timer.
  *

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 05/14] i8253: Make x86 use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (4 preceding siblings ...)
  2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86

[-- Attachment #1: i8253-move-x86-to-shared-lock.patch --]
[-- Type: text/plain, Size: 1180 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/x86/Kconfig        |    1 +
 arch/x86/kernel/i8253.c |    3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -67,6 +67,7 @@ config X86
 	select GENERIC_IRQ_PROBE
 	select GENERIC_PENDING_IRQ if SMP
 	select GENERIC_IRQ_SHOW
+	select I8253_LOCK
 	select IRQ_FORCED_THREADING
 	select USE_GENERIC_SMP_HELPERS if SMP
 	select HAVE_BPF_JIT if (X86_64 && NET)
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -16,9 +16,6 @@
 #include <asm/hpet.h>
 #include <asm/smp.h>
 
-DEFINE_RAW_SPINLOCK(i8253_lock);
-EXPORT_SYMBOL(i8253_lock);
-
 /*
  * HPET replaces the PIT, when enabled. So we need to know, which of
  * the two timers is used

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 06/14] i8253: Make pcspkr input driver use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (5 preceding siblings ...)
  2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Dmitry Torokhov, linux-input

[-- Attachment #1: i8253-move-pcspkr.c-to-shared-lock.patch --]
[-- Type: text/plain, Size: 1089 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org

 drivers/input/misc/pcspkr.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -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 dr
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
-#include <linux/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;

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 06/14] i8253: Make pcspkr input driver use the shared i8253_lock.
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Dmitry Torokhov, linux-input

[-- Attachment #1: i8253-move-pcspkr.c-to-shared-lock.patch --]
[-- Type: text/plain, Size: 1091 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org

 drivers/input/misc/pcspkr.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Index: linux-mips/drivers/input/misc/pcspkr.c
===================================================================
--- linux-mips.orig/drivers/input/misc/pcspkr.c
+++ linux-mips/drivers/input/misc/pcspkr.c
@@ -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 dr
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pcspkr");
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
-#include <linux/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;



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (6 preceding siblings ...)
  2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-03  9:53   ` Takashi Iwai
  2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
                   ` (7 subsequent siblings)
  15 siblings, 2 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Takashi Iwai, alsa-devel

[-- Attachment #1: i8253-move-sound-pcsp-to-shared-lock.patch --]
[-- Type: text/plain, Size: 862 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org

 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-03  9:53   ` Takashi Iwai
  1 sibling, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel

[-- Attachment #1: i8253-move-sound-pcsp-to-shared-lock.patch --]
[-- Type: text/plain, Size: 864 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org

 sound/drivers/pcsp/pcsp.h |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Index: linux-mips/sound/drivers/pcsp/pcsp.h
===================================================================
--- linux-mips.orig/sound/drivers/pcsp/pcsp.h
+++ linux-mips/sound/drivers/pcsp/pcsp.h
@@ -10,14 +10,8 @@
 #define __PCSP_H__
 
 #include <linux/hrtimer.h>
-#include <linux/timex.h>
-#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
-/* Use the global PIT lock ! */
 #include <linux/i8253.h>
-#else
-#include <asm/8253pit.h>
-static DEFINE_RAW_SPINLOCK(i8253_lock);
-#endif
+#include <linux/timex.h>
 
 #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
 #define PCSP_DEBUG 0



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (7 preceding siblings ...)
  2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha

[-- Attachment #1: i8253-cleanup-remaining-alpha-users-of-8253pit.h.patch --]
[-- Type: text/plain, Size: 1194 bytes --]

The Alpha <asm/i8253pit.h> header is empty so this inclusion can just be
removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org

 arch/alpha/kernel/sys_ruffian.c |    1 -
 arch/alpha/kernel/time.c        |    1 -
 2 files changed, 2 deletions(-)

Index: linux-mips/arch/alpha/kernel/sys_ruffian.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/sys_ruffian.c
+++ linux-mips/arch/alpha/kernel/sys_ruffian.c
@@ -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"
Index: linux-mips/arch/alpha/kernel/time.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/time.c
+++ linux-mips/arch/alpha/kernel/time.c
@@ -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>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h
  2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha

[-- Attachment #1: i8253-cleanup-remaining-alpha-users-of-8253pit.h.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

The Alpha <asm/i8253pit.h> header is empty so this inclusion can just be
removed.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org

 arch/alpha/kernel/sys_ruffian.c |    1 -
 arch/alpha/kernel/time.c        |    1 -
 2 files changed, 2 deletions(-)

Index: linux-mips/arch/alpha/kernel/sys_ruffian.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/sys_ruffian.c
+++ linux-mips/arch/alpha/kernel/sys_ruffian.c
@@ -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"
Index: linux-mips/arch/alpha/kernel/time.c
===================================================================
--- linux-mips.orig/arch/alpha/kernel/time.c
+++ linux-mips/arch/alpha/kernel/time.c
@@ -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>



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (8 preceding siblings ...)
  2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-09  5:07   ` Benjamin Herrenschmidt
  2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
                   ` (5 subsequent siblings)
  15 siblings, 2 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

[-- Attachment #1: i8253-remove-unused-8253pit.h-files.patch --]
[-- Type: text/plain, Size: 1004 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 6 deletions(-)

Index: linux-mips/arch/alpha/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
Index: linux-mips/arch/powerpc/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-09  5:07   ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

[-- Attachment #1: i8253-remove-unused-8253pit.h-files.patch --]
[-- Type: text/plain, Size: 1006 bytes --]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/include/asm/8253pit.h   |    3 ---
 arch/powerpc/include/asm/8253pit.h |    3 ---
 2 files changed, 6 deletions(-)

Index: linux-mips/arch/alpha/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/alpha/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
Index: linux-mips/arch/powerpc/include/asm/8253pit.h
===================================================================
--- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (9 preceding siblings ...)
  2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-01 18:05 ` [patch 11/14] i8253: Consolidate definitions of PIT_LATCH ralf
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Venkatesh Pallipadi (Venki)

[-- Attachment #1: i8253-cleanup-x86-global_clock_event.patch --]
[-- Type: text/plain, Size: 3675 bytes --]

There are multiple declarations of global_clock_event in header files
specific to particular clock event implementatiosn.  Consolidate them
in <asm/time.h> and make sure all users include that header.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: "Venkatesh Pallipadi (Venki)" <venki@google.com>

 arch/x86/include/asm/apb_timer.h |    1 -
 arch/x86/include/asm/i8253.h     |    2 --
 arch/x86/include/asm/time.h      |    6 ++++--
 arch/x86/kernel/apb_timer.c      |    1 +
 arch/x86/kernel/apic/apic.c      |    1 +
 arch/x86/kernel/hpet.c           |    1 +
 arch/x86/kernel/i8253.c          |    1 +
 7 files changed, 8 insertions(+), 5 deletions(-)

Index: linux-mips/arch/x86/include/asm/apb_timer.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/apb_timer.h
+++ linux-mips/arch/x86/include/asm/apb_timer.h
@@ -50,7 +50,6 @@
 #define APBT_DEV_USED  1
 
 extern 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);
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -3,8 +3,6 @@
 
 #define PIT_LATCH	LATCH
 
-extern struct clock_event_device *global_clock_event;
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/arch/x86/include/asm/time.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/time.h
+++ linux-mips/arch/x86/include/asm/time.h
@@ -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 */
Index: linux-mips/arch/x86/kernel/apb_timer.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apb_timer.c
+++ linux-mips/arch/x86/kernel/apb_timer.c
@@ -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
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -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>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -14,6 +14,7 @@
 
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
+#include <asm/time.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
 
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 
 #include <asm/hpet.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 
 /*

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event
  2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Venkatesh Pallipadi (Venki)

[-- Attachment #1: i8253-cleanup-x86-global_clock_event.patch --]
[-- Type: text/plain, Size: 3677 bytes --]

There are multiple declarations of global_clock_event in header files
specific to particular clock event implementatiosn.  Consolidate them
in <asm/time.h> and make sure all users include that header.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: "Venkatesh Pallipadi (Venki)" <venki@google.com>

 arch/x86/include/asm/apb_timer.h |    1 -
 arch/x86/include/asm/i8253.h     |    2 --
 arch/x86/include/asm/time.h      |    6 ++++--
 arch/x86/kernel/apb_timer.c      |    1 +
 arch/x86/kernel/apic/apic.c      |    1 +
 arch/x86/kernel/hpet.c           |    1 +
 arch/x86/kernel/i8253.c          |    1 +
 7 files changed, 8 insertions(+), 5 deletions(-)

Index: linux-mips/arch/x86/include/asm/apb_timer.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/apb_timer.h
+++ linux-mips/arch/x86/include/asm/apb_timer.h
@@ -50,7 +50,6 @@
 #define APBT_DEV_USED  1
 
 extern 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);
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -3,8 +3,6 @@
 
 #define PIT_LATCH	LATCH
 
-extern struct clock_event_device *global_clock_event;
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/arch/x86/include/asm/time.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/time.h
+++ linux-mips/arch/x86/include/asm/time.h
@@ -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 */
Index: linux-mips/arch/x86/kernel/apb_timer.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apb_timer.c
+++ linux-mips/arch/x86/kernel/apb_timer.c
@@ -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
Index: linux-mips/arch/x86/kernel/apic/apic.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/apic/apic.c
+++ linux-mips/arch/x86/kernel/apic/apic.c
@@ -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>
Index: linux-mips/arch/x86/kernel/hpet.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/hpet.c
+++ linux-mips/arch/x86/kernel/hpet.c
@@ -14,6 +14,7 @@
 
 #include <asm/fixmap.h>
 #include <asm/hpet.h>
+#include <asm/time.h>
 
 #define HPET_MASK			CLOCKSOURCE_MASK(32)
 
Index: linux-mips/arch/x86/kernel/i8253.c
===================================================================
--- linux-mips.orig/arch/x86/kernel/i8253.c
+++ linux-mips/arch/x86/kernel/i8253.c
@@ -14,6 +14,7 @@
 #include <linux/io.h>
 
 #include <asm/hpet.h>
+#include <asm/time.h>
 #include <asm/smp.h>
 
 /*



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 11/14] i8253: Consolidate definitions of PIT_LATCH
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (10 preceding siblings ...)
  2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, Russell King, x86, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner, linux-arm-kernel

[-- Attachment #1: i8253-sort-out-pit_latch-definitions.patch --]
[-- Type: text/plain, Size: 2711 bytes --]

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 11/14] i8253: Consolidate definitions of PIT_LATCH
  2011-06-01 18:05 ` [patch 11/14] i8253: Consolidate definitions of PIT_LATCH ralf
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Russell King, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	linux-arm-kernel, linux-mips

[-- Attachment #1: i8253-sort-out-pit_latch-definitions.patch --]
[-- Type: text/plain, Size: 2715 bytes --]

x86 defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as PIT_TICK_RATE.

MIPS defines PIT_LATCH as LATCH which in <linux/timex.h> is defined as
((CLOCK_TICK_RATE + HZ/2) / HZ) and <asm/timex.h> again defines
CLOCK_TICK_RATE as 1193182.

ARM defines PITCH_LATCH as ((PIT_TICK_RATE + HZ / 2) / HZ) - and that's
the sanest thing and equivalent to above definitions so use that as the
new definition in <linux/i8253.h>.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org

 arch/arm/include/asm/i8253.h  |    2 --
 arch/mips/include/asm/i8253.h |    2 --
 arch/x86/include/asm/i8253.h  |    2 --
 include/linux/i8253.h         |    4 ++++
 4 files changed, 4 insertions(+), 6 deletions(-)

Index: linux-mips/arch/arm/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/arm/include/asm/i8253.h
+++ linux-mips/arch/arm/include/asm/i8253.h
@@ -1,6 +1,4 @@
 #ifndef __ASMARM_I8253_H
 #define __ASMARM_I8253_H
 
-#define PIT_LATCH	((PIT_TICK_RATE + HZ / 2) / HZ)
-
 #endif
Index: linux-mips/arch/mips/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/mips/include/asm/i8253.h
+++ linux-mips/arch/mips/include/asm/i8253.h
@@ -5,8 +5,6 @@
 #ifndef __ASM_I8253_H
 #define __ASM_I8253_H
 
-#define PIT_LATCH		LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* __ASM_I8253_H */
Index: linux-mips/arch/x86/include/asm/i8253.h
===================================================================
--- linux-mips.orig/arch/x86/include/asm/i8253.h
+++ linux-mips/arch/x86/include/asm/i8253.h
@@ -1,8 +1,6 @@
 #ifndef _ASM_X86_I8253_H
 #define _ASM_X86_I8253_H
 
-#define PIT_LATCH	LATCH
-
 extern void setup_pit_timer(void);
 
 #endif /* _ASM_X86_I8253_H */
Index: linux-mips/include/linux/i8253.h
===================================================================
--- linux-mips.orig/include/linux/i8253.h
+++ linux-mips/include/linux/i8253.h
@@ -9,7 +9,9 @@
 #ifndef __LINUX_I8253_H
 #define __LINUX_I8253_H
 
+#include <linux/param.h>
 #include <linux/spinlock.h>
+#include <linux/timex.h>
 #include <asm/i8253.h>
 
 /* i8253A PIT registers */
@@ -17,6 +19,8 @@
 #define PIT_CH0		0x40
 #define PIT_CH2		0x42
 
+#define PIT_LATCH	((PIT_TICK_RATE + HZ/2) / HZ)
+
 #define inb_pit         inb_p
 #define outb_pit        outb_p
 



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (11 preceding siblings ...)
  2011-06-01 18:05 ` [patch 11/14] i8253: Consolidate definitions of PIT_LATCH ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-02 11:29   ` Sergei Shtylyov
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
                   ` (2 subsequent siblings)
  15 siblings, 2 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, Russell King, x86, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner, linux-arm-kernel

[-- Attachment #1: i8253-sort-remaining-definitions.patch --]
[-- Type: text/plain, Size: 3092 bytes --]

There is no really good other place but one line for two out of three
architectures that have a <asm/i8253.h> file doesn't justify this files
existence.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/mips/include/asm/time.h  |    5 +++++
 arch/x86/include/asm/i8253.h  |    6 ------
 arch/x86/include/asm/time.h   |    1 +
 include/linux/i8253.h         |    1 -
 6 files changed, 6 insertions(+), 21 deletions(-)

Index: linux-i8253/arch/x86/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
Index: linux-i8253/include/linux/i8253.h
===================================================================
--- linux-i8253.orig/include/linux/i8253.h
+++ linux-i8253/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
Index: linux-i8253/arch/x86/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/time.h
+++ linux-i8253/arch/x86/include/asm/time.h
@@ -6,6 +6,7 @@
 
 extern void hpet_time_init(void);
 extern void time_init(void);
+extern void setup_pit_timer(void);
 
 extern struct clock_event_device *global_clock_event;
 
Index: linux-i8253/arch/mips/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
Index: linux-i8253/arch/arm/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
Index: linux-i8253/arch/mips/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/time.h
+++ linux-i8253/arch/mips/include/asm/time.h
@@ -36,6 +36,11 @@ extern int rtc_mips_set_mmss(unsigned lo
 extern void plat_time_init(void);
 
 /*
+ * Initialize i8253 / i8254 PIT clockevent device.
+ */
+extern void setup_pit_timer(void);
+
+/*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
  * counter as a timer interrupt source.
  */

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
  2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-02 11:29   ` Sergei Shtylyov
  1 sibling, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-arm-kernel, Russell King, linux-mips, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86

[-- Attachment #1: i8253-sort-remaining-definitions.patch --]
[-- Type: text/plain, Size: 3094 bytes --]

There is no really good other place but one line for two out of three
architectures that have a <asm/i8253.h> file doesn't justify this files
existence.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-mips@linux-mips.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org

 arch/arm/include/asm/i8253.h  |    4 ----
 arch/mips/include/asm/i8253.h |   10 ----------
 arch/mips/include/asm/time.h  |    5 +++++
 arch/x86/include/asm/i8253.h  |    6 ------
 arch/x86/include/asm/time.h   |    1 +
 include/linux/i8253.h         |    1 -
 6 files changed, 6 insertions(+), 21 deletions(-)

Index: linux-i8253/arch/x86/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/i8253.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_X86_I8253_H
-#define _ASM_X86_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* _ASM_X86_I8253_H */
Index: linux-i8253/include/linux/i8253.h
===================================================================
--- linux-i8253.orig/include/linux/i8253.h
+++ linux-i8253/include/linux/i8253.h
@@ -12,7 +12,6 @@
 #include <linux/param.h>
 #include <linux/spinlock.h>
 #include <linux/timex.h>
-#include <asm/i8253.h>
 
 /* i8253A PIT registers */
 #define PIT_MODE	0x43
Index: linux-i8253/arch/x86/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/x86/include/asm/time.h
+++ linux-i8253/arch/x86/include/asm/time.h
@@ -6,6 +6,7 @@
 
 extern void hpet_time_init(void);
 extern void time_init(void);
+extern void setup_pit_timer(void);
 
 extern struct clock_event_device *global_clock_event;
 
Index: linux-i8253/arch/mips/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/i8253.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- *  Machine specific IO port address definition for generic.
- *  Written by Osamu Tomita <tomita@cinet.co.jp>
- */
-#ifndef __ASM_I8253_H
-#define __ASM_I8253_H
-
-extern void setup_pit_timer(void);
-
-#endif /* __ASM_I8253_H */
Index: linux-i8253/arch/arm/include/asm/i8253.h
===================================================================
--- linux-i8253.orig/arch/arm/include/asm/i8253.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef __ASMARM_I8253_H
-#define __ASMARM_I8253_H
-
-#endif
Index: linux-i8253/arch/mips/include/asm/time.h
===================================================================
--- linux-i8253.orig/arch/mips/include/asm/time.h
+++ linux-i8253/arch/mips/include/asm/time.h
@@ -36,6 +36,11 @@ extern int rtc_mips_set_mmss(unsigned lo
 extern void plat_time_init(void);
 
 /*
+ * Initialize i8253 / i8254 PIT clockevent device.
+ */
+extern void setup_pit_timer(void);
+
+/*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
  * counter as a timer interrupt source.
  */



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (12 preceding siblings ...)
  2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-09  5:09   ` Benjamin Herrenschmidt
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  15 siblings, 2 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Benjamin Herrenschmidt, Paul Mackerras, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, linux-alpha, linux-mips,
	linuxppc-dev

[-- Attachment #1: i8253-use-aux-symbol-for-pcspkr-config.patch --]
[-- Type: text/plain, Size: 4158 bytes --]

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/Kconfig                     |    1 +
 arch/mips/Kconfig                      |    1 +
 arch/powerpc/platforms/chrp/Kconfig    |    1 +
 arch/powerpc/platforms/prep/Kconfig    |    1 +
 arch/powerpc/platforms/pseries/Kconfig |    1 +
 arch/x86/Kconfig                       |    1 +
 init/Kconfig                           |    5 ++++-
 7 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-mips/arch/alpha/Kconfig
===================================================================
--- linux-mips.orig/arch/alpha/Kconfig
+++ linux-mips/arch/alpha/Kconfig
@@ -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
Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
Index: linux-mips/arch/powerpc/platforms/chrp/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/chrp/Kconfig
+++ linux-mips/arch/powerpc/platforms/chrp/Kconfig
@@ -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
Index: linux-mips/arch/powerpc/platforms/prep/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/prep/Kconfig
+++ linux-mips/arch/powerpc/platforms/prep/Kconfig
@@ -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
Index: linux-mips/arch/powerpc/platforms/pseries/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/pseries/Kconfig
+++ linux-mips/arch/powerpc/platforms/pseries/Kconfig
@@ -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
Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -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
Index: linux-mips/init/Kconfig
===================================================================
--- linux-mips.orig/init/Kconfig
+++ linux-mips/init/Kconfig
@@ -1001,12 +1001,15 @@ config ELF_CORE
 
 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
 	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

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
@ 2011-06-01 18:05   ` ralf
  2011-06-09  5:09   ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner,
	Benjamin Herrenschmidt, Paul Mackerras, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86, linux-alpha, linux-mips,
	linuxppc-dev

[-- Attachment #1: i8253-use-aux-symbol-for-pcspkr-config.patch --]
[-- Type: text/plain, Size: 4160 bytes --]

Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
usually either wrong or too coarse grained.  Or plain an ugly sin.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org

 arch/alpha/Kconfig                     |    1 +
 arch/mips/Kconfig                      |    1 +
 arch/powerpc/platforms/chrp/Kconfig    |    1 +
 arch/powerpc/platforms/prep/Kconfig    |    1 +
 arch/powerpc/platforms/pseries/Kconfig |    1 +
 arch/x86/Kconfig                       |    1 +
 init/Kconfig                           |    5 ++++-
 7 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-mips/arch/alpha/Kconfig
===================================================================
--- linux-mips.orig/arch/alpha/Kconfig
+++ linux-mips/arch/alpha/Kconfig
@@ -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
Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,6 +5,7 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
+	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
Index: linux-mips/arch/powerpc/platforms/chrp/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/chrp/Kconfig
+++ linux-mips/arch/powerpc/platforms/chrp/Kconfig
@@ -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
Index: linux-mips/arch/powerpc/platforms/prep/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/prep/Kconfig
+++ linux-mips/arch/powerpc/platforms/prep/Kconfig
@@ -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
Index: linux-mips/arch/powerpc/platforms/pseries/Kconfig
===================================================================
--- linux-mips.orig/arch/powerpc/platforms/pseries/Kconfig
+++ linux-mips/arch/powerpc/platforms/pseries/Kconfig
@@ -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
Index: linux-mips/arch/x86/Kconfig
===================================================================
--- linux-mips.orig/arch/x86/Kconfig
+++ linux-mips/arch/x86/Kconfig
@@ -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
Index: linux-mips/init/Kconfig
===================================================================
--- linux-mips.orig/init/Kconfig
+++ linux-mips/init/Kconfig
@@ -1001,12 +1001,15 @@ config ELF_CORE
 
 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
 	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



^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained.
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (13 preceding siblings ...)
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
@ 2011-06-01 18:05 ` ralf
  2011-06-01 18:05   ` ralf
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  15 siblings, 1 reply; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: linux-mips

[-- Attachment #1: i8253-make-mips-pcspkr-config-finer-grained.patch --]
[-- Type: text/plain, Size: 1462 bytes --]

Only the Siemens-Nixdorf RM series workstations and the Jazz family
workstations have PC speakers built in; Malta can connect one via the
infamous AMR connector with an AMR sound card or a little creativity.
So we don't want to offer the PC speaker driver on all MIPS systems.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org

 arch/mips/Kconfig |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,7 +5,6 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
-	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
@@ -186,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
@@ -267,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
@@ -641,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

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained.
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
@ 2011-06-01 18:05   ` ralf
  0 siblings, 0 replies; 39+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch; +Cc: linux-mips

[-- Attachment #1: i8253-make-mips-pcspkr-config-finer-grained.patch --]
[-- Type: text/plain, Size: 1464 bytes --]

Only the Siemens-Nixdorf RM series workstations and the Jazz family
workstations have PC speakers built in; Malta can connect one via the
infamous AMR connector with an AMR sound card or a little creativity.
So we don't want to offer the PC speaker driver on all MIPS systems.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org

 arch/mips/Kconfig |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-mips/arch/mips/Kconfig
===================================================================
--- linux-mips.orig/arch/mips/Kconfig
+++ linux-mips/arch/mips/Kconfig
@@ -5,7 +5,6 @@ config MIPS
 	select HAVE_IDE
 	select HAVE_OPROFILE
 	select HAVE_IRQ_WORK
-	select HAVE_PCSPKR_PLATFORM
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	select HAVE_ARCH_KGDB
@@ -186,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
@@ -267,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
@@ -641,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



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h>
  2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
  2011-06-01 18:05   ` ralf
@ 2011-06-02 11:29   ` Sergei Shtylyov
  1 sibling, 0 replies; 39+ messages in thread
From: Sergei Shtylyov @ 2011-06-02 11:29 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, linux-mips, Russell King, x86,
	Ingo Molnar, H. Peter Anvin, Thomas Gleixner, linux-arm-kernel

Hello.

On 01-06-2011 22:05, ralf@linux-mips.org wrote:

> There is no really good other place but one line for two out of three
> architectures that have a <asm/i8253.h> file doesn't justify this files
> existence.

    I couldn't parse that. :-)

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: linux-mips@linux-mips.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org

WBR, Sergei

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
                   ` (14 preceding siblings ...)
  2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
@ 2011-06-02 19:11 ` Gerhard Pircher
  2011-06-02 19:11   ` Gerhard Pircher
  2011-06-03 18:00   ` Ralf Baechle
  15 siblings, 2 replies; 39+ messages in thread
From: Gerhard Pircher @ 2011-06-02 19:11 UTC (permalink / raw)
  To: ralf, linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel


-------- Original-Nachricht --------
> Datum: Wed, 01 Jun 2011 19:04:56 +0100
> Von: ralf@linux-mips.org
> An: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org
> Betreff: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> No longer terribly relevant these days but still broken and just an
> eyesore mess of neglience just as I've already raised it a few days 
> ago.  Time to sort this.
> 
> drivers/input/misc/pcspkr.c:
> 
> #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
> 
> sound/drivers/pcsp/pcsp.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);
> 
> $ git grep -F pcsp.h sound/drivers/pcsp
> sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> $ git grep -w i8253_lock sound/drivers/pcsp/
> sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> 
> Locks are great, everybody should have their own lock!
> 
> $ find . -name 8253pit.h
> ./arch/powerpc/include/asm/8253pit.h
> ./arch/alpha/include/asm/8253pit.h
> $ cat arch/*/include/asm/8253pit.h
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> $
> 
> Eh...
> 
> $ git grep -w PCSPKR_PLATFORM 
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> init/Kconfig:config PCSPKR_PLATFORM
> sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> HIGH_RES_TIMERS
> 
> So the status is:
> 
>  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> 		being installed no drivers will be built.  I don't know
> 		which Alpha platforms or even if all of Alpha should be
> 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> 		this.
>  ARM:		No PC speaker supported, yeah :)
>  PowerPC:	Should compile but the locking is wrong but only the 
>    		AmigaOne platforms should be affected.
The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
also apply to the AmigaOne. Can you resend it with a fix for the
AmigaOne, or should I send a patch?
I'll check next week, if the PC speaker is still working on my AmigaOne.

Thanks,
Gerhard

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
@ 2011-06-02 19:11   ` Gerhard Pircher
  2011-06-03 18:00   ` Ralf Baechle
  1 sibling, 0 replies; 39+ messages in thread
From: Gerhard Pircher @ 2011-06-02 19:11 UTC (permalink / raw)
  To: ralf, linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel


-------- Original-Nachricht --------
> Datum: Wed, 01 Jun 2011 19:04:56 +0100
> Von: ralf@linux-mips.org
> An: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org
> Betreff: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> No longer terribly relevant these days but still broken and just an
> eyesore mess of neglience just as I've already raised it a few days 
> ago.  Time to sort this.
> 
> drivers/input/misc/pcspkr.c:
> 
> #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
> 
> sound/drivers/pcsp/pcsp.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);
> 
> $ git grep -F pcsp.h sound/drivers/pcsp
> sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> $ git grep -w i8253_lock sound/drivers/pcsp/
> sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> flags
> sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_unlock_irqrestore(&i8253_lock, 
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> 
> Locks are great, everybody should have their own lock!
> 
> $ find . -name 8253pit.h
> ./arch/powerpc/include/asm/8253pit.h
> ./arch/alpha/include/asm/8253pit.h
> $ cat arch/*/include/asm/8253pit.h
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> /*
>  * 8253/8254 Programmable Interval Timer
>  */
> $
> 
> Eh...
> 
> $ git grep -w PCSPKR_PLATFORM 
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/mips/Kconfig:      select PCSPKR_PLATFORM
> arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> init/Kconfig:config PCSPKR_PLATFORM
> sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> HIGH_RES_TIMERS
> 
> So the status is:
> 
>  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> 		being installed no drivers will be built.  I don't know
> 		which Alpha platforms or even if all of Alpha should be
> 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> 		this.
>  ARM:		No PC speaker supported, yeah :)
>  PowerPC:	Should compile but the locking is wrong but only the 
>    		AmigaOne platforms should be affected.
The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
also apply to the AmigaOne. Can you resend it with a fix for the
AmigaOne, or should I send a patch?
I'll check next week, if the PC speaker is still working on my AmigaOne.

Thanks,
Gerhard

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
  2011-06-01 18:05   ` ralf
@ 2011-06-03  9:53   ` Takashi Iwai
  2011-06-03  9:53     ` [alsa-devel] " Takashi Iwai
  1 sibling, 1 reply; 39+ messages in thread
From: Takashi Iwai @ 2011-06-03  9:53 UTC (permalink / raw)
  To: ralf; +Cc: linux-arch, alsa-devel, linux-kernel

At Wed, 01 Jun 2011 19:05:03 +0100,
ralf@linux-mips.org wrote:
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
>  sound/drivers/pcsp/pcsp.h |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> Index: linux-mips/sound/drivers/pcsp/pcsp.h
> ===================================================================
> --- linux-mips.orig/sound/drivers/pcsp/pcsp.h
> +++ linux-mips/sound/drivers/pcsp/pcsp.h
> @@ -10,14 +10,8 @@
>  #define __PCSP_H__
>  
>  #include <linux/hrtimer.h>
> -#include <linux/timex.h>
> -#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> -/* Use the global PIT lock ! */
>  #include <linux/i8253.h>
> -#else
> -#include <asm/8253pit.h>
> -static DEFINE_RAW_SPINLOCK(i8253_lock);
> -#endif
> +#include <linux/timex.h>
>  
>  #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
>  #define PCSP_DEBUG 0
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [alsa-devel] [patch 07/14] i8253: Make pcsp sound driver use the shared i8253_lock.
  2011-06-03  9:53   ` Takashi Iwai
@ 2011-06-03  9:53     ` Takashi Iwai
  0 siblings, 0 replies; 39+ messages in thread
From: Takashi Iwai @ 2011-06-03  9:53 UTC (permalink / raw)
  To: ralf; +Cc: linux-kernel, linux-arch, alsa-devel

At Wed, 01 Jun 2011 19:05:03 +0100,
ralf@linux-mips.org wrote:
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org

Acked-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
>  sound/drivers/pcsp/pcsp.h |    8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> Index: linux-mips/sound/drivers/pcsp/pcsp.h
> ===================================================================
> --- linux-mips.orig/sound/drivers/pcsp/pcsp.h
> +++ linux-mips/sound/drivers/pcsp/pcsp.h
> @@ -10,14 +10,8 @@
>  #define __PCSP_H__
>  
>  #include <linux/hrtimer.h>
> -#include <linux/timex.h>
> -#if defined(CONFIG_MIPS) || defined(CONFIG_X86)
> -/* Use the global PIT lock ! */
>  #include <linux/i8253.h>
> -#else
> -#include <asm/8253pit.h>
> -static DEFINE_RAW_SPINLOCK(i8253_lock);
> -#endif
> +#include <linux/timex.h>
>  
>  #define PCSP_SOUND_VERSION 0x400	/* read 4.00 */
>  #define PCSP_DEBUG 0
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  2011-06-02 19:11   ` Gerhard Pircher
@ 2011-06-03 18:00   ` Ralf Baechle
  2011-06-03 18:00     ` Ralf Baechle
  2011-06-03 19:22     ` Gerhard Pircher
  1 sibling, 2 replies; 39+ messages in thread
From: Ralf Baechle @ 2011-06-03 18:00 UTC (permalink / raw)
  To: Gerhard Pircher
  Cc: linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel,
	Thomas Gleixner, Benjamin Herrenschmidt

On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:

> > #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
> > 
> > sound/drivers/pcsp/pcsp.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);
> > 
> > $ git grep -F pcsp.h sound/drivers/pcsp
> > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > $ git grep -w i8253_lock sound/drivers/pcsp/
> > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_input.c:       
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_lib.c:         
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > 
> > Locks are great, everybody should have their own lock!
> > 
> > $ find . -name 8253pit.h
> > ./arch/powerpc/include/asm/8253pit.h
> > ./arch/alpha/include/asm/8253pit.h
> > $ cat arch/*/include/asm/8253pit.h
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > $
> > 
> > Eh...
> > 
> > $ git grep -w PCSPKR_PLATFORM 
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > init/Kconfig:config PCSPKR_PLATFORM
> > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > HIGH_RES_TIMERS
> > 
> > So the status is:
> > 
> >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > 		being installed no drivers will be built.  I don't know
> > 		which Alpha platforms or even if all of Alpha should be
> > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > 		this.
> >  ARM:		No PC speaker supported, yeah :)
> >  PowerPC:	Should compile but the locking is wrong but only the 
> >    		AmigaOne platforms should be affected.
> The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> also apply to the AmigaOne. Can you resend it with a fix for the
> AmigaOne, or should I send a patch?

I can sort that; it's easy enough.

> I'll check next week, if the PC speaker is still working on my AmigaOne.

I can't imagine that it's going to break - the code is sorta simple ;-)

One obscurity I noticed is this bit in the amigaone.dts:

        timer@40 {
                // Also adds pcspkr to platform devices.
                compatible = "pnpPNP,100";
                reg = <1 0x00000040 0x00000020>;
        };

Shouldn't that rather be something like the following?

        pcspeaker@61 {
                device_type = "sound";
                compatible = "pnpPNP,800";
                reg = <1 0x61 1>;
        };

pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC speaker.
If you interpret pnpPNP,100 to imply the presence of a PC speaker you can't
express a system that has a i8253 but no PCspeaker in a DT so maybe
amigaone.dts and arch/powerpc/kernel/setup-common.c should be changed to
use pnpPNP,800 instead?

  Ralf

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-03 18:00   ` Ralf Baechle
@ 2011-06-03 18:00     ` Ralf Baechle
  2011-06-03 19:22     ` Gerhard Pircher
  1 sibling, 0 replies; 39+ messages in thread
From: Ralf Baechle @ 2011-06-03 18:00 UTC (permalink / raw)
  To: Gerhard Pircher
  Cc: linux-mips, linuxppc-dev, linux-alpha, linux-arch, linux-kernel,
	Thomas Gleixner, Benjamin Herrenschmidt

On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:

> > #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
> > 
> > sound/drivers/pcsp/pcsp.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);
> > 
> > $ git grep -F pcsp.h sound/drivers/pcsp
> > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > $ git grep -w i8253_lock sound/drivers/pcsp/
> > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > sound/drivers/pcsp/pcsp_input.c:        raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_input.c:       
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:          raw_spin_lock_irqsave(&i8253_lock,
> > flags
> > sound/drivers/pcsp/pcsp_lib.c:         
> > raw_spin_unlock_irqrestore(&i8253_lock, 
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > 
> > Locks are great, everybody should have their own lock!
> > 
> > $ find . -name 8253pit.h
> > ./arch/powerpc/include/asm/8253pit.h
> > ./arch/alpha/include/asm/8253pit.h
> > $ cat arch/*/include/asm/8253pit.h
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > /*
> >  * 8253/8254 Programmable Interval Timer
> >  */
> > $
> > 
> > Eh...
> > 
> > $ git grep -w PCSPKR_PLATFORM 
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > init/Kconfig:config PCSPKR_PLATFORM
> > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > HIGH_RES_TIMERS
> > 
> > So the status is:
> > 
> >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > 		being installed no drivers will be built.  I don't know
> > 		which Alpha platforms or even if all of Alpha should be
> > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > 		this.
> >  ARM:		No PC speaker supported, yeah :)
> >  PowerPC:	Should compile but the locking is wrong but only the 
> >    		AmigaOne platforms should be affected.
> The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> also apply to the AmigaOne. Can you resend it with a fix for the
> AmigaOne, or should I send a patch?

I can sort that; it's easy enough.

> I'll check next week, if the PC speaker is still working on my AmigaOne.

I can't imagine that it's going to break - the code is sorta simple ;-)

One obscurity I noticed is this bit in the amigaone.dts:

        timer@40 {
                // Also adds pcspkr to platform devices.
                compatible = "pnpPNP,100";
                reg = <1 0x00000040 0x00000020>;
        };

Shouldn't that rather be something like the following?

        pcspeaker@61 {
                device_type = "sound";
                compatible = "pnpPNP,800";
                reg = <1 0x61 1>;
        };

pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC speaker.
If you interpret pnpPNP,100 to imply the presence of a PC speaker you can't
express a system that has a i8253 but no PCspeaker in a DT so maybe
amigaone.dts and arch/powerpc/kernel/setup-common.c should be changed to
use pnpPNP,800 instead?

  Ralf

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers
  2011-06-03 18:00   ` Ralf Baechle
  2011-06-03 18:00     ` Ralf Baechle
@ 2011-06-03 19:22     ` Gerhard Pircher
  1 sibling, 0 replies; 39+ messages in thread
From: Gerhard Pircher @ 2011-06-03 19:22 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: benh, tglx, linux-kernel, linux-arch, linux-alpha, linuxppc-dev,
	linux-mips


-------- Original-Nachricht --------
> Datum: Fri, 3 Jun 2011 19:00:38 +0100
> Von: Ralf Baechle <ralf@linux-mips.org>
> An: Gerhard Pircher <gerhard_pircher@gmx.net>
> CC: linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>, Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Betreff: Re: [patch 00/14] Sort out i8253 and PC speaker locking and headers

> On Thu, Jun 02, 2011 at 09:11:19PM +0200, Gerhard Pircher wrote:
> 
> > > #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
> > > 
> > > sound/drivers/pcsp/pcsp.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);
> > > 
> > > $ git grep -F pcsp.h sound/drivers/pcsp
> > > sound/drivers/pcsp/pcsp.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_input.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_lib.c:#include "pcsp.h"
> > > sound/drivers/pcsp/pcsp_mixer.c:#include "pcsp.h"
> > > $ git grep -w i8253_lock sound/drivers/pcsp/
> > > sound/drivers/pcsp/pcsp.h:static DEFINE_RAW_SPINLOCK(i8253_lock);
> > > sound/drivers/pcsp/pcsp_input.c:       
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_input.c:       
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:         
> raw_spin_lock_irqsave(&i8253_lock,
> > > flags
> > > sound/drivers/pcsp/pcsp_lib.c:         
> > > raw_spin_unlock_irqrestore(&i8253_lock, 
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_lock(&i8253_lock);
> > > sound/drivers/pcsp/pcsp_lib.c:  raw_spin_unlock(&i8253_lock);
> > > 
> > > Locks are great, everybody should have their own lock!
> > > 
> > > $ find . -name 8253pit.h
> > > ./arch/powerpc/include/asm/8253pit.h
> > > ./arch/alpha/include/asm/8253pit.h
> > > $ cat arch/*/include/asm/8253pit.h
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > /*
> > >  * 8253/8254 Programmable Interval Timer
> > >  */
> > > $
> > > 
> > > Eh...
> > > 
> > > $ git grep -w PCSPKR_PLATFORM 
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/mips/Kconfig:      select PCSPKR_PLATFORM
> > > arch/powerpc/platforms/amigaone/Kconfig:        select PCSPKR_PLATFORM
> > > drivers/input/misc/Kconfig:     depends on PCSPKR_PLATFORM
> > > init/Kconfig:config PCSPKR_PLATFORM
> > > sound/drivers/Kconfig:  depends on PCSPKR_PLATFORM && X86 &&
> > > HIGH_RES_TIMERS
> > > 
> > > So the status is:
> > > 
> > >  Alpha:	There is no PCSPKR_PLATFORM so while a platform device is
> > > 		being installed no drivers will be built.  I don't know
> > > 		which Alpha platforms or even if all of Alpha should be
> > > 		doing a PCSPKR_PLATFORM so I haven't even tried to sort
> > > 		this.
> > >  ARM:		No PC speaker supported, yeah :)
> > >  PowerPC:	Should compile but the locking is wrong but only the 
> > >    		AmigaOne platforms should be affected.
> > The Kconfig dependencies cleanup patch for CHRP, PSERIES, etc. should
> > also apply to the AmigaOne. Can you resend it with a fix for the
> > AmigaOne, or should I send a patch?
> 
> I can sort that; it's easy enough.
Thanks a lot!

> > I'll check next week, if the PC speaker is still working on my
> > AmigaOne.
> 
> I can't imagine that it's going to break - the code is sorta simple ;-)
That's true, but testing the most recent Linux kernel on the AmigaOne is
never wrong. :-)

> One obscurity I noticed is this bit in the amigaone.dts:
> 
>         timer@40 {
>                 // Also adds pcspkr to platform devices.
>                 compatible = "pnpPNP,100";
>                 reg = <1 0x00000040 0x00000020>;
>         };
> 
> Shouldn't that rather be something like the following?
> 
>         pcspeaker@61 {
>                 device_type = "sound";
>                 compatible = "pnpPNP,800";
>                 reg = <1 0x61 1>;
>         };
> 
> pnpPNP,100 is the i8253 timer as I understand and pnpPNP,800 the PC
> speaker.
> If you interpret pnpPNP,100 to imply the presence of a PC speaker you
> can't express a system that has a i8253 but no PCspeaker in a DT so
> maybe amigaone.dts and arch/powerpc/kernel/setup-common.c should be
> changed to use pnpPNP,800 instead?

That would be cleaner, but I guess it would break CHRP and PSERIES.
These platforms probably only provide a pnpPNP,100 entry in the device
tree (at least that's the case on the Pegasos2 CHRP machine AFAICT).

Gerhard
-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
  2011-06-01 18:05   ` ralf
@ 2011-06-09  5:07   ` Benjamin Herrenschmidt
  2011-06-09  5:07     ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 39+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:07 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Paul Mackerras, linuxppc-dev

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-remove-unused-8253pit.h-files.patch)
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-alpha@vger.kernel.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> 
>  arch/alpha/include/asm/8253pit.h   |    3 ---
>  arch/powerpc/include/asm/8253pit.h |    3 ---
>  2 files changed, 6 deletions(-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Thanks !

Ben.

> Index: linux-mips/arch/alpha/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/alpha/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> Index: linux-mips/arch/powerpc/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> 



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header.
  2011-06-09  5:07   ` Benjamin Herrenschmidt
@ 2011-06-09  5:07     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 39+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:07 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha, Paul Mackerras, linuxppc-dev

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-remove-unused-8253pit.h-files.patch)
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: linux-alpha@vger.kernel.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> 
>  arch/alpha/include/asm/8253pit.h   |    3 ---
>  arch/powerpc/include/asm/8253pit.h |    3 ---
>  2 files changed, 6 deletions(-)

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Thanks !

Ben.

> Index: linux-mips/arch/alpha/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/alpha/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> Index: linux-mips/arch/powerpc/include/asm/8253pit.h
> ===================================================================
> --- linux-mips.orig/arch/powerpc/include/asm/8253pit.h
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -/*
> - * 8253/8254 Programmable Interval Timer
> - */
> 



^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
  2011-06-01 18:05   ` ralf
@ 2011-06-09  5:09   ` Benjamin Herrenschmidt
  2011-06-09  5:09     ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 39+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:09 UTC (permalink / raw)
  To: ralf
  Cc: linux-arch, linux-mips, linux-alpha, x86, linux-kernel,
	Ingo Molnar, Paul Mackerras, H. Peter Anvin, Ivan Kokshaysky,
	Matt Turner, linuxppc-dev, Thomas Gleixner, Richard Henderson

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-use-aux-symbol-for-pcspkr-config.patch)
> Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
> usually either wrong or too coarse grained.  Or plain an ugly sin.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [patch 13/14] PCSPKR: Cleanup Kconfig dependencies
  2011-06-09  5:09   ` Benjamin Herrenschmidt
@ 2011-06-09  5:09     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 39+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:09 UTC (permalink / raw)
  To: ralf
  Cc: linux-kernel, linux-arch, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, Paul Mackerras, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, linux-alpha, linux-mips, linuxppc-dev

On Wed, 2011-06-01 at 19:05 +0100, ralf@linux-mips.org wrote:
> plain text document attachment
> (i8253-use-aux-symbol-for-pcspkr-config.patch)
> Lenghty lists of the kind "depends on ARCH1 || ARCH2 ... || ARCH123" are
> usually either wrong or too coarse grained.  Or plain an ugly sin.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> To: linux-kernel@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Matt Turner <mattst88@gmail.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> Cc: linuxppc-dev@lists.ozlabs.org



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2011-06-09  5:27 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 18:04 [patch 00/14] Sort out i8253 and PC speaker locking and headers ralf
2011-06-01 18:04 ` ralf
2011-06-01 18:04 ` [patch 01/14] i8253: Create <linux/i8253.h> and make all in kernel users to use it ralf
2011-06-01 18:04   ` ralf
2011-06-01 18:04 ` [patch 02/14] i8253: Unify all kernel declarations of i8253_lock in <linux/i8253.h> ralf
2011-06-01 18:04   ` ralf
2011-06-01 18:04 ` [patch 03/14] i8253: Consolidate all kernel definitions of i8253_lock in lib/i8253-lock.c ralf
2011-06-01 18:05 ` [patch 04/14] i8253: Make MIPS use the shared i8253_lock ralf
2011-06-01 18:05 ` [patch 05/14] i8253: Make x86 " ralf
2011-06-01 18:05 ` [patch 06/14] i8253: Make pcspkr input driver " ralf
2011-06-01 18:05   ` ralf
2011-06-01 18:05 ` [patch 07/14] i8253: Make pcsp sound " ralf
2011-06-01 18:05   ` ralf
2011-06-03  9:53   ` Takashi Iwai
2011-06-03  9:53     ` [alsa-devel] " Takashi Iwai
2011-06-01 18:05 ` [patch 08/14] i8253: Alpha: Cleanup remaining users of i8253pit.h ralf
2011-06-01 18:05   ` ralf
2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
2011-06-01 18:05   ` ralf
2011-06-09  5:07   ` Benjamin Herrenschmidt
2011-06-09  5:07     ` Benjamin Herrenschmidt
2011-06-01 18:05 ` [patch 10/14] i8253: x86: Consolidate definitions of global_clock_event ralf
2011-06-01 18:05   ` ralf
2011-06-01 18:05 ` [patch 11/14] i8253: Consolidate definitions of PIT_LATCH ralf
2011-06-01 18:05   ` ralf
2011-06-01 18:05 ` [patch 12/14] i8253: Move remaining content and delete <asm/i8253.h> ralf
2011-06-01 18:05   ` ralf
2011-06-02 11:29   ` Sergei Shtylyov
2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
2011-06-01 18:05   ` ralf
2011-06-09  5:09   ` Benjamin Herrenschmidt
2011-06-09  5:09     ` Benjamin Herrenschmidt
2011-06-01 18:05 ` [patch 14/14] PCSPKR: MIPS: Make config dependencies finer grained ralf
2011-06-01 18:05   ` ralf
2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
2011-06-02 19:11   ` Gerhard Pircher
2011-06-03 18:00   ` Ralf Baechle
2011-06-03 18:00     ` Ralf Baechle
2011-06-03 19:22     ` Gerhard Pircher

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).