Skip to content

ALSA: Make control API taking controls_rwsem consistently

Takashi Iwai alsa-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11ALSA: control: Take card->controls_rwsem in snd_ctl_rename()sound/core/control.c+3 -10 replies
2/11staging: greybus: audio_helper: Use snd_ctl_remove_id()drivers/staging/greybus/audio_helper.c+4 -161 reply
3/11ASoC: atmel: mchp-pdmc: Use snd_ctl_remove_id()sound/soc/atmel/mchp-pdmc.c+2 -102 replies
4/11ALSA: control: Take controls_rwsem lock in snd_ctl_remove()sound/core/control.c sound/core/jack.c sound/core/pcm.c +5 more+21 -210 replies
5/11ALSA: control: Add lockdep warning to internal functionssound/core/control.c+10 -00 replies
6/11ASoC: sigmadsp: Simplify with snd_ctl_activate_id()sound/soc/codecs/sigmadsp.c+4 -211 reply
7/11staging: greybus: Avoid abusing controls_rwsemdrivers/staging/greybus/audio_codec.c drivers/staging/greybus/audio_codec.h+8 -111 reply
8/11ALSA: control: Make snd_ctl_find_id() argument constinclude/sound/control.h sound/core/control.c+2 -20 replies
9/11ALSA: control: Introduce unlocked version for snd_ctl_find_*() helpersinclude/sound/control.h sound/core/control.c sound/core/control_compat.c +3 more+61 -280 replies
10/11ALSA: control: Take lock in snd_ctl_find_id() and snd_ctl_find_numid()sound/core/control.c+18 -22 replies
11/11ALSA: emu10k1: Go back and simplify with snd_ctl_find_id()sound/pci/emu10k1/emufx.c+1 -40 replies

Reviews trailers per patch

4 of 11 patches have a Reviewed-by or Acked-by.

PatchClaudiu BezneaMark BrownGreg Kroah-Hartman
1/11
2/11A-b
3/11R-b A-b
4/11
5/11
6/11A-b
7/11A-b
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/11] ALSA: Make control API taking controls_rwsem consistently

A few ALSA control API helpers like snd_ctl_rename(), snd_ctl_remove() and snd_ctl_find_*() suppose the callers taking card->controls_rwsem. But it's error-prone and fragile. This patch set tries to change those API functions to take the card->controls>rwsem internally by themselves, so that the drivers don't need to take care of lockings.

After applying this patch set, only a couple of places still touch card->controls_rwsem (which are OK-ish as they need for traversing the control linked list).

Takashi

===

Takashi Iwai (11):
ALSA: control: Take card->controls_rwsem in snd_ctl_rename()
staging: greybus: audio_helper: Use snd_ctl_remove_id()
ASoC: atmel: mchp-pdmc: Use snd_ctl_remove_id()
ALSA: control: Take controls_rwsem lock in snd_ctl_remove()
ALSA: control: Add lockdep warning to internal functions
ASoC: sigmadsp: Simplify with snd_ctl_activate_id()
staging: greybus: Avoid abusing controls_rwsem
ALSA: control: Make snd_ctl_find_id() argument const
ALSA: control: Introduce unlocked version for snd_ctl_find_*() helpers
ALSA: control: Take lock in snd_ctl_find_id() and snd_ctl_find_numid()
ALSA: emu10k1: Go back and simplify with snd_ctl_find_id()

 drivers/staging/greybus/audio_codec.c  |  18 ++--
 drivers/staging/greybus/audio_codec.h  |   1 +
 drivers/staging/greybus/audio_helper.c |  20 +---
 include/sound/control.h                |   6 +-
 sound/core/control.c                   | 126 ++++++++++++++++++++-----
 sound/core/control_compat.c            |   2 +-
 sound/core/control_led.c               |   2 +-
 sound/core/jack.c                      |   2 -
 sound/core/oss/mixer_oss.c             |  10 +-
 sound/core/pcm.c                       |   2 -
 sound/isa/sb/emu8000.c                 |   2 -
 sound/isa/sb/sb16_csp.c                |   2 -
 sound/pci/emu10k1/emufx.c              |   5 -
 sound/pci/hda/hda_codec.c              |   2 -
 sound/soc/atmel/mchp-pdmc.c            |  12 +--
 sound/soc/codecs/sigmadsp.c            |  25 +----
 sound/soc/soc-topology.c               |   3 -
 17 files changed, 129 insertions(+), 111 deletions(-)
Signature · 1 line
2.35.3