12 Jan, 2017

4 commits

  • commit 5faf071d08ddd1c1be66deaa93a09ccf43f5b538 upstream.

    Unfortunately, I seem to have missed a case where an IRQ safe spinlock was
    required, in samsung_i2s_dai_remove, when I fixed up the other calls in
    this patch:

    316fa9e09ad7 ("ASoC: samsung: Use IRQ safe spin lock calls")

    This causes a lockdep warning when unbinding and rebinding the audio card:

    [ 104.357664] CPU0 CPU1
    [ 104.362174] ---- ----
    [ 104.366692] lock(&(&pri_dai->spinlock)->rlock);
    [ 104.371372] local_irq_disable();
    [ 104.377283] lock(&(&substream->self_group.lock)->rlock);
    [ 104.385259] lock(&(&pri_dai->spinlock)->rlock);
    [ 104.392469]
    [ 104.395072] lock(&(&substream->self_group.lock)->rlock);
    [ 104.400710]
    [ 104.400710] *** DEADLOCK ***

    Fixes: ce8bcdbb61d9 ("ASoC: samsung: i2s: Protect more registers with a spinlock")
    Signed-off-by: Charles Keepax
    Reviewed-by: Krzysztof Kozlowski
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     
  • commit c8eabf821cac120afb78ca251b07cbf520406a7e upstream.

    "*val" is a u64. It definitely looks like we intend to use the high 32
    bits as well.

    Fixes: 700a9a63f9c1 ("ASoC: Intel: Skylake: Add module instance id generation APIs")
    Signed-off-by: Dan Carpenter
    Acked-by: Vinod Koul
    Tested-by: Kranthi G
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit a823a17981a73faa115bc0f7eda0190763075e2c upstream.

    cht_bsw_rt5645 driver allocates the own codec_id string but doesn't
    release it. For simplicity, put the string in cht_mc_private; then
    the string is allocated in a shot and released altogether.

    Fixes: c8560b7c917f ("ASoC: cht_bsw_rt5645: Fix writing to string literal")
    Signed-off-by: Takashi Iwai
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     
  • commit 3b89e4b77ef9c2f985964fab17032db98f074ed0 upstream.

    A bugfix accidentally removed the implicit initialization of the
    dma channel number, causing undefined behavior when
    v->alloc_dma_channel is NULL:

    sound/soc/qcom/lpass-platform.c: In function ‘lpass_platform_pcmops_open’:
    sound/soc/qcom/lpass-platform.c:83:29: error: ‘dma_ch’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

    This adds back an explicit initialization to zero, restoring the
    previous behavior for that case.

    Fixes: 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")
    Signed-off-by: Arnd Bergmann
    Acked-by: Kenneth Westfield
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

06 Jan, 2017

