Skip to content

Commit 6391f34

Browse files
committed
Merge tag 'sound-fix-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Most of changes are small and easy cleanup or fixes: - a few HD-audio Realtek codec fixes and quirks - Intel HDMI audio fixes for Broadwell and Haswell / ValleyView - FireWire sound stack cleanups - a couple of sequencer core fixes - compress ABI fix for 64bit - conversion to modern ktime*() API" * tag 'sound-fix-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits) ALSA: hda/realtek - Add more entry for enable HP mute led ALSA: hda - Add quirk for external mic on Lifebook U904 ALSA: hda - fix a fixup value for codec alc293 in the pin_quirk table ALSA: intel8x0: Use ktime and ktime_get() ALSA: core: Use ktime_get_ts() ALSA: hda - verify pin:converter connection on unsol event for HSW and VLV ALSA: compress: Cancel the optimization of compiler and fix the size of struct for all platform. ALSA: hda - Add quirk for ABit AA8XE Revert "ALSA: hda - mask buggy stream DMA0 for Broadwell display controller" ALSA: hda - using POS_FIX_LPIB on Broadwell HDMI Audio ALSA: hda/realtek - Add support of ALC667 codec ALSA: hda/realtek - Add more codec rename ALSA: hda/realtek - New vendor ID for ALC233 ALSA: hda - add two new pin tables ALSA: hda/realtek - Add support of ALC891 codec ALSA: seq: Continue broadcasting events to ports if one of them fails ALSA: bebob: Remove unused function prototype ALSA: fireworks: Remove meaningless mutex_destroy() ALSA: fireworks: Remove a constant over width to which it's applied ALSA: fireworks: Improve comments about Fireworks transaction ...
2 parents 4bdeb31 + 8a02b16 commit 6391f34

16 files changed

Lines changed: 147 additions & 56 deletions

File tree

‎include/sound/pcm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
932932
struct timespec *tv)
933933
{
934934
if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC)
935-
do_posix_clock_monotonic_gettime(tv);
935+
ktime_get_ts(tv);
936936
else
937937
getnstimeofday(tv);
938938
}

‎include/uapi/sound/compress_offload.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct snd_compr_tstamp {
8080
struct snd_compr_avail {
8181
__u64 avail;
8282
struct snd_compr_tstamp tstamp;
83-
};
83+
} __attribute__((packed));
8484

8585
enum snd_compr_direction {
8686
SND_COMPRESS_PLAYBACK = 0,

‎sound/core/seq/seq_clientmgr.c‎

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
660660
int atomic, int hop)
661661
{
662662
struct snd_seq_subscribers *subs;
663-
int err = 0, num_ev = 0;
663+
int err, result = 0, num_ev = 0;
664664
struct snd_seq_event event_saved;
665665
struct snd_seq_client_port *src_port;
666666
struct snd_seq_port_subs_info *grp;
@@ -685,8 +685,12 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
685685
subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIME_REAL);
686686
err = snd_seq_deliver_single_event(client, event,
687687
0, atomic, hop);
688-
if (err < 0)
689-
break;
688+
if (err < 0) {
689+
/* save first error that occurs and continue */
690+
if (!result)
691+
result = err;
692+
continue;
693+
}
690694
num_ev++;
691695
/* restore original event record */
692696
*event = event_saved;
@@ -697,7 +701,7 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
697701
up_read(&grp->list_mutex);
698702
*event = event_saved; /* restore */
699703
snd_seq_port_unlock(src_port);
700-
return (err < 0) ? err : num_ev;
704+
return (result < 0) ? result : num_ev;
701705
}
702706

703707

@@ -709,7 +713,7 @@ static int port_broadcast_event(struct snd_seq_client *client,
709713
struct snd_seq_event *event,
710714
int atomic, int hop)
711715
{
712-
int num_ev = 0, err = 0;
716+
int num_ev = 0, err, result = 0;
713717
struct snd_seq_client *dest_client;
714718
struct snd_seq_client_port *port;
715719

@@ -724,14 +728,18 @@ static int port_broadcast_event(struct snd_seq_client *client,
724728
err = snd_seq_deliver_single_event(NULL, event,
725729
SNDRV_SEQ_FILTER_BROADCAST,
726730
atomic, hop);
727-
if (err < 0)
728-
break;
731+
if (err < 0) {
732+
/* save first error that occurs and continue */
733+
if (!result)
734+
result = err;
735+
continue;
736+
}
729737
num_ev++;
730738
}
731739
read_unlock(&dest_client->ports_lock);
732740
snd_seq_client_unlock(dest_client);
733741
event->dest.port = SNDRV_SEQ_ADDRESS_BROADCAST; /* restore */
734-
return (err < 0) ? err : num_ev;
742+
return (result < 0) ? result : num_ev;
735743
}
736744

