Skip to content

Commit 8009d50

Browse files
bwh-cttiwai
authored andcommitted
ALSA: seq: Enable 'use' locking in all configurations
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. Cc: [email protected] Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 9bb201a commit 8009d50

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

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
{
@@ -41,5 +39,3 @@ void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
4139
}
4240
}
4341
EXPORT_SYMBOL(snd_use_lock_sync_helper);
44-
45-
#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)