18 Jul, 2016

1 commit

  • snd_usb_{set_interface,ctl_msg}_quirk checks chip->usb_id to need
    calling a quirks code. But existed code path that not calling
    dev_set_drvdata in usb_audio_probe.

    Fixes: 79289e24194a ("ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation")
    Signed-off-by: Kazuki Oikawa
    Cc: # v4.6+
    Reviewed-by: Takashi Sakamoto
    Tested-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Kazuki Oikawa
     

12 Jul, 2016

2 commits


08 Jul, 2016

3 commits

  • The chmap ctls assigned to PCM streams are freed in the PCM disconnect
    callback. However, since the disconnect callback isn't called when
    the card gets freed before registering, the chmap ctls may still be
    left assigned. They are eventually freed together with other ctls,
    but it may cause an Oops at pcm_chmap_ctl_private_free(), as the
    function refers to the assigned PCM stream, while the PCM objects have
    been already freed beforehand.

    The fix is to free the chmap ctls also at PCM free callback, not only
    at PCM disconnect.

    Reported-by: Laxminath Kasam
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • snd_ctl_remove() has a notification for the removal event. It's
    superfluous when done during the device got disconnected. Although
    the notification itself is mostly harmless, it may potentially be
    harmful, and should be suppressed. Actually some components PCM may
    free ctl elements during the disconnect or free callbacks, thus it's
    no theoretical issue.

    This patch adds the check of card->shutdown flag for avoiding
    unnecessary notifications after (or during) the disconnect.

    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • We have some Dell laptops which can't detect headset mic, the machines
    use the codec ALC225, they have some new pin configuration values,
    after adding them in the alc225 pin quirk table, they work well.

    Cc:
    Signed-off-by: Hui Wang
    Signed-off-by: Takashi Iwai

    Hui Wang
     

05 Jul, 2016

1 commit


04 Jul, 2016

1 commit

  • The user timer tu->qused counter may go to a negative value when
    multiple concurrent reads are performed since both the check and the
    decrement of tu->qused are done in two individual locked contexts.
    This results in bogus read outs, and the endless loop in the
    user-space side.

    The fix is to move the decrement of the tu->qused counter into the
    same spinlock context as the zero-check of the counter.

    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

02 Jul, 2016

5 commits


01 Jul, 2016

1 commit


30 Jun, 2016

1 commit

  • The i.MX51 datasheet says:
    Chapter 56.1.2.4 I2S Mode
    ...
    When I2S modes are entered (I2S master (01) or I2S slave (10)),
    the following settings are recommended:
    ...
    - TX Frame Rate should be 2 i.e. (STCCR[12:8] = 1)
    - RX Frame Rate should be 2 i.e. (SRCCR[12:8] = 1)

    Chapter 56.3.3.12 SSI Transmit and Receive Clock Control Registers (STCCR & SRCCR)
    ...
    Bits 12-8 DC4-DC0
    Frame Rate Divider Control. These bits are used to control the divide ratio
    for the programmable frame rate dividers. The divide ratio works on the word
    clock. In Normal mode, this ratio determines the word transfer rate.
    In Network mode, this ratio sets the number of words per frame. The divide
    ratio ranges from 1 to 32 in Normal mode and from 2 to 32 in Network mode.
    In Normal mode, a divide ratio of 1 (DC=00000) provides continuous periodic
    data word transfer. A bit-length frame sync must be used in this case.

    Function fsl_ssi_hw_params() setup Normal mode for MONO output,
    so with DC=0, SSI enters to continuous periodic data word transfer.
    To fix this, setup DC for any I2S mode.
    Patch has tested on custom board based on Digi CCMX-51 module (i.MX51).

    Signed-off-by: Alexander Shiyan
    Signed-off-by: Mark Brown

    Alexander Shiyan
     

29 Jun, 2016

2 commits


28 Jun, 2016

1 commit

  • 'commpage_bak' is allocated with 'sizeof(struct echoaudio)' bytes.
    We then copy 'sizeof(struct comm_page)' bytes in it.
    On my system, smatch complains because one is 2960 and the other is 3072.

    This would result in memory corruption or a oops.

    Signed-off-by: Christophe JAILLET
    Cc:
    Signed-off-by: Takashi Iwai

    Christophe JAILLET
     

26 Jun, 2016

