All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: snd_pcsp locking mess
Date: Sun, 18 May 2008 22:20:43 +0400	[thread overview]
Message-ID: <4830737B.70108@aknet.ru> (raw)
In-Reply-To: <20080518172258.D0DFB108060@picon.linux-foundation.org>

bugme-daemon@bugzilla.kernel.org wrote:
> ------- Comment #17 from tiwai@suse.de  2008-05-18 10:22 -------
> Anyway, what I meant is that the part touching I/O ports could be a faster path
> than softirq.  And the hrtimer code can use a bit simpler locks.  The hrtimer
> callback needs just one thing about DMA buffer - the buffer is allocated and
> the address doesn't change during the callback.  So, we'd need the lock for the
> hr callback and for the PCM prepare, hwparams and free callbacks, i.e. to
> assure that the hrtimer callback is finished when these PCM callbacks may
> change the DMA buffer.  Thus this lock doesn't have to be PCM substream lock.
I wonder if it would be better to introduce
such a lock in an alsa core rather than in a
driver. The same way as snd_pcm_stream_lock().

> The current lock mess may come from the PCM trigger (STOP) called from
> snd_pcm_period_elapsed().  So, putting snd_pcm_period_elapsed() out of hrtimer
> lock is anyway necessary.  A tasklet for snd_pcm_period_elapsed() is needed for
> this reason, too.
Wouldn't it be better to just make
snd_pcm_period_elapsed() to not take
the stream lock? There is a requirement
right now to drop the stream lock before
calling this. I still beleive this is
the root of all the headache. If you
need to drop it, then you either accept
the race or need a second lock, and the
troubles ensue.

       reply	other threads:[~2008-05-18 18:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080518172258.D0DFB108060@picon.linux-foundation.org>
2008-05-18 18:20 ` Stas Sergeev [this message]
2008-05-19  5:50   ` snd_pcsp locking mess Takashi Iwai
2008-05-19 17:01     ` Stas Sergeev
2008-05-21 12:33       ` Takashi Iwai
2008-05-22 20:28         ` Stas Sergeev
2008-05-23 10:51           ` Takashi Iwai
2008-05-27 13:46             ` Stas Sergeev
2008-05-27 13:47             ` Stas Sergeev
2008-05-27 15:50               ` Takashi Iwai
2008-05-27 17:40                 ` Stas Sergeev
2008-05-28 10:13                   ` Takashi Iwai
2008-05-28 20:08                     ` Stas Sergeev
2008-05-29  6:03                       ` Takashi Iwai
2008-05-29 17:07                         ` Stas Sergeev
2008-06-02  9:36                           ` Takashi Iwai
2008-08-21  8:06                 ` Stas Sergeev
2008-08-21  9:06                   ` Takashi Iwai
2008-08-21 10:25                     ` Stas Sergeev
2008-10-20 13:05                       ` Takashi Iwai
2008-10-20 21:51                         ` Stas Sergeev
2008-10-21  6:27                           ` Takashi Iwai
2008-10-21  7:08                             ` Stas Sergeev
2008-10-21  7:16                               ` Takashi Iwai

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=4830737B.70108@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /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.