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 3/3] ALSA: emu10k1: (re-)add mixer locking
Date: Thu, 13 Jul 2023 10:33:26 +0200	[thread overview]
Message-ID: <87jzv4fbxl.wl-tiwai@suse.de> (raw)
In-Reply-To: <20230712145750.125086-3-oswald.buddenhagen@gmx.de>

On Wed, 12 Jul 2023 16:57:50 +0200,
Oswald Buddenhagen wrote:
> 
> Takashi now "prefers" that the drivers do not rely on the core's locking
> of card->controls_rwsem, so we undo 06405d8ee8 ("ALSA: emu10k1: remove
> now superfluous mixer locking") and add more locks that were already
> missing.
> 
> This adds some rather significant critical sections with IRQs disabled,
> as emu->reg_lock is also accessed by the PCM trigger callbacks, which
> are called with the hardirq-safe (self-)group lock held.
> 
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> 
> ---
> the long irq-disabled sections could be avoided by introducing a
> separate control mutex. i surveyed a few drivers, and the precedents
> are very mixed, so i'm not sure this would be considered worth it.
> 
> ---
> of the few drivers i checked, pcsp, ak4xxx-adda, pt2258, hal2,
> sgio2audio, au88x0_eq, and ca0106_mixer appear to be missing locking
> upon superficial inspection, a percentage well into the double digits.
> 
> given that there are ~3700 hits for snd_kcontrol_new (and many more
> _put() methods to check, due to initializer arrays), the whole endeavor
> seems just as utterly hopeless to me as i expected.
> 
> so i recommend that you reconsider, and consequently reject this patch.

I applied this patch now.  We may optimize out the whole locking
conditionally for the known-good drivers, instead of relying on a
(hackish) big iron lock that wasn't considered to be used originally
at all.


thanks,

Takashi

  reply	other threads:[~2023-07-13  8:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 14:57 [PATCH 1/3] ALSA: emu10k1: fix return value of snd_emu1010_adc_pads_put() Oswald Buddenhagen
2023-07-12 14:57 ` [PATCH 2/3] ALSA: emu10k1: remove superfluous IRQ enable state saving Oswald Buddenhagen
2023-07-13  5:55   ` Takashi Iwai
2023-07-13  8:15     ` Oswald Buddenhagen
2023-07-13  8:27       ` Takashi Iwai
2023-07-13  8:30   ` Takashi Iwai
2023-07-12 14:57 ` [PATCH 3/3] ALSA: emu10k1: (re-)add mixer locking Oswald Buddenhagen
2023-07-13  8:33   ` Takashi Iwai [this message]
2023-07-13  9:07     ` Oswald Buddenhagen
2023-07-13  9:21       ` Takashi Iwai
2023-07-13 10:01         ` Oswald Buddenhagen
2023-07-13 10:24           ` Takashi Iwai
2023-07-13 10:54             ` Oswald Buddenhagen
2023-07-13 11:56               ` Takashi Iwai
2023-07-13  5:58 ` [PATCH 1/3] ALSA: emu10k1: fix return value of snd_emu1010_adc_pads_put() 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=87jzv4fbxl.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