2 commits

  • Now we correctly error an attempt to execute an unsupported operation.

    Signed-off-by: Alan Cox
    Signed-off-by: Vinod Koul
    Signed-off-by: Mark Brown

    Alan Cox
     
  • UBSAN reports the following warning from accessing path->path[-1]
    in set_path_power():

    [ 16.078040] ================================================================================
    [ 16.078124] UBSAN: Undefined behaviour in sound/pci/hda/hda_generic.c:3981:17
    [ 16.078198] index -1 is out of range for type 'hda_nid_t [10]'
    [ 16.078270] CPU: 2 PID: 1738 Comm: modprobe Not tainted 4.7.0-rc1-wt+ #47
    [ 16.078274] Hardware name: LENOVO 3443CTO/3443CTO, BIOS G6ET23WW (1.02 ) 08/14/2012
    [ 16.078278] ffff8800cb246000 ffff8800cb3638b8 ffffffff815c4fe3 0000000000000032
    [ 16.078286] ffff8800cb3638e0 ffffffffffffffff ffff8800cb3638d0 ffffffff8162443d
    [ 16.078294] ffffffffa0894200 ffff8800cb363920 ffffffff81624af7 0000000000000292
    [ 16.078302] Call Trace:
    [ 16.078311] [] dump_stack+0x86/0xd3
    [ 16.078317] [] ubsan_epilogue+0xd/0x40
    [ 16.078324] [] __ubsan_handle_out_of_bounds+0x67/0x70
    [ 16.078335] [] set_path_power+0x1bf/0x230 [snd_hda_codec_generic]
    [ 16.078344] [] add_pin_power_ctls+0x8d/0xc0 [snd_hda_codec_generic]
    [ 16.078352] [] ? pin_power_down_callback+0x20/0x20 [snd_hda_codec_generic]
    [ 16.078360] [] add_all_pin_power_ctls+0x107/0x150 [snd_hda_codec_generic]
    [ 16.078370] [] snd_hda_gen_parse_auto_config+0x2d73/0x49e0 [snd_hda_codec_generic]
    [ 16.078376] [] ? trace_hardirqs_on_caller+0x1b0/0x2c0
    [ 16.078390] [] alc_parse_auto_config+0x147/0x310 [snd_hda_codec_realtek]
    [ 16.078402] [] patch_alc269+0x23a/0x560 [snd_hda_codec_realtek]
    [ 16.078417] [] hda_codec_driver_probe+0xa4/0x1a0 [snd_hda_codec]
    [ 16.078424] [] driver_probe_device+0x101/0x380
    [ 16.078430] [] __driver_attach+0xb9/0x100
    [ 16.078438] [] ? driver_probe_device+0x380/0x380
    [ 16.078444] [] bus_for_each_dev+0x70/0xc0
    [ 16.078449] [] driver_attach+0x27/0x50
    [ 16.078454] [] bus_add_driver+0x166/0x2c0
    [ 16.078460] [] ? 0xffffffffa0369000
    [ 16.078465] [] driver_register+0x7d/0x130
    [ 16.078477] [] __hda_codec_driver_register+0x6f/0x90 [snd_hda_codec]
    [ 16.078488] [] realtek_driver_init+0x1e/0x1000 [snd_hda_codec_realtek]
    [ 16.078493] [] do_one_initcall+0x4e/0x1d0
    [ 16.078499] [] ? rcu_read_lock_sched_held+0x6d/0x80
    [ 16.078504] [] ? kmem_cache_alloc_trace+0x391/0x560
    [ 16.078510] [] ? do_init_module+0x28/0x273
    [ 16.078515] [] do_init_module+0x9b/0x273
    [ 16.078522] [] load_module+0x20b2/0x3410
    [ 16.078527] [] ? m_show+0x210/0x210
    [ 16.078533] [] ? kernel_read+0x66/0xe0
    [ 16.078541] [] SYSC_finit_module+0xba/0xc0
    [ 16.078547] [] SyS_finit_module+0xe/0x10
    [ 16.078552] [] entry_SYSCALL_64_fastpath+0x1f/0xbd
    [ 16.078556] ================================================================================

    Fix by checking path->depth before use.

    Signed-off-by: Bob Copeland
    Cc:
    Signed-off-by: Takashi Iwai

    Bob Copeland
     

24 Jun, 2016

