07 Dec, 2016
1 commit
-
We accidentally introduced a dereference before the NULL check in
xmit_descs() as part of silencing a GCC warning.Fixes: 16f46050e709 ("dbri: Fix compiler warning")
Signed-off-by: Dan Carpenter
Signed-off-by: David S. Miller
29 Nov, 2016
2 commits
-
Pull sparc fixes from David Miller:
"Two ugly build warning fixes"* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
dbri: Fix compiler warning
qlogicpti: Fix compiler warnings -
dbri uses 'u32' for dma handle while invoking kernel DMA APIs,
instead of using dma_addr_t. This hasn't caused any 'incompatible
pointer type' warning on SPARC because until now dma_addr_t is of
type u32. However, recent changes in SPARC ATU (iommu) enabled 64bit
DMA and therefore dma_addr_t became of type u64. This makes
'incompatible pointer type' warnings inevitable.e.g.
sound/sparc/dbri.c: In function ‘snd_dbri_create’:
sound/sparc/dbri.c:2538: warning: passing argument 3 of ‘dma_zalloc_coherent’ from incompatible pointer type
./include/linux/dma-mapping.h:608: note: expected ‘dma_addr_t *’ but argument is of type ‘u32 *’For the record, dbri(sbus) driver never executes on sun4v. Therefore
even though 64bit DMA is enabled on SPARC, dbri continues to use
legacy iommu that guarantees DMA address is always in 32bit range.This patch resolves above compiler warning.
Signed-off-by: Tushar Dave
Reviewed-by: thomas tai
Signed-off-by: David S. Miller
19 Nov, 2016
1 commit
-
Pull sound fixes from Takashi Iwai:
"Three trivial fixes:A regression fix for ASRock mobo, a use-after-free fix at hot-unplug
of USB-audio, and a quirk for new Thinkpad models"* tag 'sound-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: usb-audio: Fix use-after-free of usb_device at disconnect
ALSA: hda - Fix mic regression by ASRock mobo fixup
ALSA: hda - add a new condition to check if it is thinkpad
15 Nov, 2016
2 commits
-
The usb-audio driver implements the deferred device disconnection for
the device in use. In this mode, the disconnection callback returns
immediately while the actual ALSA card object removal happens later
when all files get closed. As Shuah reported, this code flow,
however, leads to a use-after-free, detected by KASAN:BUG: KASAN: use-after-free in snd_usb_audio_free+0x134/0x160 [snd_usb_audio] at addr ffff8801c863ce10
Write of size 8 by task pulseaudio/2244
Call Trace:
[] dump_stack+0x67/0x94
[] kasan_object_err+0x21/0x70
[] kasan_report_error+0x1fa/0x4e0
[] ? kasan_slab_free+0x87/0xb0
[] __asan_report_store8_noabort+0x43/0x50
[] ? snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
[] snd_usb_audio_free+0x134/0x160 [snd_usb_audio]
[] snd_usb_audio_dev_free+0x31/0x40 [snd_usb_audio]
[] __snd_device_free+0x12a/0x210
[] snd_device_free_all+0x85/0xd0
[] release_card_device+0x34/0x130
[] device_release+0x76/0x1e0
[] kobject_release+0x107/0x370
.....
Object at ffff8801c863cc80, in cache kmalloc-2048 size: 2048
Allocated:
[] save_stack_trace+0x2b/0x50
[] save_stack+0x46/0xd0
[] kasan_kmalloc+0xad/0xe0
[] kmem_cache_alloc_trace+0xfa/0x240
[] usb_alloc_dev+0x57/0xc90
[] hub_event+0xf1d/0x35f0
....
Freed:
[] save_stack_trace+0x2b/0x50
[] save_stack+0x46/0xd0
[] kasan_slab_free+0x71/0xb0
[] kfree+0xd9/0x280
[] usb_release_dev+0xde/0x110
[] device_release+0x76/0x1e0
....It's the code trying to clear drvdata of the assigned usb_device where
the usb_device itself was already released in usb_release_dev() after
the disconnect callback.This patch fixes it by checking whether the code path is via the
disconnect callback, i.e. chip->shutdown flag is set.Fixes: 79289e24194a ('ALSA: usb-audio: Refer to chip->usb_id for quirks...')
Reported-and-tested-by: Shuah Khan
Cc: # v4.6+
Signed-off-by: Takashi Iwai -
In commit 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data
usage") the stream specific information initialization was broken, with
the dma channel information not being initialized if there was no
alloc_dma_channel() helper function.Before that, the DMA channel number was implicitly initialized to zero
because the backing store was allocated with devm_kzalloc(). When the
init code was rewritten, that implicit initialization was lost, and gcc
rightfully complains about an uninitialized variable being used.Cc: Srinivas Kandagatla
Cc: Mark Brown
Signed-off-by: Linus Torvalds
11 Nov, 2016
1 commit
-
The commit [1a3f099101b8: ALSA: hda - Fix surround output pins for
ASRock B150M mobo] introduced a fixup of pin configs for ASRock
mobos to fix the surround outputs. However, this overrides the pin
configs of the mic pins as if they are outputs-only, effectively
disabling the mic inputs. Of course, it's a regression wrt mic
functionality.Actually the pins 0x18 and 0x1a don't need to be changed; we just need
to disable the bogus pins 0x14 and 0x15. Then the auto-parser will
pick up mic pins as switchable and assign the surround outputs there.This patch removes the incorrect pin overrides of NID 0x18 and 0x1a
from the ASRock fixup.Fixes: 1a3f099101b8 ('ALSA: hda - Fix surround output pins for ASRock...')
Reported-and-tested-by: Vitor Antunes
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=187431
Cc:
Signed-off-by: Takashi Iwai
10 Nov, 2016
1 commit
-
Latest Thinkpad laptops use the HKEY_HID LEN0268 instead of the
LEN0068, as a result neither audio mute led nor mic mute led can work
any more.After adding the new HKEY_HID into the is_thinkpad(), both of them
works well as before.Cc:
Signed-off-by: Hui Wang
Signed-off-by: Takashi Iwai
08 Nov, 2016
2 commits
-
Currently the ALSA proc handler allows read or write even if the proc
file were write-only or read-only. It's mostly harmless, does thing
but allocating memory and ignores the input/output. But it doesn't
tell user about the invalid use, and it's confusing and inconsistent
in comparison with other proc files.This patch adds some sanity checks and let the proc handler returning
an -EIO error when the invalid read/write is performed.Cc: # v4.2+
Signed-off-by: Takashi Iwai -
The ALSA proc handler allows currently the write in the unlimited size
until kmalloc() fails. But basically the write is supposed to be only
for small inputs, mostly for one line inputs, and we don't have to
handle too large sizes at all. Since the kmalloc error results in the
kernel warning, it's better to limit the size beforehand.This patch adds the limit of 16kB, which must be large enough for the
currently existing code.Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Takashi Iwai
05 Nov, 2016
3 commits
-
…sti', 'asoc/fix/sti-codec', 'asoc/fix/sunxi' and 'asoc/fix/tas571x' into asoc-linus
-
…dmi-codec', 'asoc/fix/pxa', 'asoc/fix/qcom' and 'asoc/fix/rt298' into asoc-linus
02 Nov, 2016
2 commits
-
This patch fixes issues introduced in commit 73f5dfc68316bef2ab7062ec
"ASoC: samsung: get access to DMA engine early to defer probe properly"
and indicated by a following compilation warning:CC [M] sound/soc/samsung/spdif.o
sound/soc/samsung/spdif.c: In function ‘spdif_probe’:
sound/soc/samsung/spdif.c:419:6: warning: ‘filter’ may be used uninitialized
in this function [-Wuninitialized]Signed-off-by: Sylwester Nawrocki
Signed-off-by: Mark Brown -
In the current probe function the GPIO is acquired after the codec's
bus clock is enabled. However if it fails to acquire the GPIO due to
a deferred probe, it does not disable the bus clock before bailing out.
This would result in the clock being enabled multiple times.Move the code that enables the bus clock after the part that gets the
GPIO, maintaining a separation between resource acquisition and device
enablement in the probe function.Signed-off-by: Chen-Yu Tsai
Signed-off-by: Mark Brown
01 Nov, 2016
2 commits
-
This patch adds module licence to lpass-cpu driver, without this
patch lpass-cpu module would taint with below error:snd_soc_lpass_cpu: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
snd_soc_lpass_cpu: Unknown symbol regmap_write (err 0)
snd_soc_lpass_cpu: Unknown symbol devm_kmalloc (err 0)
...Signed-off-by: Srinivas Kandagatla
Acked-by: Kenneth Westfield
Signed-off-by: Mark Brown -
This patch fixes lpass-platform driver which was broken in v4.9-rc1.
lpass_pcm_data data structure holds information specific to stream.
Holding a single private pointer to it in global lpass_data
will not work, because it would be overwritten by for each pcm instance.This code was breaking playback when we have both playback and capture
pcm streams, as playback settings are over written by capture settings.Fix this by moving channel allocation logic out of pcm_new to pcm_open
so that we can store the stream specific information in private_data of
snd_pcm_runtime.Fixes: 6adcbdcd4b6e ("ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()")
Signed-off-by: Srinivas Kandagatla
Signed-off-by: Mark Brown
31 Oct, 2016
1 commit
-
When sun4i_codec_create_card fails, we do not assign a proper error
code to the return value. The return value would be 0 from the previous
function call, or we would have bailed out sooner. This would confuse
the driver core into thinking the device probe succeeded, when in fact
it didn't, leaving various devres based resources lingering.Make the create_card function pass back a meaningful error code, and
assign it to the return value.Fixes: 45fb6b6f2aa3 ("ASoC: sunxi: add support for the on-chip codec on
early Allwinner SoCs")
Signed-off-by: Chen-Yu Tsai
Signed-off-by: Mark Brown
29 Oct, 2016
4 commits
-
If a DAI specifies "#sound-dai-cells = " in device-tree then
hdmi_of_xlate_dai_name() will be called with zero args, which it isn't
implemented to cope with. The resulting use of an uninitialised variable
for the id will usually result in an error like:asoc-simple-card sound: parse error -11
asoc-simple-card: probe of sound failed with error -11Fix this by using and id of zero if no arg is provided.
Fixes: 9731f82d6016 ("ASoC: hdmi-codec: enable multi probe for same device")
Signed-off-by: Jon Medhurst
Signed-off-by: Mark Brown -
ASoC Samsung sub-drivers tried to get access to their DMA engine
controllers as a last step in driver probe. If a DMA engine was not
available yet, samsung_asoc_dma_platform_register() function ended in
-EPROBE_DEFER, but the driver already registered its component to ASoC
core. This patch moves samsung_asoc_dma_platform_register() call before
registering any components, to the common place, where driver was gathering
all needed resources.In case of Samsung Exynos i2s driver the issue was even worse. The driver
managed already to register its secondary DAI platform device before
even getting the DMA engine access. That together with -EPROBE_DEFER error
code from samsung_i2s_probe() immediately triggered another round of
deferred probe retry and in turn endless loop of driver probing.This patch fixes broken boot on Odroid XU3 and other Exynos5422-based
boards.Signed-off-by: Marek Szyprowski
Reviewed-by: Javier Martinez Canillas
Reviewed-by: Sylwester Nawrocki
Signed-off-by: Mark Brown -
da7219 output (for headset capture) should be set to high-impedance when
not in use, since it will otherwise interfere with output from other
codecs attached to the same DAI.Signed-off-by: Stephen Barber
Acked-by: Adam Thomson
Signed-off-by: Mark Brown -
HDMI codec is required to be powered up before controller initialization
for successful enumeration of codec. If the probe fails it needs to be
powered off to balance the power state of HDMI codec.This fix balances the reference count in the error path before turning
off the codec.Reported-by: Takashi Sakamoto
Signed-off-by: Sodhi, VunnyX
Signed-off-by: Subhransu S. Prusty
Signed-off-by: Mark Brown
27 Oct, 2016
1 commit
-
The stk1160 chip needs QUIRK_AUDIO_ALIGN_TRANSFER. This patch resolves
the issue reported on the mailing list
(http://marc.info/?l=linux-sound&m=139223599126215&w=2) and also fixes
bug 180071 (https://bugzilla.kernel.org/show_bug.cgi?id=180071).Signed-off-by: Marcel Hasler
Cc:
Signed-off-by: Takashi Iwai
26 Oct, 2016
2 commits
-
Some registers accesses are done in atomic context.
Enable fast io to use spinlock instead of mutex to protect access.Signed-off-by: Arnaud Pouliquen
Signed-off-by: Mark Brown -
If 'IEC958 Playback Default' control is updated during playback,
Channel status needs to be set according to the runtime structure.Signed-off-by: Arnaud Pouliquen
Signed-off-by: Mark Brown
25 Oct, 2016
4 commits
-
The recent rewrite of the sequencer time accounting using timespec64
in the commit [3915bf294652: ALSA: seq_timer: use monotonic times
internally] introduced a bad regression. Namely, the time reported
back doesn't increase but goes back and forth.The culprit was obvious: the delta is stored to the result (cur_time =
delta), instead of adding the delta (cur_time += delta)!Let's fix it.
Fixes: 3915bf294652 ('ALSA: seq_timer: use monotonic times internally')
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=177571
Reported-by: Yves Guillemot
Cc: # v4.8+
Signed-off-by: Takashi Iwai -
ASRock B150M Pro4/D3 mobo with ALC892 codec doesn't seem to provide
proper pins for the surround outputs, hence we need to specify the
pincfgs manually with a couple of other corrections.Reported-and-tested-by: Benjamin Valentin
Cc:
Signed-off-by: Takashi Iwai -
I rand into a new build error with SND_MMP_SOC_BROWNSTONE:
warning: (SND_MMP_SOC_BROWNSTONE && SND_SOC_SAMSUNG_SMDK_WM8994 && SND_SOC_SMDK_WM8994_PCM && SND_SOC_LITTLEMILL) selects MFD_WM8994 which has unmet direct dependencies (HAS_IOMEM && I2C)
drivers/mfd/wm8994-core.c:688:1: error: data definition has no type or storage class [-Werror]
drivers/mfd/wm8994-core.c:688:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]I don't see why this never showed up before, as the dependency seems to
have been missing since the symbol was first introduced several years
ago. This adds a dependency like the other drivers have.Signed-off-by: Arnd Bergmann
Signed-off-by: Mark Brown -
skl_probe() releases a runtime pm ref unconditionally wheras
skl_remove() acquires one only if the device is wakeup capable.
Thus if the device is not wakeup capable, unloading and reloading
the module will result in the refcount being decreased below 0.
Fix it.Fixes: d8c2dab8381d ("ASoC: Intel: Add Skylake HDA audio driver")
Signed-off-by: Lukas Wunner
Signed-off-by: Mark Brown
24 Oct, 2016
2 commits
-
Make sure dmi_system_id tables are NULL terminated.
Signed-off-by: Wei Yongjun
Signed-off-by: Mark Brown -
rt298_jack_detect may be called before card is instantiated. And
snd_soc_dapm_force_enable_pin will not work in that case. So, update
bit manually by regmap_update_bits.Signed-off-by: Bard Liao
Signed-off-by: Mark Brown
20 Oct, 2016
1 commit
-
They uses the codec ALC255, and have the different pin cfg definition
from the ones in the existing pin quirk table. Now adding them into
the table to fix the problem.Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang
Signed-off-by: Takashi Iwai
18 Oct, 2016
3 commits
-
Some elements in hr are not cleared before being copied to user space,
leaking kernel heap memory to user space. For example, this happens in
the error handling code for the HPI_ADAPTER_DELETE case. Zero the memory
before it's copied.Signed-off-by: Vlad Tsyrklevich
Signed-off-by: Takashi Iwai -
We have a new Dell laptop model which uses ALC295, the pin definition
is different from the existing ones in the pin quirk table, to fix the
headset mic detection and mic mute led's problem, we need to add the
new pin defintion into the pin quirk table.Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang
Signed-off-by: Takashi Iwai -
Commit 49d9e77e72cf ("ALSA: hda - Fix system panic when DMA > 40 bits
for Nvidia audio controllers") simply disabled any DMA exceeding 32
bits for NVidia devices, even though they are capable of performing
DMA up to 40 bits. On some architectures (such as arm64), system memory
is not guaranteed to be 32-bit addressable by PCI devices, and so this
change prevents NVidia devices from working on platforms such as AMD
Seattle.Since the original commit already mentioned that up to 40 bits of DMA
is supported, and given that the code has been updated in the meantime
to support a 40 bit DMA mask on other devices, revert commit 49d9e77e72cf
and explicitly set the DMA mask to 40 bits for NVidia devices.Fixes: 49d9e77e72cf ('ALSA: hda - Fix system panic when DMA > 40 bits...')
Signed-off-by: Ard Biesheuvel
Cc:
Signed-off-by: Takashi Iwai
16 Oct, 2016
1 commit
-
Pull sound fixes from Takashi Iwai:
"Just a few trivial small fixes"* tag 'sound-fix-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: line6: fix a crash in line6_hwdep_write()
ALSA: seq: fix passing wrong pointer in function call of compatibility layer
ALSA: hda - Fix a failure of micmute led when having multi adcs
ALSA: line6: Fix POD X3 Live audio input
13 Oct, 2016
4 commits
-
We increment "i" before printing the debug statement. That makes it
the wrong sleep_time[] information and Smatch complains that the last
increment could be beyond the end of the array.Signed-off-by: Dan Carpenter
Acked-by: Bard Liao
Signed-off-by: Mark Brown -
The error checking here is messed up so we could end up dereferencing
-EFAULT.Fixes: a16039cbf1a1 ('ALSA: line6: Add hwdep interface to access the POD control messages')
Signed-off-by: Dan Carpenter
Reviewed-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
This commit is a fix for Linux 4.9-rc1.
In former commit, a function call of compatibility layer for ALSA sequencer
core was obsoleted by an alternative. Although, the alternative gets a
pointer to kernel stack due to mis-programming. As a result, ALSA sequencer
core unexpectedly refers over kernel stack.Reported-by: Dan Carpenter
Fixes: 8ce8eb601c71 ("ALSA: seq: add an alternative way to handle ioctl requests")
Signed-off-by: Takashi Sakamoto
Signed-off-by: Takashi Iwai -
On a Dell laptop, there is no global adcs for all input devices, so
the input devices use the different adc, as a result, dyn_adc_switch
is set to true.In this situation, it is safe to control the micmute led according to
user's choice of muting/unmuting the current input device, since only
current input device path is active, while other input device paths
are inactive and powered down.Fixes: 00ef99408b6c ('ALSA: hda - add mic mute led hook for dell machines')
Cc:
Signed-off-by: Hui Wang
Signed-off-by: Takashi Iwai