1. 31 8月, 2017 1 次提交
    • T
      ALSA: Get rid of card power_lock · 7d8e8292
      Takashi Iwai 提交于
      Currently we're taking power_lock at each card component for assuring
      the power-up sequence, but it doesn't help anything in the
      implementation at the moment: it just serializes unnecessarily the
      callers, but it doesn't protect about the power state change itself.
      It used to have some usefulness in the early days where we managed the
      PM manually.  But now the suspend/resume core procedure is beyond our
      hands, and power_lock lost its meaning.
      
      This patch drops the power_lock from allover the places.
      There shouldn't be any issues by this change, as it's no helper
      regarding the power state change.  Rather we'll get better performance
      by removing the serialization; which is the only slight concern of any
      behavior change, but it can't be a showstopper, after all.
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      7d8e8292
  2. 01 8月, 2017 1 次提交
    • T
      device property: Fix usecount for of_graph_get_port_parent() · c0a480d1
      Tony Lindgren 提交于
      Fix inconsistent use of of_graph_get_port_parent() where
      asoc_simple_card_parse_graph_dai() does of_node_get() before
      calling it while other callers do not. We can fix this by
      not trashing the node passed to of_graph_get_port_parent().
      
      Let's also make sure the callers have correct refcounts and remove
      related incorrect of_node_put() calls for of_for_each_phandle
      as that's done by of_phandle_iterator_next() except when
      we break out of the loop early.
      
      Let's fix both issues with a single patch to avoid kobject
      refcounts getting messed up more if two patches are merged
      separately.
      
      Otherwise strange issues can happen caused by memory corruption
      caused by too many kobject_del() calls such as:
      
      BUG: sleeping function called from invalid context at
      kernel/locking/mutex.c:747
      ...
      (___might_sleep)
      (__mutex_lock)
      (mutex_lock_nested)
      (kernfs_remove)
      (kobject_del)
      (kobject_put)
      (of_get_next_parent)
      (of_graph_get_port_parent)
      (asoc_simple_card_parse_graph_dai [snd_soc_simple_card_utils])
      (asoc_graph_card_probe [snd_soc_audio_graph_card])
      
      Fixes: 0ef472a9 ("of_graph: add of_graph_get_port_parent()")
      Fixes: 2692c1c6 ("ASoC: add audio-graph-card support")
      Fixes: 1689333f ("ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai()")
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Tested-by: NAntonio Borneo <borneo.antonio@gmail.com>
      Tested-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c0a480d1
  3. 17 7月, 2017 1 次提交
    • J
      ASoC: fix pcm-creation regression · c641e5b2
      Johan Hovold 提交于
      This reverts commit 99b04f4c ("ASoC: add Component level
      pcm_new/pcm_free"), which started calling the pcm_new callback for every
      component in a *card* when creating a new pcm, something which does not
      seem to make any sense.
      
      This specifically led to memory leaks in systems with more than one
      platform component and where DMA memory is allocated in the
      platform-driver callback. For example, when both mcasp devices are being
      used on an am335x board, DMA memory would be allocated twice for every
      DAI link during probe.
      
      When CONFIG_SND_VERBOSE_PROCFS was set this fortunately also led to
      warnings such as:
      
      WARNING: CPU: 0 PID: 565 at ../fs/proc/generic.c:346 proc_register+0x110/0x154
      proc_dir_entry 'sub0/prealloc' already registered
      
      Since there seems to be no users of the new component callbacks, and the
      current implementation introduced a regression, let's revert the
      offending commit for now.
      
      Fixes: 99b04f4c ("ASoC: add Component level pcm_new/pcm_free")
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Tested-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable <stable@vger.kernel.org>	# 4.10
      c641e5b2
  4. 30 6月, 2017 1 次提交
  5. 29 6月, 2017 1 次提交
  6. 25 5月, 2017 2 次提交
    • K
      ASoC: add snd_soc_get_dai_id() function · a180e8b9
      Kuninori Morimoto 提交于
      ALSA SoC needs to know connected DAI ID for detecting.
      It is not a big problem if device/driver was only for sound,
      but getting DAI ID will be difficult if device includes both
      Video/Sound, like HDMI.
      To solve this issue, this patch adds new snd_soc_get_dai_id() and
      its related .of_xlate_dai_id callback on component driver.
      In below case, we can handle Sound port (= port@2) as ID = 0
      if .of_xlate_dai_id has its support.
      
      	hdmi {
      		port@0 { /* VIDEO */ };
      		port@1 { /* VIDEO */ };
      		port@2 { /* SOUND */ };
      	};
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      a180e8b9
    • T
      ASoC: Fix use-after-free at card unregistration · 4efda5f2
      Takashi Iwai 提交于
      soc_cleanup_card_resources() call snd_card_free() at the last of its
      procedure.  This turned out to lead to a use-after-free.
      PCM runtimes have been already removed via soc_remove_pcm_runtimes(),
      while it's dereferenced later in soc_pcm_free() called via
      snd_card_free().
      
      The fix is simple: just move the snd_card_free() call to the beginning
      of the whole procedure.  This also gives another benefit: it
      guarantees that all operations have been shut down before actually
      releasing the resources, which was racy until now.
      Reported-and-tested-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: <stable@vger.kernel.org>
      4efda5f2
  7. 17 5月, 2017 1 次提交
  8. 09 5月, 2017 1 次提交
  9. 25 4月, 2017 2 次提交
  10. 06 4月, 2017 1 次提交
    • K
      ASoC: soc-core: verify Sound Card normality · c12c1aad
      Kuninori Morimoto 提交于
      Current ALSA SoC Sound Card basically consists of CPU/Codec/Platform
      components. If system uses Kernel modules, we can disable these drivers
      by using rmmod command. In such case, we can't disable
      CPU/Codec/Platform driver without disabling Sound Card driver.
      
      But on the other hand, we can disable these drivers by using unbind
      command. In such case, we can disable these drivers randomly.
      In this case, we can create dirty Sound Card which is missing necessary
      components.
      
      (1) If user disabled Sound Card first, but did nothing to other drivers,
      user can't use Sound because Sound Card is no longer exists.
      (2) If user disabled CPU/Codec/Platform driver randomly, but did nothing
      to Sound Card, user still be able to use Sound Card, because dirty Sound
      Card still exists. In this case, Sound system will be crashed if user
      started sound playback/capture. But we can't block such random unbind
      now.
      
      To avoid Sound Card crash in (2) case, we need to unregister Sound Card
      whenever CPU/Codec/Platform component were unregistered.
      This patch solves this issue.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      c12c1aad
  11. 25 3月, 2017 1 次提交
  12. 09 3月, 2017 1 次提交
  13. 07 3月, 2017 1 次提交
  14. 28 2月, 2017 1 次提交
  15. 04 2月, 2017 1 次提交
  16. 27 1月, 2017 4 次提交
  17. 20 1月, 2017 1 次提交
  18. 18 1月, 2017 1 次提交
    • L
      ASoC: core: Add API to use DMI name in sound card long name · 345233d7
      Liam Girdwood 提交于
      Intel DSP platform drivers are used by many different devices but are
      difficult for userspace to differentiate. This patch adds an API to allow
      the DMI name to be used in the sound card long name, thereby helping
      userspace load the correct UCM configuration. Usually machine drivers
      uses their own name as the sound card name (short name), and leave the
      long name and driver name blank. This API will use the DMI info like
      vendor, product and board to make up the card long name. If the machine
      driver has already explicitly set the long name, this API will do nothing.
      
      This patch also allows for further differentiation as many devices that
      share the same DMI name i.e. Minnowboards, UP boards may be configured
      with different codecs or firmwares. The API supports flavoring the DMI
      name into the card longname to provide the extra differentiation required
      for these devices.
      
      For Use Case Manager (UCM) in the user space, changing card long name by
      this API is backward compatible, since the card name does not change. For
      a given sound card, even if there is no device-specific UCM configuration
      file that uses the card long name, UCM will fall back to load the default
      configuration file that uses the card name.
      Signed-off-by: NLiam Girdwood <liam.r.girdwood@linux.intel.com>
      Signed-off-by: NMengdong Lin <mengdong.lin@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      345233d7
  19. 13 1月, 2017 1 次提交
  20. 01 1月, 2017 1 次提交
    • S
      ASoC: Fix binding and probing of auxiliary components · d2e3a135
      Sylwester Nawrocki 提交于
      Currently binding of auxiliary devices doesn't work as in
      soc_bind_aux_dev() function a bound component is not being added
      to any list and in soc_probe_aux_devices() we are trying to walk
      the component_dev_list list to probe auxiliary components but
      at that time this list doesn't contain any auxiliary components
      since they are being added to the card only in soc_probe_component().
      
      This patch adds a list to the card where are stored bound but not
      probed auxiliary devices, so that all aux devices can be probed.
      
      Fixes: 1a653aa4 "ASoC: core: replace aux_comp_list to component_dev_list"
      Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      d2e3a135
  21. 16 12月, 2016 1 次提交
  22. 02 12月, 2016 3 次提交
  23. 11 11月, 2016 5 次提交
  24. 09 11月, 2016 1 次提交
  25. 05 11月, 2016 1 次提交
    • M
      ASoC: Define API to find a dai link · 17fb1755
      Mengdong Lin 提交于
      Define the API to find an existing DAI link of the soc card by matching
      the ID, name and stream name.
      
      Some cards may use unique ID for each DAI link, so matching ID is enough,
      and name or stream name are not necessary. But user need to specify name
      or stream name as well if not sure whether link ID is unique since most
      cards use 0 as the default link ID.
      
      Topology can use this API to find an existing BE link and configure it.
      Signed-off-by: NMengdong Lin <mengdong.lin@linux.intel.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      17fb1755
  26. 19 8月, 2016 1 次提交
  27. 11 8月, 2016 1 次提交
  28. 08 8月, 2016 2 次提交