Skip to content

Commit f9e9371

Browse files
bwh-ctgregkh
authored andcommitted
ALSA: seq: Enable 'use' locking in all configurations
commit 8009d506a1dd00cf436b0c4cca0dcec130580a21 upstream. The 'use' locking macros are no-ops if neither SMP or SND_DEBUG is enabled. This might once have been OK in non-preemptible configurations, but even in that case snd_seq_read() may sleep while relying on a 'use' lock. So always use the proper implementations. Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4516069 commit f9e9371

2 files changed

Lines changed: 0 additions & 16 deletions

File tree

sound/core/seq/seq_lock.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include <sound/core.h>
2424
#include "seq_lock.h"
2525

26-
#if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
27-
2826
/* wait until all locks are released */
2927
void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
3028
{
@@ -42,5 +40,3 @@ void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
4240
}
4341

4442
EXPORT_SYMBOL(snd_use_lock_sync_helper);
45-
46-
#endif

sound/core/seq/seq_lock.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
#include <linux/sched.h>
55

6-
#if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
7-
86
typedef atomic_t snd_use_lock_t;
97

108
/* initialize lock */
@@ -20,14 +18,4 @@ typedef atomic_t snd_use_lock_t;
2018
void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line);
2119
#define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
2220

23-
#else /* SMP || CONFIG_SND_DEBUG */
24-
25-
typedef spinlock_t snd_use_lock_t; /* dummy */
26-
#define snd_use_lock_init(lockp) /**/
27-
#define snd_use_lock_use(lockp) /**/
28-
#define snd_use_lock_free(lockp) /**/
29-
#define snd_use_lock_sync(lockp) /**/
30-
31-
#endif /* SMP || CONFIG_SND_DEBUG */
32-
3321
#endif /* __SND_SEQ_LOCK_H */

0 commit comments

Comments
 (0)