* [PATCH] Use i8253.c lock for PC speaker on MIPS, too. [not found] <20071102161650.GA28459@linux-mips.org> @ 2007-11-02 17:26 ` Ralf Baechle 2007-11-03 2:46 ` Linus Torvalds 0 siblings, 1 reply; 3+ messages in thread From: Ralf Baechle @ 2007-11-02 17:26 UTC (permalink / raw) To: Linus Torvalds, Andrew Morton; +Cc: Thomas Bogendoerfer, linux-kernel The Jazz machines have to use the PIT timer for dyntick and highresolution kernels. This may break because currently just like i386 used to do MIPS uses two separate spinlocks in the actual PIT code and the PC speaker code. So switch to do it the same that x86 currently does PIT locking. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> --- Linus, this patch is meant to be applied on top of the pull request I mailed you earlier today. arch/mips/kernel/i8253.c | 2 +- drivers/input/misc/pcspkr.c | 2 +- include/asm-mips/i8253.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index a925abd..c2d497c 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c @@ -14,7 +14,7 @@ #include <asm/io.h> #include <asm/time.h> -static DEFINE_SPINLOCK(i8253_lock); +DEFINE_SPINLOCK(i8253_lock); /* * Initialize the PIT timer. diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 4941a9e..43aaa5c 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c @@ -24,7 +24,7 @@ MODULE_DESCRIPTION("PC Speaker beeper driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:pcspkr"); -#ifdef CONFIG_X86 +#if defined(CONFIG_MIPS) || defined(CONFIG_X86) /* Use the global PIT lock ! */ #include <asm/i8253.h> #else diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h index 778b2f0..032ca73 100644 --- a/include/asm-mips/i8253.h +++ b/include/asm-mips/i8253.h @@ -5,11 +5,15 @@ #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 +extern spinlock_t i8253_lock; + extern void setup_pit_timer(void); #endif /* __ASM_I8253_H */ ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Use i8253.c lock for PC speaker on MIPS, too. 2007-11-02 17:26 ` [PATCH] Use i8253.c lock for PC speaker on MIPS, too Ralf Baechle @ 2007-11-03 2:46 ` Linus Torvalds 2007-11-03 3:39 ` Paul Mackerras 0 siblings, 1 reply; 3+ messages in thread From: Linus Torvalds @ 2007-11-03 2:46 UTC (permalink / raw) To: Ralf Baechle Cc: Andrew Morton, Thomas Bogendoerfer, Linux Kernel Mailing List, Jay Estabrook, Ivan Kokshaysky, Paul Mackerras On Fri, 2 Nov 2007, Ralf Baechle wrote: > > The Jazz machines have to use the PIT timer for dyntick and highresolution > kernels. This may break because currently just like i386 used to do MIPS > uses two separate spinlocks in the actual PIT code and the PC speaker > code. So switch to do it the same that x86 currently does PIT locking. Hmm. That leaves apparently just alpha/ppc/powerpc as supporting pcspkr, and *not* doing this. Maybe they should be forced to do the i8253 lock in arch code too, and expose it through <asm/i8253.h>, instead of having that butt-ugly #ifdef remain in the sources? Paul, Jay, Ivan: right now drivers/input/pcspkr.c does this: #if defined(CONFIG_MIPS) || defined(CONFIG_X86) /* Use the global PIT lock ! */ #include <asm/i8253.h> #else #include <asm/8253pit.h> static DEFINE_SPINLOCK(i8253_lock); #endif and wouldn't it be nice if we just changed it to #include <asm/i8253.h> and got rid of one totally unnecessary stupid arch difference? Linus ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Use i8253.c lock for PC speaker on MIPS, too. 2007-11-03 2:46 ` Linus Torvalds @ 2007-11-03 3:39 ` Paul Mackerras 0 siblings, 0 replies; 3+ messages in thread From: Paul Mackerras @ 2007-11-03 3:39 UTC (permalink / raw) To: Linus Torvalds Cc: Ralf Baechle, Andrew Morton, Thomas Bogendoerfer, Linux Kernel Mailing List, Jay Estabrook, Ivan Kokshaysky Linus Torvalds writes: > and wouldn't it be nice if we just changed it to > > #include <asm/i8253.h> > > and got rid of one totally unnecessary stupid arch difference? Looks fine to me. I'll do a patch for powerpc & ppc. Paul. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-03 3:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20071102161650.GA28459@linux-mips.org>
2007-11-02 17:26 ` [PATCH] Use i8253.c lock for PC speaker on MIPS, too Ralf Baechle
2007-11-03 2:46 ` Linus Torvalds
2007-11-03 3:39 ` Paul Mackerras
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox