All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Giuliano Pochini <pochini@shiny.it>
Cc: alsa-devel@lists.sourceforge.net, clemens@ladisch.de
Subject: Re: spin_lock_irqwhat ?
Date: Sun, 16 May 2004 17:00:32 +0200	[thread overview]
Message-ID: <s5had08l8mn.wl@alsa2.suse.de> (raw)
In-Reply-To: <20040515233747.2384072f.pochini@shiny.it>

At Sat, 15 May 2004 23:37:47 +0200,
Giuliano Pochini wrote:
> 
> On Fri, 14 May 2004 12:37:46 +0200
> Takashi Iwai <tiwai@suse.de> 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

      reply	other threads:[~2004-05-16 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-08 11:36 spin_lock_irqwhat ? Giuliano Pochini
2004-05-10  8:31 ` Clemens Ladisch
2004-05-10  9:25   ` Takashi Iwai
2004-05-10 14:51     ` Giuliano Pochini
2004-05-10 15:08       ` Takashi Iwai
2004-05-13  7:31         ` Giuliano Pochini
2004-05-13 18:57         ` Giuliano Pochini
2004-05-14 10:37           ` Takashi Iwai
2004-05-15 21:37             ` Giuliano Pochini
2004-05-16 15:00               ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5had08l8mn.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=clemens@ladisch.de \
    --cc=pochini@shiny.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.