3 commits

  • syzkaller fuzzer spotted a potential use-after-free case in snd-dummy
    driver when hrtimer is used as backend:
    > ==================================================================
    > BUG: KASAN: use-after-free in rb_erase+0x1b17/0x2010 at addr ffff88005e5b6f68
    > Read of size 8 by task syz-executor/8984
    > =============================================================================
    > BUG kmalloc-192 (Not tainted): kasan: bad access detected
    > -----------------------------------------------------------------------------
    >
    > Disabling lock debugging due to kernel taint
    > INFO: Allocated in 0xbbbbbbbbbbbbbbbb age=18446705582212484632
    > ....
    > [< none >] dummy_hrtimer_create+0x49/0x1a0 sound/drivers/dummy.c:464
    > ....
    > INFO: Freed in 0xfffd8e09 age=18446705496313138713 cpu=2164287125 pid=-1
    > [< none >] dummy_hrtimer_free+0x68/0x80 sound/drivers/dummy.c:481
    > ....
    > Call Trace:
    > [] __asan_report_load8_noabort+0x3e/0x40 mm/kasan/report.c:333
    > [< inline >] rb_set_parent include/linux/rbtree_augmented.h:111
    > [< inline >] __rb_erase_augmented include/linux/rbtree_augmented.h:218
    > [] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
    > [] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
    > [] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
    > [< inline >] remove_hrtimer kernel/time/hrtimer.c:945
    > [] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
    > [] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
    > [] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
    > [] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
    > [] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
    > [] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
    > [] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
    > [< inline >] snd_pcm_stop sound/core/pcm_native.c:1139
    > [] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
    > [] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
    > [] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
    > [] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
    > [] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
    > [] snd_pcm_oss_release+0x1ad/0x280 sound/core/oss/pcm_oss.c:2483
    > .....

    A workaround is to call hrtimer_cancel() in dummy_hrtimer_sync() which
    is called certainly before other blocking ops.

    Reported-by: Dmitry Vyukov
    Tested-by: Dmitry Vyukov
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • See: https://bugzilla.redhat.com/show_bug.cgi?id=1349539
    See: https://bugzilla.kernel.org/show_bug.cgi?id=120961

    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     
  • The new Dell laptop with codec 3246 can't detect headset mic when
    headset was inserted on the machine. So adding pin configurations
    into quirk table makes headset mic work correctly.

    Codec: Realtek ALC3246
    Vendor Id: 0x10ec0256
    Subsystem Id: 0x10280781

    Signed-off-by: Woodrow Shen
    Cc:
    Signed-off-by: Takashi Iwai

    Woodrow Shen
     

22 Jun, 2016

1 commit

  • The readl/writel are not being passed __iomem annotated
    variables, so fix the following sparse warnings by adding
    __iomem in:

    sound/pci/hda/hda_tegra.c:120:9: warning: incorrect type in argument 2 (different address spaces)
    sound/pci/hda/hda_tegra.c:120:9: expected void volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:120:9: got unsigned int [usertype] *addr
    sound/pci/hda/hda_tegra.c:125:16: warning: incorrect type in argument 1 (different address spaces)
    sound/pci/hda/hda_tegra.c:125:16: expected void const volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:125:16: got unsigned int [usertype] *addr
    sound/pci/hda/hda_tegra.c:134:13: warning: incorrect type in argument 1 (different address spaces)
    sound/pci/hda/hda_tegra.c:134:13: expected void const volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:134:13: got void *dword_addr
    sound/pci/hda/hda_tegra.c:137:9: warning: incorrect type in argument 2 (different address spaces)
    sound/pci/hda/hda_tegra.c:137:9: expected void volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:137:9: got void *dword_addr
    sound/pci/hda/hda_tegra.c:146:13: warning: incorrect type in argument 1 (different address spaces)
    sound/pci/hda/hda_tegra.c:146:13: expected void const volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:146:13: got void *dword_addr
    sound/pci/hda/hda_tegra.c:156:13: warning: incorrect type in argument 1 (different address spaces)
    sound/pci/hda/hda_tegra.c:156:13: expected void const volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:156:13: got void *dword_addr
    sound/pci/hda/hda_tegra.c:159:9: warning: incorrect type in argument 2 (different address spaces)
    sound/pci/hda/hda_tegra.c:159:9: expected void volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:159:9: got void *dword_addr
    sound/pci/hda/hda_tegra.c:168:13: warning: incorrect type in argument 1 (different address spaces)
    sound/pci/hda/hda_tegra.c:168:13: expected void const volatile [noderef] *addr
    sound/pci/hda/hda_tegra.c:168:13: got void *dword_addr
    sound/pci/hda/hda_tegra.c:173:23: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
    sound/pci/hda/hda_tegra.c:173:23: expected void ( *reg_writel )( ... )
    sound/pci/hda/hda_tegra.c:173:23: got void ( static [toplevel] * )( ... )
    sound/pci/hda/hda_tegra.c:174:22: warning: incorrect type in initializer (incompatible argument 1 (different address spaces))
    sound/pci/hda/hda_tegra.c:174:22: expected unsigned int ( *reg_readl )( ... )
    sound/pci/hda/hda_tegra.c:174:22: got unsigned int ( static [toplevel] * )( ... )
    sound/pci/hda/hda_tegra.c:175:23: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
    sound/pci/hda/hda_tegra.c:175:23: expected void ( *reg_writew )( ... )
    sound/pci/hda/hda_tegra.c:175:23: got void ( static [toplevel] * )( ... )
    sound/pci/hda/hda_tegra.c:176:22: warning: incorrect type in initializer (incompatible argument 1 (different address spaces))
    sound/pci/hda/hda_tegra.c:176:22: expected unsigned short ( *reg_readw )( ... )
    sound/pci/hda/hda_tegra.c:176:22: got unsigned short ( static [toplevel] * )( ... )
    sound/pci/hda/hda_tegra.c:177:23: warning: incorrect type in initializer (incompatible argument 2 (different address spaces))
    sound/pci/hda/hda_tegra.c:177:23: expected void ( *reg_writeb )( ... )
    sound/pci/hda/hda_tegra.c:177:23: got void ( static [toplevel] * )( ... )
    sound/pci/hda/hda_tegra.c:178:22: warning: incorrect type in initializer (incompatible argument 1 (different address spaces))
    sound/pci/hda/hda_tegra.c:178:22: expected unsigned char ( *reg_readb )( ... )
    sound/pci/hda/hda_tegra.c:178:22: got unsigned char ( static [toplevel] * )( ... )

    Signed-off-by: Ben Dooks
    Acked-by: Thierry Reding
    Signed-off-by: Takashi Iwai

    Ben Dooks
     

