From: Takashi Iwai Subject: Re: i8253 locking and PC speaker on non-{mips,x86} Date: Sat, 28 May 2011 16:21:39 +0200 Message-ID: References: <20110528112120.GA9027@linux-mips.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 6FD361037E3 for ; Sat, 28 May 2011 16:21:46 +0200 (CEST) In-Reply-To: <20110528112120.GA9027@linux-mips.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Ralf Baechle Cc: linux-arch@linux-mips.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sat, 28 May 2011 12:21:20 +0100, Ralf Baechle wrote: > > No longer terribly relevant these days but ... > > drivers/input/misc/pcspkr.c: > > #if defined(CONFIG_MIPS) || defined(CONFIG_X86) > /* Use the global PIT lock ! */ > #include > #else > #include > 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 > #else > #include > 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! Yeah, if they were actually built. But snd-pcsp driver is built only for x86: config SND_PCSP tristate "PC-Speaker support (READ HELP!)" depends on PCSPKR_PLATFORM && X86 && HIGH_RES_TIMERS depends on INPUT depends on EXPERIMENTAL So, the current code in sound/drivers/pcsp/pcsp.h is harmless, but just confusing because of copy-and-paste from drivers/input/misc/pcspkr.c. The part for non-x86 should be removed or commented better. thanks, Takashi