From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: spin_lock_irqwhat ? Date: Sun, 16 May 2004 17:00:32 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <20040513205751.6b61e53c.pochini@shiny.it> <20040515233747.2384072f.pochini@shiny.it> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20040515233747.2384072f.pochini@shiny.it> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Giuliano Pochini Cc: alsa-devel@lists.sourceforge.net, clemens@ladisch.de List-Id: alsa-devel@alsa-project.org At Sat, 15 May 2004 23:37:47 +0200, Giuliano Pochini wrote: > > 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(). no, all of these locks are specific to PCM. you still likely need another spinlock for protecting the h/w registers reading/writing. Takashi ------------------------------------------------------- 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