From: Giuliano Pochini Subject: Re: spin_lock_irqwhat ? Date: Sat, 15 May 2004 23:37:47 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <20040515233747.2384072f.pochini@shiny.it> References: <20040513205751.6b61e53c.pochini@shiny.it> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Takashi Iwai Cc: alsa-devel@lists.sourceforge.net, clemens@ladisch.de List-Id: alsa-devel@alsa-project.org On Fri, 14 May 2004 12:37:46 +0200 Takashi Iwai wrote: > > > prepare and trigger callbacks are already in irq-disabled. > > > i.e. you need only spin_lock() in them. > > > > Does it mean that ALSA acquires the lock only when it calls PCM callbacks, > > that is trigger(), etc., are atomic only wrt other PCM functions ? > > sorry i don't understand your question. > > the prepare and the trigger callbacks acquire several locks. > first, the global rw_lock for the pcm linking (snd_pcm_link_rwlock), > the group lock the substream belongs to, and the lock for the > substream itself. and the first lock/unlock is done with *_irq(). Ok, are those locks acquired also before calling any other interface callback (control, midi...) ? If so, it shouldn't be necessary protecting with a spin_lock() the code which touches the hw inside prepare(). -- Giuliano. ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click