rpms/kernel/F-7 linux-2.6-pcspkr-use-the-global-pit-lock.patch, NONE, 1.1 kernel-2.6.spec, 1.3278, 1.3279

Dave Jones (davej) fedora-extras-commits at redhat.com
Thu Jul 12 22:39:16 UTC 2007


Author: davej

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12568

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-pcspkr-use-the-global-pit-lock.patch 
Log Message:
* Thu Jul 12 2007 Dave Jones <davej at redhat.com>
- Replace the pcspkr private PIT lock by the global PIT lock to
  serialize the PIT access all over the place.


linux-2.6-pcspkr-use-the-global-pit-lock.patch:

--- NEW FILE linux-2.6-pcspkr-use-the-global-pit-lock.patch ---
From: Thomas Gleixner <tglx at linutronix.de>

Replace the pcspkr private PIT lock by the global PIT lock to serialize the
PIT access all over the place.

Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Cc: Ingo Molnar <mingo at elte.hu>
Cc: Dmitry Torokhov <dtor at mail.ru>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
---

 arch/x86_64/kernel/time.c   |    2 ++
 drivers/input/misc/pcspkr.c |   11 ++++++++---
 include/asm-x86_64/i8253.h  |    6 ++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff -urpN --exclude-from=/home/davej/.exclude linux-2.6.22.noarch/arch/x86_64/kernel/time.c 1/arch/x86_64/kernel/time.c
--- linux-2.6.22.noarch/arch/x86_64/kernel/time.c	2007-07-08 19:32:17.000000000 -0400
+++ 1/arch/x86_64/kernel/time.c	2007-07-12 18:36:25.000000000 -0400
@@ -33,6 +33,7 @@
 #include <acpi/acpi_bus.h>
 #endif
 #include <asm/8253pit.h>
+#include <asm/i8253.h>
 #include <asm/pgtable.h>
 #include <asm/vsyscall.h>
 #include <asm/timex.h>
@@ -50,6 +51,7 @@ static char *timename = NULL;
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 DEFINE_SPINLOCK(i8253_lock);
+EXPORT_SYMBOL(i8253_lock);
 
 volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
 
diff -urpN --exclude-from=/home/davej/.exclude linux-2.6.22.noarch/drivers/input/misc/pcspkr.c 1/drivers/input/misc/pcspkr.c
--- linux-2.6.22.noarch/drivers/input/misc/pcspkr.c	2007-07-08 19:32:17.000000000 -0400
+++ 1/drivers/input/misc/pcspkr.c	2007-07-12 18:36:25.000000000 -0400
@@ -24,7 +24,12 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech at u
 MODULE_DESCRIPTION("PC Speaker beeper driver");
 MODULE_LICENSE("GPL");
 
-static DEFINE_SPINLOCK(i8253_beep_lock);
+#ifdef CONFIG_X86
+/* Use the global PIT lock ! */
+#include <asm/i8253.h>
+#else
+static DEFINE_SPINLOCK(i8253_lock);
+#endif
 
 static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
@@ -43,7 +48,7 @@ static int pcspkr_event(struct input_dev
 	if (value > 20 && value < 32767)
 		count = PIT_TICK_RATE / value;
 
-	spin_lock_irqsave(&i8253_beep_lock, flags);
+	spin_lock_irqsave(&i8253_lock, flags);
 
 	if (count) {
 		/* enable counter 2 */
@@ -58,7 +63,7 @@ static int pcspkr_event(struct input_dev
 		outb(inb_p(0x61) & 0xFC, 0x61);
 	}
 
-	spin_unlock_irqrestore(&i8253_beep_lock, flags);
+	spin_unlock_irqrestore(&i8253_lock, flags);
 
 	return 0;
 }
diff -urpN --exclude-from=/home/davej/.exclude linux-2.6.22.noarch/include/asm-x86_64/i8253.h 1/include/asm-x86_64/i8253.h
--- linux-2.6.22.noarch/include/asm-x86_64/i8253.h	1969-12-31 19:00:00.000000000 -0500
+++ 1/include/asm-x86_64/i8253.h	2007-07-12 18:36:25.000000000 -0400
@@ -0,0 +1,6 @@
+#ifndef __ASM_I8253_H__
+#define __ASM_I8253_H__
+
+extern spinlock_t i8253_lock;
+
+#endif	/* __ASM_I8253_H__ */


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3278
retrieving revision 1.3279
diff -u -r1.3278 -r1.3279
--- kernel-2.6.spec	12 Jul 2007 21:31:10 -0000	1.3278
+++ kernel-2.6.spec	12 Jul 2007 22:38:44 -0000	1.3279
@@ -592,6 +592,7 @@
 Patch1360: linux-2.6-ps3-sound.patch
 Patch1361: linux-2.6-ps3-device-init.patch
 Patch1362: linux-2.6-ps3-system-bus-rework-2.patch
+Patch1400: linux-2.6-pcspkr-use-the-global-pit-lock.patch
 
 %endif
 
@@ -1242,6 +1243,8 @@
 ApplyPatch linux-2.6-ps3-device-init.patch
 ApplyPatch linux-2.6-ps3-system-bus-rework-2.patch
 
+ApplyPatch linux-2.6-pcspkr-use-the-global-pit-lock.patch
+
 # END OF PATCH APPLICATIONS
 
 # Any further pre-build tree manipulations happen here.
@@ -2164,6 +2167,10 @@
 
 %changelog
 * Thu Jul 12 2007 Dave Jones <davej at redhat.com>
+- Replace the pcspkr private PIT lock by the global PIT lock to
+  serialize the PIT access all over the place.
+
+* Thu Jul 12 2007 Dave Jones <davej at redhat.com>
 - Add back the rediffed PS3 patches.
 
 * Thu Jul 12 2007 Chuck Ebbert <cebbert at redhat.com>




More information about the fedora-extras-commits mailing list