1. 25 11月, 2019 2 次提交
  2. 24 11月, 2019 1 次提交
  3. 23 11月, 2019 5 次提交
  4. 22 11月, 2019 7 次提交
  5. 21 11月, 2019 19 次提交
  6. 20 11月, 2019 4 次提交
    • K
      ALSA: hda - Add mute led support for HP ProBook 645 G4 · e190de69
      Kai-Heng Feng 提交于
      Mic mute led does not work on HP ProBook 645 G4.
      We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20191120082035.18937-1-kai.heng.feng@canonical.comSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      e190de69
    • K
      ASoC: soc-pcm: remove soc_pcm_private_free() · 0ced7b05
      Kuninori Morimoto 提交于
      soc-topology adds extra dai_link by using snd_soc_add_dai_link(),
      and removes it by snd_soc_romove_dai_link().
      
      This snd_soc_add/remove_dai_link() and/or its related
      functions are unbalanced before, and now, these are balance-uped.
      But, it finds the random operation issue, and it is reported by
      Pierre-Louis.
      
      When card was released, topology will call snd_soc_remove_dai_link()
      via (A).
      
      	static void soc_cleanup_card_resources(struct snd_soc_card *card)
      	{
      		struct snd_soc_dai_link *link, *_link;
      
      		/* This should be called before snd_card_free() */
      	(A)	soc_remove_link_components(card);
      
      		/* free the ALSA card at first; this syncs with pending operations */
      		if (card->snd_card) {
      	(B)		snd_card_free(card->snd_card);
      			card->snd_card = NULL;
      		}
      
      		/* remove and free each DAI */
      	(X)	soc_remove_link_dais(card);
      
      		for_each_card_links_safe(card, link, _link)
      	(C)		snd_soc_remove_dai_link(card, link);
      
      		...
      	}
      
      At (A), topology calls snd_soc_remove_dai_link().
      Then topology rtd, and its related all data are freed.
      
      Next, (B) is called, and then, pcm->private_free = soc_pcm_private_free()
      is called.
      
      	static void soc_pcm_private_free(struct snd_pcm *pcm)
      	{
      		struct snd_soc_pcm_runtime *rtd = pcm->private_data;
      
      		/* need to sync the delayed work before releasing resources */
      		flush_delayed_work(&rtd->delayed_work);
      		snd_soc_pcm_component_free(rtd);
      	}
      
      Here, it gets rtd via pcm->private_data.
      But, topology related rtd are already freed at (A).
      Normal sound card has no damage, becase it frees rtd at (C).
      
      These are finalizing rtd related data.
      Thus, these should be called when rtd was freed, not sound card
      was freed. It is very natural and understandable.
      
      In other words, pcm->private_free = soc_pcm_private_free()
      is no longer needed.
      
      Extra issue is that there is zero chance to call
      soc_remove_dai() for topology related dai at (X).
      Because (A) removes rtd connection from card too, and,
      (X) is based on card connected rtd.
      
      This means, (X) need to be called before (C) (= for normal sound)
      and (A) (= for topology).
      
      Now, I want to focus this patch which is the reason why
      snd_card_free() = (B) is located there.
      
      	commit 4efda5f2
      	("ASoC: Fix use-after-free at card unregistration")
      
      Original snd_card_free() was called last of this function.
      But moved to top to avoid use-after-free issue.
      The issue was happen at soc_pcm_free() which was pcm->private_free,
      today it is updated/renamed to soc_pcm_private_free().
      
      In other words, (B) need to be called before (C) (= for normal sound)
      and (A) (= for topology), because it needs (not yet freed) rtd.
      But, (A) need to be called before (B),
      because it needs card->snd_card pointer.
      
      If we call flush_delayed_work() and snd_soc_pcm_component_free()
      (= same as soc_pcm_private_free()) when rtd was freed (= (C), (A)),
      there is no reason to call snd_card_free() at top of this function.
      It can be called end of this function, again.
      
      But, in such case, it will likely break unbind again, as Takashi-san
      reported. When unbind is performed in a busy state, the code may
      release still-in-use resources.
      At least we need to call snd_card_disconnect_sync() at the first place.
      
      The final code will be...
      
      	static void soc_cleanup_card_resources(struct snd_soc_card *card)
      	{
      		struct snd_soc_dai_link *link, *_link;
      
      		if (card->snd_card)
      	(Z)		snd_card_disconnect_sync(card->snd_card);
      
      	(X)	soc_remove_link_dais(card);
      	(A)	soc_remove_link_components(card);
      
      		for_each_card_links_safe(card, link, _link)
      	(C)		snd_soc_remove_dai_link(card, link);
      
      		...
      		if (card->snd_card) {
      	(B)		snd_card_free(card->snd_card);
      			card->snd_card = NULL;
      		}
      	}
      
      To avoid release still-in-use resources,
      call snd_card_disconnect_sync() at (Z).
      
      (X) is needed for both non-topology and topology.
      
          topology removes rtd via (A), and
      non topology removes rtd via (C).
      
      snd_card_free() is no longer related to use-after-free issue.
      Thus, locating (B) is no problem.
      
      Fixes: df95a16d ("ASoC: soc-core: fix RIP warning on card removal")
      Fixes: bc7a9091 ("ASoC: soc-core: add soc_unbind_dai_link()")
      Reported-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Tested-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/87o8xax88g.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: NMark Brown <broonie@kernel.org>
      0ced7b05
    • K
      ASoC: soc-component: tidyup snd_soc_pcm_component_new/free() parameter · b2b2afbb
      Kuninori Morimoto 提交于
      This patch uses rtd instead of pcm at snd_soc_pcm_component_new/free()
      parameter.
      This is prepare for dai_link remove bug fix on topology.
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87pnhqx89j.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: NMark Brown <broonie@kernel.org>
      b2b2afbb
    • H
      ASoC: Intel: bytcr_rt5640: Update quirk for Acer Switch 10 SW5-012 2-in-1 · 0bb88770
      Hans de Goede 提交于
      When the Acer Switch 10 SW5-012 quirk was added we did not have
      jack-detection support yet; and the builtin microphone selection of
      the original quirk is wrong too.
      
      Fix the microphone-input quirk and add jack-detection info so that the
      internal-microphone and headphone/set jack on the Switch 10 work properly.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20191119145138.59162-1-hdegoede@redhat.comSigned-off-by: NMark Brown <broonie@kernel.org>
      0bb88770
  7. 19 11月, 2019 2 次提交
    • N
      ALSA: hda - Add DP-MST support for NVIDIA codecs · 5398e94f
      Nikhil Mahale 提交于
      This patch adds DP-MST support for GK104+ NVIDIA codecs.
      
      GK104+ NVIDIA codecs support DP-MST audio. These codecs have 4
      output converters and 4 pin widgets, with 4 device entries per pin
      widget for a total of 16 device entries.
      
      This patch moves the existing patch_nvhdmi() definition to
      patch_nvhdmi_legacy(), used by pre-GK104 NVIDIA codecs. Redefine
      patch_nvhdmi() to enable DP-MST support by setting codec->dp_mst and
      spec->dyn_pcm_assign.
      
      Introduce fresh logic for dynamic pcm assignment, making
      sure that new pcm assignments are compatible with the legacy static
      per_pin-pmc assignment that existed in the days before DP-MST.
      Signed-off-by: NNikhil Mahale <nmahale@nvidia.com>
      Reviewed-by: NAaron Plattner <aplattner@nvidia.com>
      Link: https://lore.kernel.org/r/20191119084710.29267-5-nmahale@nvidia.comSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      5398e94f
    • N
      ALSA: hda - Add DP-MST support for non-acomp codecs · 9c32fea8
      Nikhil Mahale 提交于
      This patch make it possible for non-acomp codecs to set
      dyn_pcm_assign/dp_mst and get DP-MST audio support.
      
      Document change notification HDA040-A for the Intel High Definition
      Audio 1.0a specification introduces a Device Select verb for Digital
      Display Pin Widgets that are multi-stream capable. This verb selects
      a Device Entry that is used by subsequent Pin Widget verbs.
      Once the Device Entry is selected, all subsequent Pin Widget verbs
      controlling the sink device will be directed to the selected Device
      Entry until the Device Select verb is updated with a new value.
      
      These Pin Widget verbs include:
      
        * Connection Select
        * Get Connection List Entry
        * Amplifier Gain/Mute
        * Power State
        * Pin Widget Control
        * ELD Data
        * DIP-Size
        * DIP-Index
        * DIP-Data
        * DIP-XmitCtrl
        * Content Protection Control
        * ASP Channel Mapping
      
      This patch adds calls to snd_hda_set_dev_select() to direct each of
      these Pin Widget control verbs to the correct Device Entry.
      
      snd_hda_get_connections() does not return per-device connection
      list, therefore make use snd_hda_get_raw_connections() instead of
      snd_hda_get_connections().
      Signed-off-by: NNikhil Mahale <nmahale@nvidia.com>
      Reviewed-by: NAaron Plattner <aplattner@nvidia.com>
      Link: https://lore.kernel.org/r/20191119084710.29267-4-nmahale@nvidia.comSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      9c32fea8