1. 25 Nov, 2022 5 commits
  2. 24 Nov, 2022 10 commits
  3. 23 Nov, 2022 13 commits
  4. 22 Nov, 2022 11 commits
  5. 18 Nov, 2022 1 commit
    • Cezary Rojewski's avatar
      ASoC: core: Exit all links before removing their components · c7eb967d
      Cezary Rojewski authored
      Flows leading to link->init() and link->exit() are not symmetric.
      Currently the relevant part of card probe sequence goes as:
      
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_components(rtd, i, component)
      			component->probe()
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_dais(rtd, i, dai)
      			dai->probe()
      	for_each_card_rtds(card, rtd)
      		rtd->init()
      
      On the other side, equivalent remove sequence goes as:
      
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_dais(rtd, i, dai)
      			dai->remove()
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_components(rtd, i, component)
      			component->remove()
      	for_each_card_rtds(card, rtd)
      		rtd->exit()
      
      what can lead to errors as link->exit() may still operate on resources
      owned by its components despite the probability of them being freed
      during the component->remove().
      
      This change modifies the remove sequence to:
      
      	for_each_card_rtds(card, rtd)
      		rtd->exit()
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_dais(rtd, i, dai)
      			dai->remove()
      	for_each_card_rtds(card, rtd)
      		for_each_rtd_components(rtd, i, component)
      			component->remove()
      
      so code found in link->exit() is safe to touch any component stuff as
      component->remove() has not been called yet.
      Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Reviewed-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Link: https://lore.kernel.org/r/20221027085840.1562698-1-cezary.rojewski@intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      c7eb967d