aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-03-31ALSA: usb-audio: Fix double-free in error paths after ↵Vladis Dronov2-1/+9
snd_usb_add_audio_stream() call create_fixed_stream_quirk(), snd_usb_parse_audio_interface() and create_uaxx_quirk() functions allocate the audioformat object by themselves and free it upon error before returning. However, once the object is linked to a stream, it's freed again in snd_usb_audio_pcm_free(), thus it'll be double-freed, eventually resulting in a memory corruption. This patch fixes these failures in the error paths by unlinking the audioformat object before freeing it. Based on a patch by Takashi Iwai <[email protected]> [Note for stable backports: this patch requires the commit 902eb7fd1e4a ('ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk()')] Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1283358 Reported-by: Ralf Spenneberg <[email protected]> Cc: <[email protected]> # see the note above Signed-off-by: Vladis Dronov <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-31ALSA: hda: add AMD Polaris-10/11 AZ PCI IDs with proper driver capsMaruthi Srinivas Bayyavarapu1-0/+4
This commit fixes garbled audio on Polaris-10/11 variants Signed-off-by: Maruthi Bayyavarapu <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Acked-by: Christian König <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-28ALSA: dice: fix memory leak when unpluggingTakashi Sakamoto1-10/+4
When sound card is going to be released, dice private data is also released. Then all of data should be released. However, stream data is not released. This causes memory leak when unplugging dice unit. This commit fixes the bug. Fixes: 4bdc495c87b3('ALSA: dice: handle several PCM substreams when any isochronous streams are available') Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-23ALSA: hda - Apply fix for white noise on Asus N550JV, tooBobi Mihalca1-1/+1
Apply the new fixup that is used for ASUS N750JV to another similar model, N500JV, too, for reducing the headphone noise. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-23ALSA: hda - Fix white noise on Asus N750JV headphoneBobi Mihalca1-1/+8
For reducing the noise from the headphone output on ASUS N750JV, call the existing fixup, alc_fixup_auto_mute_via_amp(), additionally. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-23ALSA: hda - Asus N750JV external subwoofer fixupBobi Mihalca1-0/+1
ASUS N750JV needs the same fixup as N550 for enabling its subwoofer. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-23ALSA: timer: fix gparams ioctl compatibility for different architecturesTakashi Sakamoto2-8/+42
'struct snd_timer_gparams' includes some members with 'unsigned long', therefore its size differs depending on data models of architecture. As a result, x86/x32 applications fail to execute ioctl(2) with SNDRV_TIMER_GPARAMS command on x86_64 machine. This commit fixes this bug by adding a pair of structure and ioctl command for the compatibility. Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-21ALSA: hda - Fix missing ELD update at unpluggingTakashi Iwai1-2/+1
i915 get_eld ops may return an error when no encoder is connected, and currently we regard the error as fatal and skip the whole ELD handling. This ended up with the missing ELD update at unplugging. This patch fixes the issue by treating the error as the unplugged state, instead of skipping the rest. Reported-by: Libin Yang <[email protected]> Cc: <[email protected]> # v4.5 Signed-off-by: Takashi Iwai <[email protected]>
2016-03-20ALSA: usb-audio: add Microsoft HD-5001 to quirksVictor Clément1-0/+1
The Microsoft HD-5001 webcam microphone does not support sample rate reading as the HD-5000 one. This results in dmesg errors and sound hanging with pulseaudio. Signed-off-by: Victor Clément <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-20ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probeTakashi Iwai1-0/+6
The recent addition of on-demand i915 audio component binding in the codec driver seems leading to the unbalanced i915 power refcount, according to Intel CI tests. Typically, it gets a kernel WARNING like: WARNING: CPU: 3 PID: 173 at sound/hda/hdac_i915.c:91 snd_hdac_display_power+0xf1/0x110 [snd_hda_core]() Call Trace: [<ffffffff813fef15>] dump_stack+0x67/0x92 [<ffffffff81078a21>] warn_slowpath_common+0x81/0xc0 [<ffffffff81078b15>] warn_slowpath_null+0x15/0x20 [<ffffffffa00f77e1>] snd_hdac_display_power+0xf1/0x110 [snd_hda_core] [<ffffffffa015039d>] azx_intel_link_power+0xd/0x10 [snd_hda_intel] [<ffffffffa011e32a>] azx_link_power+0x1a/0x30 [snd_hda_codec] [<ffffffffa00f21f9>] snd_hdac_link_power+0x29/0x40 [snd_hda_core] [<ffffffffa01192a6>] hda_codec_runtime_suspend+0x76/0xa0 [snd_hda_codec] ..... The scenario is like below: - HD-audio driver and i915 driver are probed concurrently at the (almost) same time; HDA bus tries to bind with i915, but it fails because i915 initialization is still being processed. - Later on, HD-audio probes the HDMI codec, where it again tries to bind with i915. At this time, it succeeds. - At finishing the probe of HDA, it decreases the refcount as if it were already bound at the bus probe, since the component is bound now. This triggers a kernel WARNING due to the unbalance. As a workaround, in this patch, we just disable the on-demand i915 component binding in the codec driver. This essentially reverts back to the state of 4.4 kernel. We know that this is no real solution, but it's a minimalistic simple change that can be applied to 4.5.x kernel as stable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94566 Reported-by: Ville Syrjälä <[email protected]> Cc: <[email protected]> # v4.5 Signed-off-by: Takashi Iwai <[email protected]>
2016-03-18ALSA: hda - Fix spurious kernel WARNING on Baytrail HDMITakashi Iwai1-1/+2
snd_hdac_sync_audio_rate() call is mandatory only for HSW and later models, but we call the function unconditionally blindly assuming that the function doesn't do anything harmful. But since recently, the function checks the validity of the passed pin NID, and eventually spews the warning if an unexpected pin is passed. This is seen on old chips like Baytrail. The fix is to limit the call of this function again only for the chips with the proper binding. This can be identified by the same flag as the eld notifier. Reported-by: Ville Syrjälä <[email protected]> Tested-by: Ville Syrjälä <[email protected]> Cc: <[email protected]> # v4.5 Signed-off-by: Takashi Iwai <[email protected]>
2016-03-18ALSA: hda - Fix forgotten HDMI monitor_present updateTakashi Iwai1-0/+1
We forgot to copy monitor_present value when updating the ELD information. This won't change the ELD retrieval and the jack notification behavior, but appears only in the proc output. In that sense, it's no fatal error, but a bug is a bug is a bug. Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-18ALSA: hda - Really restrict i915 notifier to HSW+Takashi Iwai1-7/+17
The commit [b62232d429fa: ALSA: hda - Limit i915 HDMI binding only for HSW and later] tried to limit the usage of i915 audio notifier to the recent Intel models and switch to the old method on pre-Haswell models. However, it assumed that the i915 component binding hasn't been done on such models, and the assumption was wrong: namely, Baytrail had already the i915 component binding due to powerwell control. Thus, the workaround wasn't applied to Baytrail. For fixing this properly, this patch introduces a new flag indicating the usage of audio notifier and codec_has_acomp() refers to this flag instead of checking the existence of audio component. Reported-by: Ville Syrjälä <[email protected]> Cc: <[email protected]> # v4.5 Signed-off-by: Takashi Iwai <[email protected]>
2016-03-17ALSA: hda - Fix mutex deadlock at HDMI/DP hotplugTakashi Iwai1-2/+7
The recent change in HD-audio HDMI/DP codec driver for allowing the dynamic PCM binding introduced a new spec->pcm_mutex. One of the protected area by this mutex is hdmi_present_sense(). As reported by Intel CI tests, unfortunately, the new mutex causes a deadlock when the hotplug/unplug is triggered during the codec is in runtime suspend. The buggy code path is like the following: hdmi_unsol_event() -> ... -> hdmi_present_sense() ==> ** here taking pcm_mutex -> hdmi_present_sense_via_verbs() -> snd_hda_power_up_pm() -> ... (runtime resume calls) -> generic_hdmi_resume() -> hdmi_present_sense() ==> ** here taking pcm_mutex again! As we can see here, the problem is that the mutex is taken before snd_hda_power_up_pm() call that triggers the runtime resume. That is, the obvious solution is to move the power up/down call outside the mutex; it is exactly what this patch provides. The patch also clarifies why this bug wasn't caught beforehand. We used to have the i915 audio component for hotplug for all Intel chips, and in that code path, there is no power up required but the information is taken directly from the graphics side. However, we recently switched back to the old method for some old Intel chips due to regressions, and now the deadlock issue is surfaced. Fixes: a76056f2e57e ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug') Reported-by: Ville Syrjälä <[email protected]> Tested-by: Ville Syrjälä <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-17ALSA: ctl: change return value in compatibility layer so that it's the same ↵Takashi Sakamoto1-1/+1
value in core implementation In control compatibility layer, when no elements are found by ELEM_READ/ELEM_WRITE ioctl commands, ENXIO is returned. On the other hand, in core implementation, ENOENT is returned. This is not good for ALSA ctl applications. This commit changes the return value from the compatibility layer so that the same value is returned. Signed-off-by: Takashi Sakamoto <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-16ALSA: mixart: silence an uninitialized variable warningDan Carpenter1-1/+1
We could print the uninitialized value of "stat" in the error message. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-16ALSA: usb-audio: Add sanity checks for endpoint accessesTakashi Iwai4-0/+11
Add some sanity check codes before actually accessing the endpoint via get_endpoint() in order to avoid the invalid access through a malformed USB descriptor. Mostly just checking bNumEndpoints, but in one place (snd_microii_spdif_default_get()), the validity of iface and altsetting index is checked as well. Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=971125 Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-16ALSA: usb-audio: Minor code cleanup in create_fixed_stream_quirk()Takashi Iwai1-11/+11
Just a minor code cleanup: unify the error paths. Signed-off-by: Takashi Iwai <[email protected]>
2016-03-16ALSA: usb-audio: Fix NULL dereference in create_fixed_stream_quirk()Takashi Iwai1-0/+6
create_fixed_stream_quirk() may cause a NULL-pointer dereference by accessing the non-existing endpoint when a USB device with a malformed USB descriptor is used. This patch avoids it simply by adding a sanity check of bNumEndpoints before the accesses. Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=971125 Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-15ALSA: hda - Limit i915 HDMI binding only for HSW and laterTakashi Iwai1-2/+3
It turned out that the pre-HSW Intel chips are incompatible with the naive assumption we had -- the fixed mapping between the port and the HD-audio widget. This may result in the bad access, as captured by the recent patch to add a WARN_ON() for the port mapping check. As a quick workaround, disable the i915 audio component binding for all pre-Haswell models. Reported-by: Ville Syrjälä <[email protected]> Cc: <[email protected]> # v4.5 Signed-off-by: Takashi Iwai <[email protected]>
2016-03-15ALSA: hda - Fix unconditional GPIO toggle via automuteTakashi Iwai1-2/+6
Cirrus HD-audio driver may adjust GPIO pins for EAPD dynamically depending on the jack plug state. This works fine for the auto-mute mode where the speaker gets muted upon the HP jack plug. OTOH, when the auto-mute mode is off, this turns off the EAPD unexpectedly depending on the jack state, which results in the silent speaker output. This patch fixes the silent speaker output issue by setting GPIO bits constantly when the auto-mute mode is off. Reported-and-tested-by: [email protected] Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-15ALSA: mixart: silence unitialized variable warningsDan Carpenter1-2/+2
We print can print the uninitialized memory on error. Which is an info leak, I suppose but it's basically harmless. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-14Merge tag 'asoc-v4.6' of ↵Takashi Iwai294-3709/+11803
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v4.6 The main thing in terms of the core this time around has been some additional framework work for dynamic topologies (though we *still* don't appear to have a stable ABI for the topology code, it's probably worth considering if this will ever happen...). Otherwise the work has almost all been in the drivers: - HDMI support for Sky Lake, along with other fixes and enhancements for the Intel drivers. - Lots of improvements to the Renesas drivers. - Capture support for Qualcomm drivers. - Support for TI DaVinci DRA7xxx devices. - New machine drivers for Freescale systems with Cirrus CODECs, Mediatek systems with RT5650 CODECs. - New CPU drivers for Allwinner S/PDIF controllers - New CODEC drivers for Maxim MAX9867 and MAX98926 and Realtek RT5514.
2016-03-14ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_typeSubhransu S. Prusty1-2/+6
nvhdmi_chmap_cea_alloc_validate_get_type calls itself recursively using chmap ops causing the double fault. Fixed by adding the default validate_get_type handling inside nvdia validate_get_type handler. Link: https://bugzilla.kernel.org/show_bug.cgi?id=114311 Fixes: 67b90cb ("ALSA: hda - Create common chmap object") Reported-by: Andreas Reis <[email protected]> Signed-off-by: Subhransu S. Prusty <[email protected]> Tested-by: Andreas Reis <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-14ALSA: intel8x0: Add clock quirk entry for AD1981B on IBM ThinkPad X41.Vittorio Gambaletta (VittGam)1-0/+1
The clock measurement on the AC'97 audio card found in the IBM ThinkPad X41 will often fail, so add a quirk entry to fix it. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=441087 Cc: <[email protected]> Signed-off-by: Vittorio Gambaletta <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-14ALSA: hda - Add new GPU codec ID 0x10de0082 to snd-hdaAaron Plattner1-0/+1
Vendor ID 0x10de0082 is used by a yet-to-be-named GPU chip. This chip also has the 2-ch audio swapping bug, so patch_nvhdmi is appropriate here. Signed-off-by: Aaron Plattner <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2016-03-14Merge branch 'for-linus' into for-nextTakashi Iwai3-1/+11
2016-03-13Merge remote-tracking branches 'asoc/topic/sunxi', 'asoc/topic/topology' and ↵Mark Brown8-98/+856
'asoc/topic/wm8974' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/rt5640', 'asoc/topic/rt5659', ↵Mark Brown7-33/+74
'asoc/topic/samsung' and 'asoc/topic/ssm4567' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rockchip', ↵Mark Brown30-911/+2958
'asoc/topic/rt298', 'asoc/topic/rt5514' and 'asoc/topic/rt5616' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/pxa' and 'asoc/topic/qcom' into ↵Mark Brown9-181/+396
asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/max98926', 'asoc/topic/mtk', ↵Mark Brown14-62/+744
'asoc/topic/mxs-saif', 'asoc/topic/nau8825' and 'asoc/topic/omap' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/fsl-sai', 'asoc/topic/fsl-ssl', ↵Mark Brown25-169/+2361
'asoc/topic/hdac' and 'asoc/topic/max9867' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/fsl-card' ↵Mark Brown6-8/+49
and 'asoc/topic/fsl-mpc5200' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/bcm2835' and ↵Mark Brown4-231/+91
'asoc/topic/cs42xx8' into asoc-next
2016-03-13Merge remote-tracking branches 'asoc/topic/ab8500', 'asoc/topic/adau17x1', ↵Mark Brown20-145/+474
'asoc/topic/ads117x', 'asoc/topic/adsp' and 'asoc/topic/arizona' into asoc-next
2016-03-13Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown1-5/+10
2016-03-13Merge remote-tracking branch 'asoc/topic/pcm3168a' into asoc-nextMark Brown1-2/+6
2016-03-13Merge remote-tracking branch 'asoc/topic/pcm179x' into asoc-nextMark Brown7-49/+196
2016-03-13Merge remote-tracking branch 'asoc/topic/pcm' into asoc-nextMark Brown1-12/+12
2016-03-13Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown27-260/+2127
2016-03-13Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown1-2/+2
2016-03-13Merge remote-tracking branch 'asoc/topic/core-pcm' into asoc-nextMark Brown2-0/+32
2016-03-13Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown1-4/+4
2016-03-13Merge tag 'asoc-fix-v4.5-rc6' into asoc-linusMark Brown33-160/+162
ASoC: Fixes for v4.5 This is far too big a set of fixes for this late in the release cycle but the overwhelming bulk is essentially the same simple fix from Takashi for a cut'n'pasted 64 bit cleanliness issue in the userspace interface where drivers were accessing things using the wrong element in a union which worked OK on 32 bit platforms as the correct element happened to be aligned the same way but with 64 bit platforms ABIs are different and the two members of the union are laid out in different places. They aren't all tagged to stable since some of these chips have vanishingly little chance of being used in 64 bit systems. The other changes are: - A fix for Qualcomm devices to work on big endian systems. The original change is actually correct but triggered a bug in regmap which is too invasive to fix for this cycle and can be worked around by just letting regmap pick the default. - A fix for the Samsung I2S driver locking which wasn't using IRQ safe spinlocks when it needed to. - A fix for the new Intel Sky Lake driver forgetting that C pointer arithmetic takes the type of the pointer into consideration. - A revert of a change to the FSL SSI driver that broke some systems. - A fix for the cleanup path of the wm9713 driver. - A fix for some incorrect register definitions in the ADAU17x1 driver that caused misclocking in some configurations. - A fix for the tracepoints for jack detection to avoid using an internal field of the core jack structure which is no longer present in all configurations. - A fix for another of the new Intel drivers which tried to write to a string literal. # gpg: Signature made Mon 07 Mar 2016 09:41:48 ICT using RSA key ID 5D5487D0 # gpg: key CD7BEEBC: no public key for trusted key - skipped # gpg: key CD7BEEBC marked as ultimately trusted # gpg: key AF88CD16: no public key for trusted key - skipped # gpg: key AF88CD16 marked as ultimately trusted # gpg: key 16005C11: no public key for trusted key - skipped # gpg: key 16005C11 marked as ultimately trusted # gpg: key 5621E907: no public key for trusted key - skipped # gpg: key 5621E907 marked as ultimately trusted # gpg: key 5C6153AD: no public key for trusted key - skipped # gpg: key 5C6153AD marked as ultimately trusted # gpg: Good signature from "Mark Brown <[email protected]>" # gpg: aka "Mark Brown <[email protected]>" # gpg: aka "Mark Brown <[email protected]>" # gpg: aka "Mark Brown <[email protected]>" # gpg: aka "Mark Brown <[email protected]>" # gpg: aka "Mark Brown <[email protected]>"
2016-03-12ASoC: rsnd: add simplified module explanationKuninori Morimoto2-0/+363
Renesas sound driver user needs to read its datasheet when create DT. But it is difficult to understand, because it has many modules (SRC/CTU/MIX/DVC/SSIU/SSI/AudioDMAC/AudioDMACperiperi), and many features (Asynchronous/Synchronous mode on SRC, CTU matrix, DVC volume settings feature, Multi-SSI/TDM-SSI, etc). This patch adds simplified explanation to help setting/understanding. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-12ASoC: hdac_hdmi: Add broxton device IDJeeja KP1-0/+1
Broxton HDMI codec is similar to Skylake so add the device ID Signed-off-by: Jeeja KP <[email protected]> Signed-off-by: GuruprasadX Pawse <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-12ASoC: Intel: Bxtn: Add Broxton PCI IDSenthilnathan Veppur1-0/+7
Broxton is an Intel SoC which sports a DSP and system is quite like Skylake. So add this ID in Skylake driver Signed-off-by: Senthilnathan Veppur <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-12ASoC: Intel: Skylake: Move Skylake dsp ops & loader opsJeeja KP2-10/+64
The code loading for Skylake and other platforms is different, so add a dsp_ops and a loader_ops which can be defined for each platform. Move the dsp init, cleanup and loader ops (alloc and free dma) to these ops Signed-off-by: Jeeja KP <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2016-03-12ASoC: Intel: add dmabuffer to common sst_dspJeeja KP1-0/+1
Broxton uses HDA DMA so needs to keep dmab in the driver context so add it Signed-off-by: GuruprasadX Pawse <[email protected]> Signed-off-by: Jeeja KP <[email protected]> Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Mark Brown <[email protected]>