summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-02-22 21:10:12 -0500
committerDave Airlie <airlied@redhat.com>2017-02-22 21:10:12 -0500
commit94000cc32988a0674923309d35ab9c2405c4b39b (patch)
treeef9d58ea9ad614bfdf6d0c7c6293f05dbd989475 /sound
parenta5eb76d9c892b8bd7d3505f8897cf126a54860bd (diff)
parent7089db84e356562f8ba737c29e472cc42d530dbc (diff)
Merge tag 'v4.10-rc8' into drm-next
Linux 4.10-rc8 Backmerge Linus rc8 to fix some conflicts, but also to avoid pulling it in via a fixes pull from someone.
Diffstat (limited to 'sound')
-rw-r--r--sound/core/seq/seq_memory.c9
-rw-r--r--sound/core/seq/seq_queue.c33
-rw-r--r--sound/pci/hda/patch_hdmi.c1
-rw-r--r--sound/usb/line6/driver.c3
4 files changed, 24 insertions, 22 deletions
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c
index c850345c43b5..dfa5156f3585 100644
--- a/sound/core/seq/seq_memory.c
+++ b/sound/core/seq/seq_memory.c
@@ -419,7 +419,6 @@ int snd_seq_pool_done(struct snd_seq_pool *pool)
419{ 419{
420 unsigned long flags; 420 unsigned long flags;
421 struct snd_seq_event_cell *ptr; 421 struct snd_seq_event_cell *ptr;
422 int max_count = 5 * HZ;
423 422
424 if (snd_BUG_ON(!pool)) 423 if (snd_BUG_ON(!pool))
425 return -EINVAL; 424 return -EINVAL;
@@ -432,14 +431,8 @@ int snd_seq_pool_done(struct snd_seq_pool *pool)
432 if (waitqueue_active(&pool->output_sleep)) 431 if (waitqueue_active(&pool->output_sleep))
433 wake_up(&pool->output_sleep); 432 wake_up(&pool->output_sleep);
434 433
435 while (atomic_read(&pool->counter) > 0) { 434 while (atomic_read(&pool->counter) > 0)
436 if (max_count == 0) {
437 pr_warn("ALSA: snd_seq_pool_done timeout: %d cells remain\n", atomic_read(&pool->counter));
438 break;
439 }
440 schedule_timeout_uninterruptible(1); 435 schedule_timeout_uninterruptible(1);
441 max_count--;
442 }
443 436
444 /* release all resources */ 437 /* release all resources */
445 spin_lock_irqsave(&pool->lock, flags); 438 spin_lock_irqsave(&pool->lock, flags);
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index 0bec02e89d51..450c5187eecb 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -181,6 +181,8 @@ void __exit snd_seq_queues_delete(void)
181 } 181 }
182} 182}
183 183
184static void queue_use(struct snd_seq_queue *queue, int client, int use);
185
184/* allocate a new queue - 186/* allocate a new queue -
185 * return queue index value or negative value for error 187 * return queue index value or negative value for error
186 */ 188 */
@@ -192,11 +194,11 @@ int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
192 if (q == NULL) 194 if (q == NULL)
193 return -ENOMEM; 195 return -ENOMEM;
194 q->info_flags = info_flags; 196 q->info_flags = info_flags;
197 queue_use(q, client, 1);
195 if (queue_list_add(q) < 0) { 198 if (queue_list_add(q) < 0) {
196 queue_delete(q); 199 queue_delete(q);
197 return -ENOMEM; 200 return -ENOMEM;
198 } 201 }
199 snd_seq_queue_use(q->queue, client, 1); /* use this queue */
200 return q->queue; 202 return q->queue;
201} 203}
202 204
@@ -502,19 +504,9 @@ int snd_seq_queue_timer_set_tempo(int queueid, int client,
502 return result; 504 return result;
503} 505}
504 506
505 507/* use or unuse this queue */
506/* use or unuse this queue - 508static void queue_use(struct snd_seq_queue *queue, int client, int use)
507 * if it is the first client, starts the timer.
508 * if it is not longer used by any clients, stop the timer.
509 */
510int snd_seq_queue_use(int queueid, int client, int use)
511{ 509{
512 struct snd_seq_queue *queue;
513
514 queue = queueptr(queueid);
515 if (queue == NULL)
516 return -EINVAL;
517 mutex_lock(&queue->timer_mutex);
518 if (use) { 510 if (use) {
519 if (!test_and_set_bit(client, queue->clients_bitmap)) 511 if (!test_and_set_bit(client, queue->clients_bitmap))
520 queue->clients++; 512 queue->clients++;
@@ -529,6 +521,21 @@ int snd_seq_queue_use(int queueid, int client, int use)
529 } else { 521 } else {
530 snd_seq_timer_close(queue); 522 snd_seq_timer_close(queue);
531 } 523 }
524}
525
526/* use or unuse this queue -
527 * if it is the first client, starts the timer.
528 * if it is not longer used by any clients, stop the timer.
529 */
530int snd_seq_queue_use(int queueid, int client, int use)
531{
532 struct snd_seq_queue *queue;
533
534 queue = queueptr(queueid);
535 if (queue == NULL)
536 return -EINVAL;
537 mutex_lock(&queue->timer_mutex);
538 queue_use(queue, client, use);
532 mutex_unlock(&queue->timer_mutex); 539 mutex_unlock(&queue->timer_mutex);
533 queuefree(queue); 540 queuefree(queue);
534 return 0; 541 return 0;
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 32105cee56ca..fd5efa72a68b 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -3780,6 +3780,7 @@ HDA_CODEC_ENTRY(0x10de0070, "GPU 70 HDMI/DP", patch_nvhdmi),
3780HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP", patch_nvhdmi), 3780HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP", patch_nvhdmi),
3781HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP", patch_nvhdmi), 3781HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP", patch_nvhdmi),
3782HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP", patch_nvhdmi), 3782HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP", patch_nvhdmi),
3783HDA_CODEC_ENTRY(0x10de0080, "GPU 80 HDMI/DP", patch_nvhdmi),
3783HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP", patch_nvhdmi), 3784HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP", patch_nvhdmi),
3784HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP", patch_nvhdmi), 3785HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP", patch_nvhdmi),
3785HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch), 3786HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch),
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 90009c0b3a92..ab3c280a23d1 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -754,8 +754,9 @@ int line6_probe(struct usb_interface *interface,
754 goto error; 754 goto error;
755 } 755 }
756 756
757 line6_get_interval(line6);
758
757 if (properties->capabilities & LINE6_CAP_CONTROL) { 759 if (properties->capabilities & LINE6_CAP_CONTROL) {
758 line6_get_interval(line6);
759 ret = line6_init_cap_control(line6); 760 ret = line6_init_cap_control(line6);
760 if (ret < 0) 761 if (ret < 0)
761 goto error; 762 goto error;