summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-06-12 17:26:17 +0200
committerTakashi Iwai <tiwai@suse.de>2011-06-12 18:49:42 +0200
commitc0da00145f9a32ef33b14508e6fd90fc130afbdc (patch)
treec244dc13b4560f6169ef10890ca1a738e243c1cb /sound
parent05e205429d3f73ad4f9f0d84e8a95e978237d6fd (diff)
downloadlinux-3.10-c0da00145f9a32ef33b14508e6fd90fc130afbdc.tar.gz
linux-3.10-c0da00145f9a32ef33b14508e6fd90fc130afbdc.tar.bz2
linux-3.10-c0da00145f9a32ef33b14508e6fd90fc130afbdc.zip
ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
For the MIDI part, we need to acquire (and release) the hmidi->lock, access to the global hdspm structure is serialized through hmidi->hdspm->lock instead. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/rme9652/hdspm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 949691a876d..32d80af012c 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1639,12 +1639,14 @@ static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi)
}
}
hmidi->pending = 0;
+ spin_unlock_irqrestore(&hmidi->lock, flags);
+ spin_lock_irqsave(&hmidi->hdspm->lock, flags);
hmidi->hdspm->control_register |= hmidi->ie;
hdspm_write(hmidi->hdspm, HDSPM_controlRegister,
hmidi->hdspm->control_register);
+ spin_unlock_irqrestore(&hmidi->hdspm->lock, flags);
- spin_unlock_irqrestore (&hmidi->lock, flags);
return snd_hdspm_midi_output_write (hmidi);
}