1. 26 11月, 2019 1 次提交
  2. 25 11月, 2019 2 次提交
  3. 24 11月, 2019 1 次提交
  4. 23 11月, 2019 5 次提交
  5. 22 11月, 2019 7 次提交
  6. 21 11月, 2019 19 次提交
  7. 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
  8. 19 11月, 2019 1 次提交