17 Jun, 2016

4 commits

  • Call path:

    1) snd_hdac_power_up_pm()
    2) snd_hdac_power_up()
    3) pm_runtime_get_sync()
    4) __pm_runtime_resume()
    5) rpm_resume()

    The rpm_resume() returns 1 when the device is already active.
    Because the return value is unmodified, the hdac regmap read/write
    functions should allow this value for the retry I/O operation, too.

    Signed-off-by: Jaroslav Kysela
    Cc:
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     
  • Commit 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc"),
    introduced in v3.10, revealed a bug in the cx20442 codec driver
    which has never been setting tty->receive_room on line discipline
    open as it should from the beginning. Fix it.

    Created and tested on Amstrad Delta against Linux-4.7-rc3

    Signed-off-by: Janusz Krzysztofik
    Signed-off-by: Mark Brown

    Janusz Krzysztofik
     
  • During system resume:

    kernel BUG at drivers/base/regmap/regcache.c:347!
    ...
    PC is at regcache_sync+0x1c/0x128
    LR is at ak4613_resume+0x28/0x34

    The ak4613 driver is using a regmap cache sync to restore the
    configuration of the chip on resume but does not actually define a
    register cache which means that the resume is never going to work and we
    trigger asserts in regmap. Fix this by enabling caching.

    Based on commit d3030d11961a8c10 ("ASoC: ak4642: Enable cache usage to
    fix crashes on resume") by Mark Brown .

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Mark Brown

    Geert Uytterhoeven
     
  • The wm8940 driver is using a regmap cache sync to restore the
    configuration of the chip when switching from OFF to STANDBY, but does
    not actually define a register cache which means that the restore is
    never going to work and we trigger asserts in regmap. Fix this by
    enabling caching.

    Based on commit d3030d11961a8c10 ("ASoC: ak4642: Enable cache usage to
    fix crashes on resume") by Mark Brown .

    Signed-off-by: Geert Uytterhoeven
    Acked-by: Charles Keepax
    Signed-off-by: Mark Brown

    Geert Uytterhoeven
     

15 Jun, 2016

1 commit


13 Jun, 2016

2 commits


09 Jun, 2016

1 commit


07 Jun, 2016

2 commits


03 Jun, 2016

1 commit


02 Jun, 2016

2 commits

  • SND_SOC_HDMI_CODEC can be enabled without HDMI support, leading
    to a link error:

    In function `hdmi_codec_hw_params':
    sound/soc/codecs/hdmi-codec.c:188: undefined reference to `hdmi_audio_infoframe_init'
    sound/built-in.o:(.debug_addr+0x1a5c0): undefined reference to `hdmi_audio_infoframe_init'

    This changes the Kconfig file to select HDMI, as the other codec using
    hdmi_audio_infoframe_init already does.

    Signed-off-by: Arnd Bergmann
    Acked-by: Jyri Sarha
    Signed-off-by: Mark Brown

    Arnd Bergmann
     
  • The TX and RX offset is different for each serializers when using the CFG
    port for DMA access.
    When using the CFG port only one serializer can be used per direction so
    print error message and only configure the first serializer's offset.

    Reported-by: Misael Lopez Cruz
    Suggested-by: Misael Lopez Cruz
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Mark Brown

    Peter Ujfalusi
     

31 May, 2016

1 commit

  • Static checker warns:
    Pointer 'hlink' returned from call to function 'snd_hdac_ext_bus_get_link'
    at line may be NULL and will be dereferenced"

    So we should always check the return of snd_hdac_ext_bus_get_link() before
    referencing the link pointer

    Signed-off-by: Vinod Koul
    Signed-off-by: Mark Brown

    Vinod Koul
     

30 May, 2016

2 commits