1. 04 2月, 2019 1 次提交
    • C
      ASoC: soc-core: clear platform pointers on error · 78a24e10
      Curtis Malainey 提交于
      Originally snd_soc_init_platform was not cleaning up its pointers, this
      was fixed to always reallocate dynamic memory but created a memory leak
      when snd_soc_init_platform was called multiple times during the same
      probe attempt and also threw away any changes made to the struct between
      calls. In order to avoid reallocating memory that is still valid, the
      behaviour will be changed to clear the dynamically set pointers on a
      probe error and a unregister event and snd_soc_init_platform will go
      back to its original behaviour of only allocating null pointers so it will
      stop throwing away valid changes.
      Signed-off-by: NCurtis Malainey <cujomalainey@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      78a24e10
  2. 28 1月, 2019 1 次提交
  3. 23 1月, 2019 1 次提交
  4. 22 1月, 2019 6 次提交
  5. 19 1月, 2019 2 次提交
    • K
      ASoC: soc.h: add explanation of legacy/modern style of dai_link · 62bc79d3
      Kuninori Morimoto 提交于
      Current ALSA SoC is assuming 1 CPU 1 Platform (= DMA) style system.
      Because of this background, it is directly using
      xxx_name / xxx_of_node / xxx_dai_name on dai_link.
      Let's call it as legacy style here.
      
      More complex style system like multi CPU multi Platform (= DMA) will
      coming. To supporting it, we can use snd_soc_dai_link_component on
      dai_link. Let's call it as modern style here.
      But current ALSA SoC can't support it so far. Thus, we need to have
      multi CPU / multi Codec / multi Platform style in the future on ALSA SoC.
      
      Currently we already have multi Codec support. Platform is starting to
      use modern style on dai_link, but still style only. Multi Platform is
      not yet implemented. And we still don't have multi CPU support on ALSA
      SoC, and not have modern style either.
      
      Currently, if driver is using legacy style Codec/Platform, it will be
      converted to modern style on soc-core. This means, we are using glue code
      for legacy vs modern style so far on ALSA SoC.
      We can fully switch to modern style on all drivers if ALSA SoC supported
      modern style for CPU, and then, legacy style code will be removed from
      ALSA SoC.
      Untile then, we need to keep both legacy/modern style and its glue code.
      This patch adds such future plan and background on soc.h
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      62bc79d3
    • S
      ASoC: soc-core: remove error due to probe deferral · 7c7e2d6a
      Stefan Agner 提交于
      Deferred probes shouldn't cause error messages in the boot log, so
      change the dev_err() to the more harmless dev_info().
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      7c7e2d6a
  6. 16 1月, 2019 1 次提交
  7. 15 1月, 2019 2 次提交
    • M
      ASoC: core: Make snd_soc_find_component() more robust · 5a7b2aab
      Mark Brown 提交于
      There are some use cases where you're checking for a lot of things on a
      card and it makes sense that you might end up trying to call
      snd_soc_find_component() without either a name or an of_node.  Currently
      in that case we try to dereference the name and crash but it's more
      useful to allow the caller to just treat that as a case where we don't
      find anything, that error handling will already exist.
      
      Inspired by a patch from Ajit Pandey fixing some callers.
      
      Fixes: 8780cf11 ("ASoC: soc-core: defer card probe until all component is added to list")
      Reported-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      5a7b2aab
    • C
      ASoC: soc-core: fix init platform memory handling · 09ac6a81
      Curtis Malainey 提交于
      snd_soc_init_platform initializes pointers to snd_soc_dai_link which is
      statically allocated and it does this by devm_kzalloc. In the event of
      an EPROBE_DEFER the memory will be freed and the pointers are left
      dangling. snd_soc_init_platform sees the dangling pointers and assumes
      they are pointing to initialized memory and does not reallocate them on
      the second probe attempt which results in a use after free bug since
      devm has freed the memory from the first probe attempt.
      
      Since the intention for snd_soc_dai_link->platform is that it can be set
      statically by the machine driver we need to respect the pointer in the
      event we did not set it but still catch dangling pointers. The solution
      is to add a flag to track whether the pointer was dynamically allocated
      or not.
      Signed-off-by: NCurtis Malainey <cujomalainey@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      09ac6a81
  8. 10 1月, 2019 1 次提交
  9. 09 1月, 2019 1 次提交
  10. 14 12月, 2018 1 次提交
    • R
      ASoC: core: Invoke pcm_new() for all DAI-link · de17f14e
      Rohit kumar 提交于
      Remove no_pcm check to invoke pcm_new() for backend dai-links
      too. This fixes crash in hdmi codec driver during hdmi_codec_startup()
      while accessing chmap_info struct. chmap_info struct memory is
      allocated in pcm_new() of hdmi codec driver which is not invoked
      in case of DPCM when hdmi codec driver is part of backend dai-link.
      
      Below is the crash stack:
      
      [   61.635493] Unable to handle kernel NULL pointer dereference at virtual address 00000018
      ..
      [   61.666696]   CM = 0, WnR = 1
      [   61.669778] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc0d6633000
      [   61.676526] [0000000000000018] *pgd=0000000153fc8003, *pud=0000000153fc8003, *pmd=0000000000000000
      [   61.685793] Internal error: Oops: 96000046 [#1] PREEMPT SMP
      [   61.722955] CPU: 7 PID: 2238 Comm: aplay Not tainted 4.14.72 #21
      ..
      [   61.740269] PC is at hdmi_codec_startup+0x124/0x164
      [   61.745308] LR is at hdmi_codec_startup+0xe4/0x164
      Signed-off-by: NRohit kumar <rohitkr@codeaurora.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      de17f14e
  11. 23 11月, 2018 1 次提交
  12. 15 11月, 2018 1 次提交
    • T
      ASoC: dapm: Recalculate audio map forcely when card instantiated · 882eab6c
      Tzung-Bi Shih 提交于
      Audio map are possible in wrong state before card->instantiated has
      been set to true.  Imaging the following examples:
      
      time 1: at the beginning
      
        in:-1    in:-1    in:-1    in:-1
       out:-1   out:-1   out:-1   out:-1
       SIGGEN        A        B      Spk
      
      time 2: after someone called snd_soc_dapm_new_widgets()
      (e.g. create_fill_widget_route_map() in sound/soc/codecs/hdac_hdmi.c)
      
         in:1     in:0     in:0     in:0
        out:0    out:0    out:0    out:1
       SIGGEN        A        B      Spk
      
      time 3: routes added
      
         in:1     in:0     in:0     in:0
        out:0    out:0    out:0    out:1
       SIGGEN -----> A -----> B ---> Spk
      
      In the end, the path should be powered on but it did not.  At time 3,
      "in" of SIGGEN and "out" of Spk did not propagate to their neighbors
      because snd_soc_dapm_add_path() will not invalidate the paths if
      the card has not instantiated (i.e. card->instantiated is false).
      To correct the state of audio map, recalculate the whole map forcely.
      Signed-off-by: NTzung-Bi Shih <tzungbi@google.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      882eab6c
  13. 19 10月, 2018 1 次提交
  14. 22 9月, 2018 2 次提交
  15. 21 9月, 2018 5 次提交
  16. 18 9月, 2018 2 次提交
  17. 12 9月, 2018 4 次提交
  18. 06 9月, 2018 1 次提交
  19. 04 9月, 2018 2 次提交
  20. 03 9月, 2018 1 次提交
  21. 31 8月, 2018 1 次提交
    • K
      ASoC: soc-core: use snd_soc_dai_link_component for platform · daecf46e
      Kuninori Morimoto 提交于
      Current struct snd_soc_dai_link is supporting multicodec,
      and it is supporting legacy style of
      	codec_name
      	codec_of_node
      	code_dai_name
      This is handled as single entry of multicodec.
      
      We don't have multicpu support yet, but in the future we will.
      In such case, we can use snd_soc_dai_link_component for both
      cpu/codec. Then the code will be more simple and readble.
      
      As next step, we want to use it for platform, too.
      This patch adds snd_soc_dai_link_component style for platform.
      We might have multiplatform support in the future, but we
      don't know yet. To avoid un-known issue / complex code,
      this patch supports just single-platform as 1st step.
      
      If we could use snd_soc_dai_link_component for all CPU/Codec/Platform,
      we will switch to new style, and remove legacy code.
      This is prepare for it.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      daecf46e
  22. 15 8月, 2018 1 次提交
    • C
      ASoC: dapm: Fix NULL pointer deference on CODEC to CODEC DAIs · 249dc495
      Charles Keepax 提交于
      Commit a655de80 ("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:
      
      [<4069de54>] (soc_dai_hw_params) from
      [<40694b68>] (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: NCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      249dc495
  23. 04 8月, 2018 1 次提交