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

File tree

16 files changed

+147
-56
lines changed

16 files changed

+147
-56
lines changed

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;

sound/firewire/fireworks/fireworks_stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw)
284284
struct amdtp_stream *master, *slave;
285285
atomic_t *master_substreams, *slave_substreams;
286286

287-
mutex_lock(&efw->mutex);
288-
289287
if (efw->master == &efw->rx_stream) {
290288
slave = &efw->tx_stream;
291289
master = &efw->rx_stream;
@@ -298,6 +296,8 @@ void snd_efw_stream_stop_duplex(struct snd_efw *efw)
298296
master_substreams = &efw->capture_substreams;
299297
}
300298

299+
mutex_lock(&efw->mutex);
300+
301301
if (atomic_read(slave_substreams) == 0) {
302302
stop_stream(efw, slave);
303303

sound/firewire/fireworks/fireworks_transaction.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
/*
1010
* Fireworks have its own transaction. The transaction can be delivered by AV/C
11-
* Vendor Specific command. But at least Windows driver and firmware version 5.5
12-
* or later don't use it.
11+
* Vendor Specific command frame or usual asynchronous transaction. At least,
12+
* Windows driver and firmware version 5.5 or later don't use AV/C command.
1313
*
1414
* Transaction substance:
15-
* At first, 6 data exist. Following to the 6 data, parameters for each
16-
* commands exists. All of parameters are 32 bit alighed to big endian.
15+
* At first, 6 data exist. Following to the data, parameters for each command
16+
* exist. All of the parameters are 32 bit alighed to big endian.
1717
* data[0]: Length of transaction substance
1818
* data[1]: Transaction version
1919
* data[2]: Sequence number. This is incremented by the device
20-
* data[3]: transaction category
21-
* data[4]: transaction command
22-
* data[5]: return value in response.
23-
* data[6-]: parameters
20+
* data[3]: Transaction category
21+
* data[4]: Transaction command
22+
* data[5]: Return value in response.
23+
* data[6-]: Parameters
2424
*
2525
* Transaction address:
2626
* command: 0xecc000000000
@@ -148,7 +148,7 @@ copy_resp_to_buf(struct snd_efw *efw, void *data, size_t length, int *rcode)
148148

149149
efw->push_ptr += till_end;
150150
if (efw->push_ptr >= efw->resp_buf + snd_efw_resp_buf_size)
151-
efw->push_ptr = efw->resp_buf;
151+
efw->push_ptr -= snd_efw_resp_buf_size;
152152

153153
length -= till_end;
154154
data += till_end;

sound/pci/hda/hda_intel.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ enum {
237237
AZX_DCAPS_COUNT_LPIB_DELAY | AZX_DCAPS_PM_RUNTIME | \
238238
AZX_DCAPS_I915_POWERWELL)
239239

240+
/* Broadwell HDMI can't use position buffer reliably, force to use LPIB */
241+
#define AZX_DCAPS_INTEL_BROADWELL \
242+
(AZX_DCAPS_SCH_SNOOP | AZX_DCAPS_ALIGN_BUFSIZE | \
243+
AZX_DCAPS_POSFIX_LPIB | AZX_DCAPS_PM_RUNTIME | \
244+
AZX_DCAPS_I915_POWERWELL)
245+
240246
/* quirks for ATI SB / AMD Hudson */
241247
#define AZX_DCAPS_PRESET_ATI_SB \
242248
(AZX_DCAPS_ATI_SNOOP | AZX_DCAPS_NO_TCSEL | \
@@ -1367,12 +1373,6 @@ static int azx_first_init(struct azx *chip)
13671373
/* initialize streams */
13681374
azx_init_stream(chip);
13691375

1370-
/* workaround for Broadwell HDMI: the first stream is broken,
1371-
* so mask it by keeping it as if opened
1372-
*/
1373-
if (pci->vendor == 0x8086 && pci->device == 0x160c)
1374-
chip->azx_dev[0].opened = 1;
1375-
13761376
/* initialize chip */
13771377
azx_init_pci(chip);
13781378
azx_init_chip(chip, (probe_only[dev] & 2) == 0);
@@ -1769,7 +1769,7 @@ static const struct pci_device_id azx_ids[] = {
17691769
.driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
17701770
/* Broadwell */
17711771
{ PCI_DEVICE(0x8086, 0x160c),
1772-
.driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
1772+
.driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_BROADWELL },
17731773
/* 5 Series/3400 */
17741774
{ PCI_DEVICE(0x8086, 0x3b56),
17751775
.driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM },

sound/pci/hda/patch_hdmi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,10 +1594,18 @@ static bool hdmi_present_sense(struct hdmi_spec_per_pin *per_pin, int repoll)
15941594
* Re-setup pin and infoframe. This is needed e.g. when
15951595
* - sink is first plugged-in (infoframe is not set up if !monitor_present)
15961596
* - transcoder can change during stream playback on Haswell
1597+
* and this can make HW reset converter selection on a pin.
15971598
*/
1598-
if (eld->eld_valid && !old_eld_valid && per_pin->setup)
1599+
if (eld->eld_valid && !old_eld_valid && per_pin->setup) {
1600+
if (is_haswell_plus(codec) || is_valleyview(codec)) {
1601+
intel_verify_pin_cvt_connect(codec, per_pin);
1602+
intel_not_share_assigned_cvt(codec, pin_nid,
1603+
per_pin->mux_idx);
1604+
}
1605+
15991606
hdmi_setup_audio_infoframe(codec, per_pin,
16001607
per_pin->non_pcm);
1608+
}
16011609
}
16021610

16031611
if (eld_changed)

0 commit comments

Comments
 (0)