737745
/*
@@ -741,7 +749,7 @@ static int port_broadcast_event(struct snd_seq_client *client,
741749
static int broadcast_event(struct snd_seq_client *client,
742750
struct snd_seq_event *event, int atomic, int hop)
743751
{
744-
int err = 0, num_ev = 0;
752+
int err, result = 0, num_ev = 0;
745753
int dest;
746754
struct snd_seq_addr addr;
747755

@@ -760,12 +768,16 @@ static int broadcast_event(struct snd_seq_client *client,
760768
err = snd_seq_deliver_single_event(NULL, event,
761769
SNDRV_SEQ_FILTER_BROADCAST,
762770
atomic, hop);
763-
if (err < 0)
764-
break;
771+
if (err < 0) {
772+
/* save first error that occurs and continue */
773+
if (!result)
774+
result = err;
775+
continue;
776+
}
765777
num_ev += err;
766778
}
767779
event->dest = addr; /* restore */
768-
return (err < 0) ? err : num_ev;
780+
return (result < 0) ? result : num_ev;
769781
}
770782

771783

‎sound/core/seq/seq_fifo.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int snd_seq_fifo_event_in(struct snd_seq_fifo *f,
124124
snd_use_lock_use(&f->use_lock);
125125
err = snd_seq_event_dup(f->pool, event, &cell, 1, NULL); /* always non-blocking */
126126
if (err < 0) {
127-
if (err == -ENOMEM)
127+
if ((err == -ENOMEM) || (err == -EAGAIN))
128128
atomic_inc(&f->overflow);
129129
snd_use_lock_free(&f->use_lock);
130130
return err;

‎sound/core/timer.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
390390
struct timespec tstamp;
391391

392392
if (timer_tstamp_monotonic)
393-
do_posix_clock_monotonic_gettime(&tstamp);
393+
ktime_get_ts(&tstamp);
394394
else
395395
getnstimeofday(&tstamp);
396396
if (snd_BUG_ON(event < SNDRV_TIMER_EVENT_START ||
@@ -1203,7 +1203,7 @@ static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri,
12031203
}
12041204
if (tu->last_resolution != resolution || ticks > 0) {
12051205
if (timer_tstamp_monotonic)
1206-
do_posix_clock_monotonic_gettime(&tstamp);
1206+
ktime_get_ts(&tstamp);
12071207
else
12081208
getnstimeofday(&tstamp);
12091209
}

‎sound/firewire/bebob/bebob.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ int snd_bebob_stream_set_rate(struct snd_bebob *bebob, unsigned int rate);
208208
int snd_bebob_stream_check_internal_clock(struct snd_bebob *bebob,
209209
bool *internal);
210210
int snd_bebob_stream_discover(struct snd_bebob *bebob);
211-
int snd_bebob_stream_map(struct snd_bebob *bebob,
212-
struct amdtp_stream *stream);
213211
int snd_bebob_stream_init_duplex(struct snd_bebob *bebob);
214212
int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate);
215213
void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob);

‎sound/firewire/bebob/bebob_stream.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,6 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob)
655655
struct amdtp_stream *master, *slave;
656656
atomic_t *master_substreams, *slave_substreams;
657657

658-
mutex_lock(&bebob->mutex);
659-
660658
if (bebob->master == &bebob->rx_stream) {
661659
slave = &bebob->tx_stream;
662660
master = &bebob->rx_stream;
@@ -669,6 +667,8 @@ void snd_bebob_stream_stop_duplex(struct snd_bebob *bebob)
669667
master_substreams = &bebob->capture_substreams;
670668
}
671669

670+
mutex_lock(&bebob->mutex);
671+
672672
if (atomic_read(slave_substreams) == 0) {
673673
amdtp_stream_pcm_abort(slave);
674674
amdtp_stream_stop(slave);

‎sound/firewire/fireworks/fireworks.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ static void __exit snd_efw_exit(void)
346346
{
347347
snd_efw_transaction_unregister();
348348
driver_unregister(&efw_driver.driver);
349-
mutex_destroy(&devices_mutex);
350349
}
351350

352351
module_init(snd_efw_init);

‎sound/firewire/fireworks/fireworks.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ enum snd_efw_grp_type {
162162
SND_EFW_CH_TYPE_GUITAR = 7,
163163
SND_EFW_CH_TYPE_PIEZO_GUITAR = 8,
164164
SND_EFW_CH_TYPE_GUITAR_STRING = 9,
165-
SND_EFW_CH_TYPE_VIRTUAL = 0x10000,
166165
SND_EFW_CH_TYPE_DUMMY
167166
};
168167
struct snd_efw_phys_meters {

‎sound/firewire/fireworks/fireworks_hwdep.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ hwdep_read_resp_buf(struct snd_efw *efw, char __user *buf, long remained,
5858
efw->pull_ptr += till_end;
5959
if (efw->pull_ptr >= efw->resp_buf +
6060
snd_efw_resp_buf_size)
61-
efw->pull_ptr = efw->resp_buf;
61+
efw->pull_ptr -= snd_efw_resp_buf_size;
6262

6363
length -= till_end;
6464
buf += till_end;

0 commit comments

Comments
 (0)