linuxppc-dev.lists.ozlabs.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:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ 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] 8+ 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
@ 2011-06-01 18:05 ` ralf
  2011-06-09  5:07   ` Benjamin Herrenschmidt
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  2 siblings, 1 reply; 8+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Ivan Kokshaysky, linux-alpha, Paul Mackerras, Matt Turner,
	linuxppc-dev, Richard Henderson

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] 8+ 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
  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:09   ` Benjamin Herrenschmidt
  2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
  2 siblings, 1 reply; 8+ messages in thread
From: ralf @ 2011-06-01 18:05 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: linux-mips, linux-alpha, x86, Ingo Molnar, Ivan Kokshaysky,
	H. Peter Anvin, Paul Mackerras, Matt Turner, linuxppc-dev,
	Thomas Gleixner, Richard Henderson

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] 8+ 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
  2011-06-01 18:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
  2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
@ 2011-06-02 19:11 ` Gerhard Pircher
  2011-06-03 18:00   ` Ralf Baechle
  2 siblings, 1 reply; 8+ 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] 8+ 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-03 18:00   ` Ralf Baechle
  2011-06-03 19:22     ` Gerhard Pircher
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Baechle @ 2011-06-03 18:00 UTC (permalink / raw)
  To: Gerhard Pircher
  Cc: linux-arch, linux-mips, linux-kernel, linux-alpha,
	Thomas Gleixner, linuxppc-dev

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] 8+ 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 19:22     ` Gerhard Pircher
  0 siblings, 0 replies; 8+ messages in thread
From: Gerhard Pircher @ 2011-06-03 19:22 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-arch, linux-mips, linux-kernel, linux-alpha, tglx, linuxppc-dev


-------- 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] 8+ 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-09  5:07   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-09  5:07 UTC (permalink / raw)
  To: ralf
  Cc: linux-arch, linux-kernel, Ivan Kokshaysky, linux-alpha,
	Paul Mackerras, Matt Turner, linuxppc-dev, Richard Henderson

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] 8+ 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-09  5:09   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 8+ 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] 8+ messages in thread

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

Thread overview: 8+ 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:05 ` [patch 09/14] i8253: Alpha, PowerPC: Remove unused <asm/8253pit.h> header ralf
2011-06-09  5:07   ` Benjamin Herrenschmidt
2011-06-01 18:05 ` [patch 13/14] PCSPKR: Cleanup Kconfig dependencies ralf
2011-06-09  5:09   ` Benjamin Herrenschmidt
2011-06-02 19:11 ` [patch 00/14] Sort out i8253 and PC speaker locking and headers Gerhard Pircher
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).