Skip to content

ALSA: hdsp, hdspm: Fix unlocked control_register updates in MIDI paths

Yifei Gao linux-sound lkml 1 version Applied

Status from this message: Applied both patches to for-next branch now. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2ALSA: hdsp: Serialize control_register updates in MIDI input pathssound/pci/rme9652/hdsp.c+12 -40 replies
2/2ALSA: hdspm: Take hdspm->lock when masking MIDI interrupts in IRQ handlersound/pci/rme9652/hdspm.c+5 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] ALSA: hdsp, hdspm: Fix unlocked control_register updates in MIDI paths

hdsp and hdspm keep a software copy of the card's control register and update it read-modify-write under the card lock, except in some MIDI input paths, where concurrent updates can be lost.

In 2011, commit c0da00145f9a ("ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read") fixed the MIDI work side in hdspm. The interrupt handler side was left unlocked, and hdsp has both problems. Patch 1 fixes hdsp. Patch 2 fixes the remaining interrupt handler side in hdspm.

Both issues were found by static analysis. The patches are compile-tested only (W=1). I have no access to this hardware, so tests on a real card would be very welcome.

Yifei Gao (2):
ALSA: hdsp: Serialize control_register updates in MIDI input paths
ALSA: hdspm: Take hdspm->lock when masking MIDI interrupts in IRQ
handler

 sound/pci/rme9652/hdsp.c  | 16 ++++++++++++----
 sound/pci/rme9652/hdspm.c |  8 +++++---
 2 files changed, 17 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1