1 commit

  • commit 2fc995a87f2efcd803438f07bfecd35cc3d90d32 upstream.

    When ASoC Intel SST Medfield driver is probed but without codec / card
    assigned, it causes an Oops and freezes the kernel at suspend/resume,

    PM: Suspending system (freeze)
    Suspending console(s) (use no_console_suspend to debug)
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
    IP: [] sst_soc_prepare+0x19/0xa0 [snd_soc_sst_mfld_platform]
    Oops: 0000 [#1] PREEMPT SMP
    CPU: 0 PID: 1552 Comm: systemd-sleep Tainted: G W 4.9.0-rc6-1.g5f5c2ad-default #1
    Call Trace:
    [] dpm_prepare+0x209/0x460
    [] dpm_suspend_start+0x11/0x60
    [] suspend_devices_and_enter+0xb2/0x710
    [] pm_suspend+0x30e/0x390
    [] state_store+0x8a/0x90
    [] kobj_attr_store+0xf/0x20
    [] sysfs_kf_write+0x37/0x40
    [] kernfs_fop_write+0x11c/0x1b0
    [] __vfs_write+0x28/0x140
    [] ? apparmor_file_permission+0x18/0x20
    [] ? security_file_permission+0x3b/0xc0
    [] vfs_write+0xb5/0x1a0
    [] SyS_write+0x46/0xa0
    [] entry_SYSCALL_64_fastpath+0x1e/0xad

    Add proper NULL checks in the PM code of mdfld driver.

    Signed-off-by: Takashi Iwai
    Acked-by: Vinod Koul
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

15 Nov, 2016

1 commit

  • 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

    Linus Torvalds
     

05 Nov, 2016

3 commits


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

    Sylwester Nawrocki
     
  • 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

    Chen-Yu Tsai
     

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

    Srinivas Kandagatla
     
  • 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

    Srinivas Kandagatla
     

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

    Chen-Yu Tsai
     

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 -11

    Fix 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

    Jon Medhurst (Tixy)
     
  • 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

    Marek Szyprowski
     
  • 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

    Stephen Barber
     
  • 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

    Sodhi, VunnyX
     

26 Oct, 2016

2 commits


25 Oct, 2016

2 commits

  • 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

    Arnd Bergmann
     
  • 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

    Lukas Wunner
     

24 Oct, 2016

2 commits


13 Oct, 2016

1 commit

  • 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

    Dan Carpenter
     

12 Oct, 2016

2 commits

  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • A good practice is to prefix the names of functions by the name
    of the subsystem.

    The kthread worker API is a mix of classic kthreads and workqueues. Each
    worker has a dedicated kthread. It runs a generic function that process
    queued works. It is implemented as part of the kthread subsystem.

    This patch renames the existing kthread worker API to use
    the corresponding name from the workqueues API prefixed by
    kthread_:

    __init_kthread_worker() -> __kthread_init_worker()
    init_kthread_worker() -> kthread_init_worker()
    init_kthread_work() -> kthread_init_work()
    insert_kthread_work() -> kthread_insert_work()
    queue_kthread_work() -> kthread_queue_work()
    flush_kthread_work() -> kthread_flush_work()
    flush_kthread_worker() -> kthread_flush_worker()

    Note that the names of DEFINE_KTHREAD_WORK*() macros stay
    as they are. It is common that the "DEFINE_" prefix has
    precedence over the subsystem names.

    Note that INIT() macros and init() functions use different
    naming scheme. There is no good solution. There are several
    reasons for this solution:

    + "init" in the function names stands for the verb "initialize"
    aka "initialize worker". While "INIT" in the macro names
    stands for the noun "INITIALIZER" aka "worker initializer".

    + INIT() macros are used only in DEFINE() macros

    + init() functions are used close to the other kthread()
    functions. It looks much better if all the functions
    use the same scheme.

    + There will be also kthread_destroy_worker() that will
    be used close to kthread_cancel_work(). It is related
    to the init() function. Again it looks better if all
    functions use the same naming scheme.

    + there are several precedents for such init() function
    names, e.g. amd_iommu_init_device(), free_area_init_node(),
    jump_label_init_type(), regmap_init_mmio_clk(),

    + It is not an argument but it was inconsistent even before.

    [arnd@arndb.de: fix linux-next merge conflict]
    Link: http://lkml.kernel.org/r/20160908135724.1311726-1-arnd@arndb.de
    Link: http://lkml.kernel.org/r/1470754545-17632-3-git-send-email-pmladek@suse.com
    Suggested-by: Andrew Morton
    Signed-off-by: Petr Mladek
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: "Paul E. McKenney"
    Cc: Josh Triplett
    Cc: Thomas Gleixner
    Cc: Jiri Kosina
    Cc: Borislav Petkov
    Cc: Michal Hocko
    Cc: Vlastimil Babka
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Petr Mladek
     

11 Oct, 2016

2 commits

  • Mismatching stream names in DAPM route and widget definitions are
    causing compilation errors. Fixing these names allows the cs4270
    driver to compile and function.

    [Errors must be at probe time not compile time -- broonie]

    Signed-off-by: Murray Foster
    Acked-by: Paul Handrigan
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    murray foster
     
  • The Intel Haswell audio support fails to link if
    CONFIG_SND_SOC_INTEL_SST_FIRMWARE is disabled:

    sst-haswell-dsp.c: undefined reference to `sst_mem_block_register'
    sst-haswell-dsp.c: undefined reference to `sst_mem_block_unregister_all'
    sst-haswell-dsp.c: undefined reference to `sst_module_alloc_blocks'
    sst-haswell-dsp.c: undefined reference to `sst_module_free'
    sst-haswell-dsp.c: undefined reference to `sst_module_new'
    sst-haswell-pcm.c: undefined reference to `sst_module_get_from_id'
    sst-haswell-pcm.c: undefined reference to `sst_module_runtime_restore'
    sst-haswell-pcm.c: undefined reference to `sst_module_runtime_save'
    ERROR: "sst_block_alloc_scratch" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_block_free_scratch" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_dma_copyfrom" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_dma_copyto" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_dma_get_channel" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_dma_put_channel" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_free" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_get_offset" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_dsp_new" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_fw_free_all" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_fw_new" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_fw_reload" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_fw_unload" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_module_runtime_alloc_blocks" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_module_runtime_get_from_id" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!
    ERROR: "sst_module_runtime_new" [sound/soc/intel/haswell/snd-soc-sst-haswell-pcm.ko] undefined!

    This moves the 'select' statement from two of the three haswell based users
    into the line that is used by all of them, so make it harder to get wrong
    and to fix the existing randconfig regressions.

    Fixes: 2d995e5dc283 ("ASoC: Intel: boards: Add bdw-rt5677 machine driver")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Arnd Bergmann
     

06 Oct, 2016

1 commit


04 Oct, 2016

4 commits

  • The set_bias_level toggles the PDN signal when entering
    SND_SOC_BIAS_STANDBY and SND_SOC_BIAS_OFF. However this has no effect and
    actually breaks things down (tested with TAS5717) due to the following
    reasons:

    1) holding down PDN does not save power but holding down RST does
    2) now hard mute via register 0x5 is implemented and therefore it is no
    longer needed to toggle PDN to enter all channel shut down
    3) in order to leave PDN it is required to toggle the RST signal (see
    TAS5721 datasheet), which was not implemented
    4) toggling PDN as implemented actually mutes PWMs and there is no audio
    output (tested on TAS5717)

    For these reasons remove the PDN signal toggling and just initialize it to
    inactive in probe().

    Signed-off-by: Petr Kulhavy
    Signed-off-by: Mark Brown

    Petr Kulhavy
     
  • TAS5721 datasheet recommends to wait at least 13.5ms after deasserting the
    RESET signal. For TAS5717 this time is only 12ms, which was the original
    value in the code.

    Extend the wait time after deasserting RESET from 12 to 13.5ms to comply
    with the TAS5721 specification.

    Signed-off-by: Petr Kulhavy
    Signed-off-by: Mark Brown

    Petr Kulhavy
     
  • Channel 1 and 2 Mixer Volume controls (registers 0x72/0x73 and 0x76/0x77)
    were wrongly assigned to tas5711_controls in commit f252d2346022
    ("ASoC: tas571x: add input channel mixer for TAS5717/19")

    Therefore move them to tas5717_controls.

    Signed-off-by: Petr Kulhavy
    Signed-off-by: Mark Brown

    Petr Kulhavy
     
  • Wait extra 50ms after writing the oscillator trim register in probe(), as
    recommended by the TAS5721 and TAS5711 datasheets.

    Signed-off-by: Petr Kulhavy
    Signed-off-by: Mark Brown

    Petr Kulhavy
     

01 Oct, 2016

1 commit


30 Sep, 2016

5 commits