Skip to content

Commit 4dda3a1

Browse files
committed
Merge branch 'for-next' into for-linus
2 parents 148ebf5 + 96e503f commit 4dda3a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2092
-882
lines changed

include/drm/drm_audio_component.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ struct drm_audio_component {
117117
* @audio_ops: Ops implemented by hda driver, called by DRM driver
118118
*/
119119
const struct drm_audio_component_audio_ops *audio_ops;
120+
/**
121+
* @master_bind_complete: completion held during component master binding
122+
*/
123+
struct completion master_bind_complete;
120124
};
121125

122126
#endif /* _DRM_AUDIO_COMPONENT_H_ */

include/sound/pcm_params.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ int snd_pcm_hw_param_value(const struct snd_pcm_hw_params *params,
2323
#define MASK_OFS(i) ((i) >> 5)
2424
#define MASK_BIT(i) (1U << ((i) & 31))
2525

26-
static inline size_t snd_mask_sizeof(void)
27-
{
28-
return sizeof(struct snd_mask);
29-
}
30-
3126
static inline void snd_mask_none(struct snd_mask *mask)
3227
{
3328
memset(mask, 0, sizeof(*mask));

include/sound/timer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
#define SNDRV_TIMER_HW_STOP 0x00000002 /* call stop before start */
2222
#define SNDRV_TIMER_HW_SLAVE 0x00000004 /* only slave timer (variable resolution) */
2323
#define SNDRV_TIMER_HW_FIRST 0x00000008 /* first tick can be incomplete */
24-
#define SNDRV_TIMER_HW_TASKLET 0x00000010 /* timer is called from tasklet */
24+
#define SNDRV_TIMER_HW_WORK 0x00000010 /* timer is called from work */
2525

2626
#define SNDRV_TIMER_IFLG_SLAVE 0x00000001
2727
#define SNDRV_TIMER_IFLG_RUNNING 0x00000002
2828
#define SNDRV_TIMER_IFLG_START 0x00000004
2929
#define SNDRV_TIMER_IFLG_AUTO 0x00000008 /* auto restart */
30-
#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use tasklet) */
30+
#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use work) */
3131
#define SNDRV_TIMER_IFLG_CALLBACK 0x00000020 /* timer callback is active */
3232
#define SNDRV_TIMER_IFLG_EXCLUSIVE 0x00000040 /* exclusive owner - no more instances */
3333
#define SNDRV_TIMER_IFLG_EARLY_EVENT 0x00000080 /* write early event to the poll queue */
@@ -74,7 +74,7 @@ struct snd_timer {
7474
struct list_head active_list_head;
7575
struct list_head ack_list_head;
7676
struct list_head sack_list_head; /* slow ack list head */
77-
struct tasklet_struct task_queue;
77+
struct work_struct task_work;
7878
int max_instances; /* upper limit of timer instances */
7979
int num_instances; /* current number of timer instances */
8080
};
@@ -96,7 +96,7 @@ struct snd_timer_instance {
9696
unsigned long ticks; /* auto-load ticks when expired */
9797
unsigned long cticks; /* current ticks */
9898
unsigned long pticks; /* accumulated ticks for callback */
99-
unsigned long resolution; /* current resolution for tasklet */
99+
unsigned long resolution; /* current resolution for work */
100100
unsigned long lost; /* lost ticks */
101101
int slave_class;
102102
unsigned int slave_id;

sound/ac97/ac97_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (C) 2016 Robert Jarzmik <[email protected]>
44
*/
55

6-
unsigned int snd_ac97_bus_scan_one(struct ac97_controller *ac97,
6+
unsigned int snd_ac97_bus_scan_one(struct ac97_controller *adrv,
77
unsigned int codec_num);
88

99
static inline bool ac97_ids_match(unsigned int id1, unsigned int id2,

sound/aoa/soundbus/i2sbus/pcm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,11 @@ static void i2sbus_wait_for_stop(struct i2sbus_dev *i2sdev,
254254
struct pcm_info *pi)
255255
{
256256
unsigned long flags;
257-
struct completion done;
257+
DECLARE_COMPLETION_ONSTACK(done);
258258
long timeout;
259259

260260
spin_lock_irqsave(&i2sdev->low_lock, flags);
261261
if (pi->dbdma_ring.stopping) {
262-
init_completion(&done);
263262
pi->stop_completion = &done;
264263
spin_unlock_irqrestore(&i2sdev->low_lock, flags);
265264
timeout = wait_for_completion_timeout(&done, HZ);

sound/atmel/ac97c.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,12 @@ static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
475475
struct snd_pcm_runtime *runtime;
476476
int offset, next_period, block_size;
477477
dev_dbg(&chip->pdev->dev, "channel A event%s%s%s%s%s%s\n",
478-
casr & AC97C_CSR_OVRUN ? " OVRUN" : "",
479-
casr & AC97C_CSR_RXRDY ? " RXRDY" : "",
480-
casr & AC97C_CSR_UNRUN ? " UNRUN" : "",
481-
casr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "",
482-
casr & AC97C_CSR_TXRDY ? " TXRDY" : "",
483-
!casr ? " NONE" : "");
478+
(casr & AC97C_CSR_OVRUN) ? " OVRUN" : "",
479+
(casr & AC97C_CSR_RXRDY) ? " RXRDY" : "",
480+
(casr & AC97C_CSR_UNRUN) ? " UNRUN" : "",
481+
(casr & AC97C_CSR_TXEMPTY) ? " TXEMPTY" : "",
482+
(casr & AC97C_CSR_TXRDY) ? " TXRDY" : "",
483+
!casr ? " NONE" : "");
484484
if ((casr & camr) & AC97C_CSR_ENDTX) {
485485
runtime = chip->playback_substream->runtime;
486486
block_size = frames_to_bytes(runtime, runtime->period_size);
@@ -521,11 +521,11 @@ static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
521521

522522
if (sr & AC97C_SR_COEVT) {
523523
dev_info(&chip->pdev->dev, "codec channel event%s%s%s%s%s\n",
524-
cosr & AC97C_CSR_OVRUN ? " OVRUN" : "",
525-
cosr & AC97C_CSR_RXRDY ? " RXRDY" : "",
526-
cosr & AC97C_CSR_TXEMPTY ? " TXEMPTY" : "",
527-
cosr & AC97C_CSR_TXRDY ? " TXRDY" : "",
528-
!cosr ? " NONE" : "");
524+
(cosr & AC97C_CSR_OVRUN) ? " OVRUN" : "",
525+
(cosr & AC97C_CSR_RXRDY) ? " RXRDY" : "",
526+
(cosr & AC97C_CSR_TXEMPTY) ? " TXEMPTY" : "",
527+
(cosr & AC97C_CSR_TXRDY) ? " TXRDY" : "",
528+
!cosr ? " NONE" : "");
529529
retval = IRQ_HANDLED;
530530
}
531531

sound/core/compress_offload.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,11 @@ EXPORT_SYMBOL(snd_compr_malloc_pages);
513513

514514
int snd_compr_free_pages(struct snd_compr_stream *stream)
515515
{
516-
struct snd_compr_runtime *runtime = stream->runtime;
516+
struct snd_compr_runtime *runtime;
517517

518518
if (snd_BUG_ON(!(stream) || !(stream)->runtime))
519519
return -EINVAL;
520+
runtime = stream->runtime;
520521
if (runtime->dma_area == NULL)
521522
return 0;
522523
if (runtime->dma_buffer_p != &stream->dma_buffer) {
@@ -1031,7 +1032,7 @@ static const struct file_operations snd_compr_file_ops = {
10311032

10321033
static int snd_compress_dev_register(struct snd_device *device)
10331034
{
1034-
int ret = -EINVAL;
1035+
int ret;
10351036
struct snd_compr *compr;
10361037

10371038
if (snd_BUG_ON(!device || !device->device_data))

sound/core/control.c

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
150150
return;
151151
if (card->shutdown)
152152
return;
153-
read_lock(&card->ctl_files_rwlock);
153+
read_lock_irqsave(&card->ctl_files_rwlock, flags);
154154
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
155155
card->mixer_oss_change_count++;
156156
#endif
157157
list_for_each_entry(ctl, &card->ctl_files, list) {
158158
if (!ctl->subscribed)
159159
continue;
160-
spin_lock_irqsave(&ctl->read_lock, flags);
160+
spin_lock(&ctl->read_lock);
161161
list_for_each_entry(ev, &ctl->events, list) {
162162
if (ev->id.numid == id->numid) {
163163
ev->mask |= mask;
@@ -174,10 +174,10 @@ void snd_ctl_notify(struct snd_card *card, unsigned int mask,
174174
}
175175
_found:
176176
wake_up(&ctl->change_sleep);
177-
spin_unlock_irqrestore(&ctl->read_lock, flags);
177+
spin_unlock(&ctl->read_lock);
178178
kill_fasync(&ctl->fasync, SIGIO, POLL_IN);
179179
}
180-
read_unlock(&card->ctl_files_rwlock);
180+
read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
181181
}
182182
EXPORT_SYMBOL(snd_ctl_notify);
183183

@@ -717,22 +717,19 @@ static int snd_ctl_card_info(struct snd_card *card, struct snd_ctl_file * ctl,
717717
}
718718

719719
static int snd_ctl_elem_list(struct snd_card *card,
720-
struct snd_ctl_elem_list __user *_list)
720+
struct snd_ctl_elem_list *list)
721721
{
722-
struct snd_ctl_elem_list list;
723722
struct snd_kcontrol *kctl;
724723
struct snd_ctl_elem_id id;
725724
unsigned int offset, space, jidx;
726725
int err = 0;
727726

728-
if (copy_from_user(&list, _list, sizeof(list)))
729-
return -EFAULT;
730-
offset = list.offset;
731-
space = list.space;
727+
offset = list->offset;
728+
space = list->space;
732729

733730
down_read(&card->controls_rwsem);
734-
list.count = card->controls_count;
735-
list.used = 0;
731+
list->count = card->controls_count;
732+
list->used = 0;
736733
if (space > 0) {
737734
list_for_each_entry(kctl, &card->controls, list) {
738735
if (offset >= kctl->count) {
@@ -741,12 +738,12 @@ static int snd_ctl_elem_list(struct snd_card *card,
741738
}
742739
for (jidx = offset; jidx < kctl->count; jidx++) {
743740
snd_ctl_build_ioff(&id, kctl, jidx);
744-
if (copy_to_user(list.pids + list.used, &id,
741+
if (copy_to_user(list->pids + list->used, &id,
745742
sizeof(id))) {
746743
err = -EFAULT;
747744
goto out;
748745
}
749-
list.used++;
746+
list->used++;
750747
if (!--space)
751748
goto out;
752749
}
@@ -755,11 +752,26 @@ static int snd_ctl_elem_list(struct snd_card *card,
755752
}
756753
out:
757754
up_read(&card->controls_rwsem);
758-
if (!err && copy_to_user(_list, &list, sizeof(list)))
759-
err = -EFAULT;
760755
return err;
761756
}
762757

758+
static int snd_ctl_elem_list_user(struct snd_card *card,
759+
struct snd_ctl_elem_list __user *_list)
760+
{
761+
struct snd_ctl_elem_list list;
762+
int err;
763+
764+
if (copy_from_user(&list, _list, sizeof(list)))
765+
return -EFAULT;
766+
err = snd_ctl_elem_list(card, &list);
767+
if (err)
768+
return err;
769+
if (copy_to_user(_list, &list, sizeof(list)))
770+
return -EFAULT;
771+
772+
return 0;
773+
}
774+
763775
/* Check whether the given kctl info is valid */
764776
static int snd_ctl_check_elem_info(struct snd_card *card,
765777
const struct snd_ctl_elem_info *info)
@@ -1703,7 +1715,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg
17031715
case SNDRV_CTL_IOCTL_CARD_INFO:
17041716
return snd_ctl_card_info(card, ctl, cmd, argp);
17051717
case SNDRV_CTL_IOCTL_ELEM_LIST:
1706-
return snd_ctl_elem_list(card, argp);
1718+
return snd_ctl_elem_list_user(card, argp);
17071719
case SNDRV_CTL_IOCTL_ELEM_INFO:
17081720
return snd_ctl_elem_info_user(ctl, argp);
17091721
case SNDRV_CTL_IOCTL_ELEM_READ:
@@ -1939,16 +1951,17 @@ int snd_ctl_get_preferred_subdevice(struct snd_card *card, int type)
19391951
{
19401952
struct snd_ctl_file *kctl;
19411953
int subdevice = -1;
1954+
unsigned long flags;
19421955

1943-
read_lock(&card->ctl_files_rwlock);
1956+
read_lock_irqsave(&card->ctl_files_rwlock, flags);
19441957
list_for_each_entry(kctl, &card->ctl_files, list) {
19451958
if (kctl->pid == task_pid(current)) {
19461959
subdevice = kctl->preferred_subdevice[type];
19471960
if (subdevice != -1)
19481961
break;
19491962
}
19501963
}
1951-
read_unlock(&card->ctl_files_rwlock);
1964+
read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
19521965
return subdevice;
19531966
}
19541967
EXPORT_SYMBOL_GPL(snd_ctl_get_preferred_subdevice);
@@ -1997,13 +2010,14 @@ static int snd_ctl_dev_disconnect(struct snd_device *device)
19972010
{
19982011
struct snd_card *card = device->device_data;
19992012
struct snd_ctl_file *ctl;
2013+
unsigned long flags;
20002014

2001-
read_lock(&card->ctl_files_rwlock);
2015+
read_lock_irqsave(&card->ctl_files_rwlock, flags);
20022016
list_for_each_entry(ctl, &card->ctl_files, list) {
20032017
wake_up(&ctl->change_sleep);
20042018
kill_fasync(&ctl->fasync, SIGIO, POLL_ERR);
20052019
}
2006-
read_unlock(&card->ctl_files_rwlock);
2020+
read_unlock_irqrestore(&card->ctl_files_rwlock, flags);
20072021

20082022
return snd_unregister_device(&card->ctl_dev);
20092023
}

sound/core/control_compat.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ struct snd_ctl_elem_list32 {
2222
static int snd_ctl_elem_list_compat(struct snd_card *card,
2323
struct snd_ctl_elem_list32 __user *data32)
2424
{
25-
struct snd_ctl_elem_list __user *data;
25+
struct snd_ctl_elem_list data = {};
2626
compat_caddr_t ptr;
2727
int err;
2828

29-
data = compat_alloc_user_space(sizeof(*data));
30-
3129
/* offset, space, used, count */
32-
if (copy_in_user(data, data32, 4 * sizeof(u32)))
30+
if (copy_from_user(&data, data32, 4 * sizeof(u32)))
3331
return -EFAULT;
3432
/* pids */
35-
if (get_user(ptr, &data32->pids) ||
36-
put_user(compat_ptr(ptr), &data->pids))
33+
if (get_user(ptr, &data32->pids))
3734
return -EFAULT;
38-
err = snd_ctl_elem_list(card, data);
35+
data.pids = compat_ptr(ptr);
36+
err = snd_ctl_elem_list(card, &data);
3937
if (err < 0)
4038
return err;
4139
/* copy the result */
42-
if (copy_in_user(data32, data, 4 * sizeof(u32)))
40+
if (copy_to_user(data32, &data, 4 * sizeof(u32)))
4341
return -EFAULT;
4442
return 0;
4543
}

sound/core/hrtimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int snd_hrtimer_stop(struct snd_timer *t)
114114
}
115115

116116
static const struct snd_timer_hardware hrtimer_hw __initconst = {
117-
.flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_TASKLET,
117+
.flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_WORK,
118118
.open = snd_hrtimer_open,
119119
.close = snd_hrtimer_close,
120120
.start = snd_hrtimer_start,

0 commit comments

Comments
 (0)