From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: Why use spin_lock or spin_lock_irq in trigger callback (audio capture)? Date: Fri, 26 Feb 2010 10:05:43 +0100 Message-ID: <4B878EE7.2010200@ladisch.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by alsa0.perex.cz (Postfix) with ESMTP id CFEA1243F8 for ; Fri, 26 Feb 2010 10:05:45 +0100 (CET) In-Reply-To: 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: Yiliang Bao Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Yiliang Bao wrote: > I looked at some PCI audio capture driver like BT878 (sound/pci/bt87x.c) or > SAA7134 (drivers/media/video/saa7134-alsa.c), I found that spin_lock instead > of spin_lock_irq (or spin_lock_irqsave) is used in trigger function. Is > there any reason for that? Yes, the trigger callback is called with interrupts already disabled. http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/ch05s08.html Regards, Clemens