Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: alsa-devel@alsa-project.org, Jaroslav Kysela <perex@perex.cz>
Subject: Re: [PATCH 2/2] ALSA: emu10k1: track loss of external clock on E-MU cards
Date: Tue, 11 Jul 2023 13:14:29 +0200	[thread overview]
Message-ID: <87lefmwvhm.wl-tiwai@suse.de> (raw)
In-Reply-To: <ZK0q0prNuOz2Be6b@ugly>

On Tue, 11 Jul 2023 12:11:30 +0200,
Oswald Buddenhagen wrote:
> 
> On Tue, Jul 11, 2023 at 07:28:22AM +0200, Takashi Iwai wrote:
> > Again, snd_ctl_notify() itself doesn't need the rwsem lock at all.
> > 
> ah, you mean i could fully release it before the notification.
> 
> > It's snd_ctl_notify_one() that needs a more careful call pattern.
> > 
> i suppose that's because the snd_ctl_layer callbacks might require it.
> i would recommend actually documenting that.

Yes, but this helper itself needs more change at first, I'm afraid.
The current implementation with the nested rwsem is fragile.  It's a
new stuff (or new restriction), and it's to be revisited.

> > And, that ugly implementation is a thing to be improved in future in
> > ALSA core side.
> > 
> it is? like, really?

Yes.  See my earlier RFC patch for reducing the nested rwlock, for
example.  Jaroslav didn't like the implementation, so it needs more
respin, though.

Another idea could to be make the controls_rwsem back to read-only for
both get and put, but introduce another lock just wrapping around
get/put call (but conditionally - there are drivers that don't need
it).  This will avoid the rwsem deadlock problem.


Takashi

  reply	other threads:[~2023-07-11 11:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  6:59 [PATCH 1/2] ALSA: emu10k1: make E-MU dock monitoring interrupt-driven Oswald Buddenhagen
2023-07-10  6:59 ` [PATCH 2/2] ALSA: emu10k1: track loss of external clock on E-MU cards Oswald Buddenhagen
2023-07-10 15:05   ` Takashi Iwai
2023-07-10 17:34     ` Oswald Buddenhagen
2023-07-11  5:28       ` Takashi Iwai
2023-07-11 10:11         ` Oswald Buddenhagen
2023-07-11 11:14           ` Takashi Iwai [this message]
2023-07-10 14:57 ` [PATCH 1/2] ALSA: emu10k1: make E-MU dock monitoring interrupt-driven 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=87lefmwvhm.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=oswald.buddenhagen@gmx.de \
    --cc=perex@perex.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox