06 Sep, 2018

2 commits

  • Current rsnd driver will fallback to PIO mode if it can't get DMA
    handler. But, DMA might return -EPROBE_DEFER when probe timing.
    This driver always fallback to PIO mode especially from
    commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because
    of this reason.

    The DMA driver will be probed later, but sound driver might be
    probed as PIO mode in such case. This patch fixup this issue.
    Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error
    message in such case.
    And it needs to call rsnd_adg_remove() individually if probe failed,
    because it registers clk which should be unregister.

    Maybe PIO fallback feature itself is not needed,
    but let's keep it so far.

    Signed-off-by: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     
  • ADG has buffer over flow bug if DT has more than 3 clock-frequency.
    This patch fixup this issue, and uses first 2 values.

    clock-frequency = ; /* this is OK */
    clock-frequency = ; /* this is NG */

    Signed-off-by: Kuninori Morimoto
    Tested-by: Hiroyuki Yokoyama
    Signed-off-by: Mark Brown

    Kuninori Morimoto
     

05 Sep, 2018

1 commit


03 Sep, 2018

2 commits

  • Clocking operations clk_get/set_rate, are non-atomic,
    they shouldn't be called in soc_pcm_trigger() which is atomic.

    Following issue was found due to execution of clk_get_rate() causes
    sleep in soc_pcm_trigger(), which shouldn't be blocked.

    We can reproduce this issue by following
    > enable CONFIG_DEBUG_ATOMIC_SLEEP=y
    > compile, and boot
    > mount -t debugfs none /sys/kernel/debug
    > while true; do cat /sys/kernel/debug/clk/clk_summary > /dev/null; done &
    > while true; do aplay xxx; done

    This patch adds support to .prepare callback, and moves non-atomic
    clocking operations to it. As .prepare is non-atomic, it is always
    called before trigger_start/trigger_stop.

    BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
    in_atomic(): 1, irqs_disabled(): 128, pid: 2242, name: aplay
    INFO: lockdep is turned off.
    irq event stamp: 5964
    hardirqs last enabled at (5963): [] mutex_lock_nested+0x6e8/0x6f0
    hardirqs last disabled at (5964): [] _raw_spin_lock_irqsave+0x24/0x68
    softirqs last enabled at (5502): [] __do_softirq+0x560/0x10c0
    softirqs last disabled at (5495): [] irq_exit+0x160/0x25c
    Preemption disabled at:[ 62.904063] [] snd_pcm_stream_lock+0xb4/0xc0
    CPU: 2 PID: 2242 Comm: aplay Tainted: G B C 4.9.54+ #186
    Hardware name: Renesas Salvator-X board based on r8a7795 (DT)
    Call trace:
    [] dump_backtrace+0x0/0x37c
    [] show_stack+0x14/0x1c
    [] dump_stack+0xfc/0x154
    [] ___might_sleep+0x57c/0x58c
    [] __might_sleep+0x208/0x21c
    [] mutex_lock_nested+0xb4/0x6f0
    [] clk_prepare_lock+0xb0/0x184
    [] clk_core_get_rate+0x14/0x54
    [] clk_get_rate+0x20/0x34
    [] rsnd_adg_ssi_clk_try_start+0x158/0x4f8 [snd_soc_rcar]
    [] rsnd_ssi_init+0x668/0x7a0 [snd_soc_rcar]
    [] rsnd_soc_dai_trigger+0x4bc/0xcf8 [snd_soc_rcar]
    [] soc_pcm_trigger+0x2a4/0x2d4

    Fixes: e7d850dd10f4 ("ASoC: rsnd: use mod base common method on SSI-parent")
    Signed-off-by: Jiada Wang
    Signed-off-by: Timo Wischer
    [Kuninori: tidyup for upstream]
    Signed-off-by: Kuninori Morimoto
    Tested-by: Hiroyuki Yokoyama
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Jiada Wang
     
  • Some of the router data fields are left as default zeros which are
    valid dai ids, so initialize these to invalid value of -1.

    Without intializing these correctly get_session_from_id() can return
    incorrect session resulting in not closing the opened copp and messing
    up with the copp ref count.

    Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver")
    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Mark Brown

    Srinivas Kandagatla
     

31 Aug, 2018

1 commit

  • When there is no fault bit set in a fault register we skip the fault
    reporting section for that register. This also skips over saving that
    registers value. We save the value so we will not double report an
    error, but if an error clears then returns we will also not report it
    as we did not save the all cleared register value. Fix this by saving
    the fault register value in the all clear path.

    Signed-off-by: Andrew F. Davis
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Andrew F. Davis
     

29 Aug, 2018

4 commits


16 Aug, 2018

2 commits


15 Aug, 2018

1 commit

  • Commit a655de808cbde ("ASoC: core: Allow topology to override
    machine driver FE DAI link config.") caused soc_dai_hw_params to
    be come dependent on the substream private_data being set with
    a pointer to the snd_soc_pcm_runtime. Currently, CODEC to CODEC
    links don't set this, which causes a NULL pointer dereference:

    [] (soc_dai_hw_params) from
    [] (snd_soc_dai_link_event+0x1a0/0x380)

    Since the ASoC core in general assumes that the substream
    private_data will be set to a pointer to the snd_soc_pcm_runtime,
    update the CODEC to CODEC links to respect this.

    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown

    Charles Keepax
     

14 Aug, 2018

4 commits

  • Cold reboot stress test found that the hda irq could access rirb ring
    buffer before its memory gets allocated which resulting in null
    pointer dereference inside snd_hdac_bus_update_rirb().

    Fix it by moving the skl_acquire_irq after ring buffer allocation.
    While here, also change err return from -EBUSY to actual error code.

    Signed-off-by: Yong Zhi
    Acked-by: Pierre-Louis Bossart
    Signed-off-by: Mark Brown

    Yong Zhi
     
  • Include and consistently use types it provides
    to fix the following sound/skl-tplg-interface.h userspace compilation errors:

    /usr/include/sound/skl-tplg-interface.h:146:2: error: unknown type name 'u32'
    u32 set_params:2;
    /usr/include/sound/skl-tplg-interface.h:147:2: error: unknown type name 'u32'
    u32 rsvd:30;
    /usr/include/sound/skl-tplg-interface.h:148:2: error: unknown type name 'u32'
    u32 param_id;
    /usr/include/sound/skl-tplg-interface.h:149:2: error: unknown type name 'u32'
    u32 max;
    /usr/include/sound/skl-tplg-interface.h:166:2: error: unknown type name 'u16'
    u16 module_id;
    /usr/include/sound/skl-tplg-interface.h:167:2: error: unknown type name 'u16'
    u16 instance_id;
    /usr/include/sound/skl-tplg-interface.h:171:2: error: unknown type name 'u32'
    u32 channels;
    /usr/include/sound/skl-tplg-interface.h:172:2: error: unknown type name 'u32'
    u32 freq;
    /usr/include/sound/skl-tplg-interface.h:173:2: error: unknown type name 'u32'
    u32 bit_depth;
    /usr/include/sound/skl-tplg-interface.h:174:2: error: unknown type name 'u32'
    u32 valid_bit_depth;
    /usr/include/sound/skl-tplg-interface.h:175:2: error: unknown type name 'u32'
    u32 ch_cfg;
    /usr/include/sound/skl-tplg-interface.h:176:2: error: unknown type name 'u32'
    u32 interleaving_style;
    /usr/include/sound/skl-tplg-interface.h:177:2: error: unknown type name 'u32'
    u32 sample_type;
    /usr/include/sound/skl-tplg-interface.h:178:2: error: unknown type name 'u32'
    u32 ch_map;
    /usr/include/sound/skl-tplg-interface.h:182:2: error: unknown type name 'u32'
    u32 set_params:2;
    /usr/include/sound/skl-tplg-interface.h:183:2: error: unknown type name 'u32'
    u32 rsvd:30;
    /usr/include/sound/skl-tplg-interface.h:184:2: error: unknown type name 'u32'
    u32 param_id;
    /usr/include/sound/skl-tplg-interface.h:185:2: error: unknown type name 'u32'
    u32 caps_size;
    /usr/include/sound/skl-tplg-interface.h:186:2: error: unknown type name 'u32'
    u32 caps[HDA_SST_CFG_MAX];
    /usr/include/sound/skl-tplg-interface.h:190:2: error: unknown type name 'u8'
    u8 pipe_id;
    /usr/include/sound/skl-tplg-interface.h:191:2: error: unknown type name 'u8'
    u8 pipe_priority;
    /usr/include/sound/skl-tplg-interface.h:192:2: error: unknown type name 'u16'
    u16 conn_type:4;
    /usr/include/sound/skl-tplg-interface.h:193:2: error: unknown type name 'u16'
    u16 rsvd:4;
    /usr/include/sound/skl-tplg-interface.h:194:2: error: unknown type name 'u16'
    u16 memory_pages:8;
    /usr/include/sound/skl-tplg-interface.h:200:2: error: unknown type name 'u16'
    u16 module_id;
    /usr/include/sound/skl-tplg-interface.h:201:2: error: unknown type name 'u16'
    u16 instance_id;
    /usr/include/sound/skl-tplg-interface.h:202:2: error: unknown type name 'u32'
    u32 max_mcps;
    /usr/include/sound/skl-tplg-interface.h:203:2: error: unknown type name 'u32'
    u32 mem_pages;
    /usr/include/sound/skl-tplg-interface.h:204:2: error: unknown type name 'u32'
    u32 obs;
    /usr/include/sound/skl-tplg-interface.h:205:2: error: unknown type name 'u32'
    u32 ibs;
    /usr/include/sound/skl-tplg-interface.h:206:2: error: unknown type name 'u32'
    u32 vbus_id;
    /usr/include/sound/skl-tplg-interface.h:208:2: error: unknown type name 'u32'
    u32 max_in_queue:8;
    /usr/include/sound/skl-tplg-interface.h:209:2: error: unknown type name 'u32'
    u32 max_out_queue:8;
    /usr/include/sound/skl-tplg-interface.h:210:2: error: unknown type name 'u32'
    u32 time_slot:8;
    /usr/include/sound/skl-tplg-interface.h:211:2: error: unknown type name 'u32'
    u32 core_id:4;
    /usr/include/sound/skl-tplg-interface.h:212:2: error: unknown type name 'u32'
    u32 rsvd1:4;
    /usr/include/sound/skl-tplg-interface.h:214:2: error: unknown type name 'u32'
    u32 module_type:8;
    /usr/include/sound/skl-tplg-interface.h:215:2: error: unknown type name 'u32'
    u32 conn_type:4;
    /usr/include/sound/skl-tplg-interface.h:216:2: error: unknown type name 'u32'
    u32 dev_type:4;
    /usr/include/sound/skl-tplg-interface.h:217:2: error: unknown type name 'u32'
    u32 hw_conn_type:4;
    /usr/include/sound/skl-tplg-interface.h:218:2: error: unknown type name 'u32'
    u32 rsvd2:12;
    /usr/include/sound/skl-tplg-interface.h:220:2: error: unknown type name 'u32'
    u32 params_fixup:8;
    /usr/include/sound/skl-tplg-interface.h:221:2: error: unknown type name 'u32'
    u32 converter:8;
    /usr/include/sound/skl-tplg-interface.h:222:2: error: unknown type name 'u32'
    u32 input_pin_type:1;
    /usr/include/sound/skl-tplg-interface.h:223:2: error: unknown type name 'u32'
    u32 output_pin_type:1;
    /usr/include/sound/skl-tplg-interface.h:224:2: error: unknown type name 'u32'
    u32 is_dynamic_in_pin:1;
    /usr/include/sound/skl-tplg-interface.h:225:2: error: unknown type name 'u32'
    u32 is_dynamic_out_pin:1;
    /usr/include/sound/skl-tplg-interface.h:226:2: error: unknown type name 'u32'
    u32 is_loadable:1;
    /usr/include/sound/skl-tplg-interface.h:227:2: error: unknown type name 'u32'
    u32 rsvd3:11;

    Fixes: 0c24fdc00244 ("ASoC: topology: Move skl-tplg-interface.h to uapi")
    Signed-off-by: Dmitry V. Levin
    Reviewed-by: Guenter Roeck
    Signed-off-by: Mark Brown
    Cc: # v4.18

    Dmitry V. Levin
     
  • Since commit 143b44845d87 ("ASoC: wm9712: replace codec to component")
    "wm9712-codec" got renamed to "wm9712-component", however, this change
    never got propagated down to the actual board/platform drivers. E.g. on
    Colibri T20 this lead to the following spew upon boot with sound/touch
    being broken:

    [ 2.214121] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered
    [ 2.222137] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517)
    ...
    [ 2.344384] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered
    [ 2.351885] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517)
    ...
    [ 2.668339] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered
    [ 2.675811] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517)
    ...
    [ 3.208408] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered
    [ 3.216312] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517)
    ...
    [ 3.235397] tegra-snd-wm9712 sound: ASoC: CODEC DAI wm9712-hifi not registered
    [ 3.248938] tegra-snd-wm9712 sound: snd_soc_register_card failed (-517)
    ...
    [ 14.970443] ALSA device list:
    [ 14.996628] No soundcards found.

    This commit finally fixes this again.

    Signed-off-by: Marcel Ziswiler
    Acked-by: Charles Keepax
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Marcel Ziswiler
     
  • Add quirks to select the right input-map, jack-detect pin, etc. for:

    Linx Linx7 tablet
    Onda V975w tablet

    Signed-off-by: Hans de Goede
    Acked-by: Pierre-Louis Bossart
    Signed-off-by: Mark Brown

    Hans de Goede
     

09 Aug, 2018

5 commits


08 Aug, 2018

3 commits

  • Signed-off-by: Ryan Lee
    Signed-off-by: Mark Brown

    Ryan Lee
     
  • The offset of the DSP core needs to be taken into account for the DSP
    preloader control get and put. Currently the dsp->preloaded variable
    will only ever be read/updated on the first DSP, whilst this doesn't
    affect the operation of the control the readback will be incorrect.

    Signed-off-by: Ajit Pandey
    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Ajit Pandey
     
  • The driver expects to find the device id in rt5677_of_match.data, however
    it is currently assigned to rt5677_of_match.type. Fix this.

    The problem was found with the help of clang:
    sound/soc/codecs/rt5677.c:5010:36: warning: expression which evaluates to
    zero treated as a null pointer constant of type 'const void *'
    [-Wnon-literal-null-conversion]
    { .compatible = "realtek,rt5677", RT5677 },
    ^~~~~~

    Fixes: ddc9e69b9dc2 ("ASoC: rt5677: Hide platform data in the module sources")
    Signed-off-by: Matthias Kaehlcke
    Reviewed-by: Guenter Roeck
    Acked-by: Andy Shevchenko
    Signed-off-by: Mark Brown

    Matthias Kaehlcke
     

07 Aug, 2018

4 commits

  • For some reason order of startup/hw_params/prepare are reversed
    in dynamic compress usecase when compared to dpcm usecase. This is
    a issue with platforms like QCOM where it expects the BE to be
    initialized before FE.

    Interestingly the compress trigger callback order is inline with dpcm.

    Am not 100% sure why the compress audio case has been reversed.
    This patch is making the order inline with dpcm.

    If the reverse ordering is just co-incendental then this change
    makes sense and will avoid inventing some new mechanism to cope
    with ordering.

    Signed-off-by: Srinivas Kandagatla
    Signed-off-by: Mark Brown

    Srinivas Kandagatla
     
  • ACP->SYSMEM DMA happens at every I2S->SYSMEM period
    completion. Thus, there is delay of x frames till
    I2S->SYSMEM reaches a period length. This delay is
    communicated to user space.

    Signed-off-by: Akshu Agrawal
    Signed-off-by: Mark Brown

    Akshu Agrawal
     
  • Give position on ACP->SYSMEM DMA channel for
    the number of bytes that have been transferred on
    the basis of current descriptor under service.

    Signed-off-by: Vijendar Mukunda
    Signed-off-by: Akshu Agrawal
    Signed-off-by: Mark Brown

    Mukunda, Vijendar
     
  • In capture case we don't want ACP to SYSMEM dma
    to be circular. This is because if an in place DSP
    filter is applied to captured output then circular DMA
    can overwrite the filter value with stale data.

    Signed-off-by: Akshu Agrawal
    Signed-off-by: Mark Brown

    Akshu Agrawal
     

06 Aug, 2018

11 commits