1. 05 7月, 2016 1 次提交
  2. 04 7月, 2016 1 次提交
    • T
      ALSA: timer: Fix negative queue usage by racy accesses · 3fa6993f
      Takashi Iwai 提交于
      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: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      3fa6993f
  3. 01 7月, 2016 1 次提交
  4. 30 6月, 2016 1 次提交
    • A
      ASoC: fsl_ssi: Fix number of words per frame for I2S-slave mode · 4f14f5c1
      Alexander Shiyan 提交于
      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: NAlexander Shiyan <shc_work@mail.ru>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4f14f5c1
  5. 29 6月, 2016 2 次提交
  6. 28 6月, 2016 1 次提交
  7. 26 6月, 2016 2 次提交
    • A
      ASoC: Intel: atom: fix missing breaks that would cause the wrong operation to execute · 18f58399
      Alan Cox 提交于
      Now we correctly error an attempt to execute an unsupported operation.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      18f58399
    • B
      ALSA: hda - fix read before array start · 81e43960
      Bob Copeland 提交于
      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]  [<ffffffff815c4fe3>] dump_stack+0x86/0xd3
      [   16.078317]  [<ffffffff8162443d>] ubsan_epilogue+0xd/0x40
      [   16.078324]  [<ffffffff81624af7>] __ubsan_handle_out_of_bounds+0x67/0x70
      [   16.078335]  [<ffffffffa087665f>] set_path_power+0x1bf/0x230 [snd_hda_codec_generic]
      [   16.078344]  [<ffffffffa087880d>] add_pin_power_ctls+0x8d/0xc0 [snd_hda_codec_generic]
      [   16.078352]  [<ffffffffa087f190>] ? pin_power_down_callback+0x20/0x20 [snd_hda_codec_generic]
      [   16.078360]  [<ffffffffa0878947>] add_all_pin_power_ctls+0x107/0x150 [snd_hda_codec_generic]
      [   16.078370]  [<ffffffffa08842b3>] snd_hda_gen_parse_auto_config+0x2d73/0x49e0 [snd_hda_codec_generic]
      [   16.078376]  [<ffffffff81173360>] ? trace_hardirqs_on_caller+0x1b0/0x2c0
      [   16.078390]  [<ffffffffa089df27>] alc_parse_auto_config+0x147/0x310 [snd_hda_codec_realtek]
      [   16.078402]  [<ffffffffa08a332a>] patch_alc269+0x23a/0x560 [snd_hda_codec_realtek]
      [   16.078417]  [<ffffffffa0838644>] hda_codec_driver_probe+0xa4/0x1a0 [snd_hda_codec]
      [   16.078424]  [<ffffffff817bbac1>] driver_probe_device+0x101/0x380
      [   16.078430]  [<ffffffff817bbdf9>] __driver_attach+0xb9/0x100
      [   16.078438]  [<ffffffff817bbd40>] ? driver_probe_device+0x380/0x380
      [   16.078444]  [<ffffffff817b8d20>] bus_for_each_dev+0x70/0xc0
      [   16.078449]  [<ffffffff817bb087>] driver_attach+0x27/0x50
      [   16.078454]  [<ffffffff817ba956>] bus_add_driver+0x166/0x2c0
      [   16.078460]  [<ffffffffa0369000>] ? 0xffffffffa0369000
      [   16.078465]  [<ffffffff817bd13d>] driver_register+0x7d/0x130
      [   16.078477]  [<ffffffffa083816f>] __hda_codec_driver_register+0x6f/0x90 [snd_hda_codec]
      [   16.078488]  [<ffffffffa036901e>] realtek_driver_init+0x1e/0x1000 [snd_hda_codec_realtek]
      [   16.078493]  [<ffffffff8100215e>] do_one_initcall+0x4e/0x1d0
      [   16.078499]  [<ffffffff8119f54d>] ? rcu_read_lock_sched_held+0x6d/0x80
      [   16.078504]  [<ffffffff813701b1>] ? kmem_cache_alloc_trace+0x391/0x560
      [   16.078510]  [<ffffffff812bb314>] ? do_init_module+0x28/0x273
      [   16.078515]  [<ffffffff812bb387>] do_init_module+0x9b/0x273
      [   16.078522]  [<ffffffff811e3782>] load_module+0x20b2/0x3410
      [   16.078527]  [<ffffffff811df140>] ? m_show+0x210/0x210
      [   16.078533]  [<ffffffff813b2b26>] ? kernel_read+0x66/0xe0
      [   16.078541]  [<ffffffff811e4cfa>] SYSC_finit_module+0xba/0xc0
      [   16.078547]  [<ffffffff811e4d1e>] SyS_finit_module+0xe/0x10
      [   16.078552]  [<ffffffff81a860fc>] entry_SYSCALL_64_fastpath+0x1f/0xbd
      [   16.078556] ================================================================================
      
      Fix by checking path->depth before use.
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      81e43960
  8. 24 6月, 2016 3 次提交
    • T
      ALSA: dummy: Fix a use-after-free at closing · d5dbbe65
      Takashi Iwai 提交于
      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:
      >  [<ffffffff8179e59e>] __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
      >  [<ffffffff82ca5787>] rb_erase+0x1b17/0x2010 lib/rbtree.c:427
      >  [<ffffffff82cb02e8>] timerqueue_del+0x78/0x170 lib/timerqueue.c:86
      >  [<ffffffff814d0c80>] __remove_hrtimer+0x90/0x220 kernel/time/hrtimer.c:903
      >  [<     inline     >] remove_hrtimer kernel/time/hrtimer.c:945
      >  [<ffffffff814d23da>] hrtimer_try_to_cancel+0x22a/0x570 kernel/time/hrtimer.c:1046
      >  [<ffffffff814d2742>] hrtimer_cancel+0x22/0x40 kernel/time/hrtimer.c:1066
      >  [<ffffffff85420531>] dummy_hrtimer_stop+0x91/0xb0 sound/drivers/dummy.c:417
      >  [<ffffffff854228bf>] dummy_pcm_trigger+0x17f/0x1e0 sound/drivers/dummy.c:507
      >  [<ffffffff85392170>] snd_pcm_do_stop+0x160/0x1b0 sound/core/pcm_native.c:1106
      >  [<ffffffff85391b26>] snd_pcm_action_single+0x76/0x120 sound/core/pcm_native.c:956
      >  [<ffffffff85391e01>] snd_pcm_action+0x231/0x290 sound/core/pcm_native.c:974
      >  [<     inline     >] snd_pcm_stop sound/core/pcm_native.c:1139
      >  [<ffffffff8539754d>] snd_pcm_drop+0x12d/0x1d0 sound/core/pcm_native.c:1784
      >  [<ffffffff8539d3be>] snd_pcm_common_ioctl1+0xfae/0x2150 sound/core/pcm_native.c:2805
      >  [<ffffffff8539ee91>] snd_pcm_capture_ioctl1+0x2a1/0x5e0 sound/core/pcm_native.c:2976
      >  [<ffffffff8539f2ec>] snd_pcm_kernel_ioctl+0x11c/0x160 sound/core/pcm_native.c:3020
      >  [<ffffffff853d9a44>] snd_pcm_oss_sync+0x3a4/0xa30 sound/core/oss/pcm_oss.c:1693
      >  [<ffffffff853da27d>] 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: NDmitry Vyukov <dvyukov@google.com>
      Tested-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      d5dbbe65
    • J
    • W
      ALSA: hda - Fix the headset mic jack detection on Dell machine · f83c3292
      Woodrow Shen 提交于
      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: NWoodrow Shen <woodrow.shen@canonical.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      f83c3292
  9. 22 6月, 2016 1 次提交
    • B
      ALSA: hda/tegra: iomem fixups for sparse warnings · c9058d43
      Ben Dooks 提交于
      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] <asn:2>*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] <asn:2>*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] <asn:2>*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] <asn:2>*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] <asn:2>*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] <asn:2>*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] <asn:2>*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] <asn:2>*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] *<noident> )( ... )
      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] *<noident> )( ... )
      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] *<noident> )( ... )
      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] *<noident> )( ... )
      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] *<noident> )( ... )
      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] *<noident> )( ... )
      Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c9058d43
  10. 17 6月, 2016 4 次提交
  11. 15 6月, 2016 1 次提交
  12. 13 6月, 2016 2 次提交
  13. 09 6月, 2016 1 次提交
  14. 07 6月, 2016 2 次提交
  15. 03 6月, 2016 1 次提交
  16. 02 6月, 2016 2 次提交
  17. 31 5月, 2016 1 次提交
  18. 30 5月, 2016 3 次提交
  19. 28 5月, 2016 2 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
    • K
      ASoC: rsnd: open 31bit of SSICKR mask · 4f353250
      Kuninori Morimoto 提交于
      SSICKR (Gen2) / BRGCKR (Gen3) 31bit mask should be opened,
      because BRGB (= for 48kHz) might select it.
      Special thanks Yokoyama-san
      Reported-by: NHiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      4f353250
  20. 25 5月, 2016 1 次提交
  21. 24 5月, 2016 2 次提交
  22. 20 5月, 2016 1 次提交
  23. 19 5月, 2016 2 次提交
  24. 18 5月, 2016 2 次提交
    • T
      ALSA: firewire-lib: change a member of event structure to suppress sparse wanings to bool type · 17e1717c
      Takashi Sakamoto 提交于
      Commit a9c4284b ("ALSA: firewire-lib: add context information to
      tracepoints") adds new members to tracepoint events of this module, to
      represent context information. One of the members is bool type and
      this causes sparse warnings.
      
      16:1: warning: expression using sizeof bool
      60:1: warning: expression using sizeof bool
      16:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      60:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      
      This commit suppresses the warnings, by changing type of the member
      to 'unsigned int'. Additionally, this commit applies '!!' idiom to
      get 0/1 from 'in_interrupt()'.
      
      Fixes: a9c4284b ("ALSA: firewire-lib: add context information to tracepoints")
      Signed-off-by: NTakashi Sakamoto <o-takashi@sakamocchi.jp>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      17e1717c
    • M
      sound: oss: Use setup_timer and mod_timer. · c7c5856b
      Muhammad Falak R Wani 提交于
      The function setup_timer combines the initialization of a timer with the
      initialization of the timer's function and data fields. The mulitiline
      code for timer initialization is now replaced with function setup_timer.
      
      Also, quoting the mod_timer() function comment:
      -> mod_timer() is a more efficient way to update the expire field of an
         active timer (if the timer is inactive it will be activated).
      
      Use setup_timer() and mod_timer() to setup and arm a timer, making the
      code compact and aid readablity.
      Signed-off-by: NMuhammad Falak R Wani <falakreyaz@gmail.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      c7c5856b