linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
@ 2016-12-29 14:49 ` Nikita Yushchenko
  2016-12-29 16:18   ` [alsa-devel] " Sylwester Nawrocki
  0 siblings, 1 reply; 8+ messages in thread
From: Nikita Yushchenko @ 2016-12-29 14:49 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel
  Cc: Chris Healy, Kuninori Morimoto, linux-kernel, Nikita Yushchenko

This reverts commit 1a653aa44725668590b36bbe2d7fe4736a69f055 ("ASoC:
core: replace aux_comp_list to component_dev_list").

That commit tries to remove card->aux_comp_list, using flagged entries
in card->component_dev_list instead.

However, components are added to card->component_dev_list in
soc_probe_component(), which is called for aux devices by
soc_probe_aux_devices(). Before that commit, it traversed
card->aux_comp_list and found aux devices added by soc_bind_aux_dev().
After that commit, it traverses card->component_dev_list and finds no
aux devices, because soc_probe_component() was not yet called for them.

Thus all aux devices are lost and any setup that needs them no longer
works.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
---
Fixed lost line in commit message ;)
 include/sound/soc.h  |  4 +++-
 sound/soc/soc-core.c | 17 +++++------------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2b502f6cc6d0..8172a512632a 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -809,10 +809,10 @@ struct snd_soc_component {
 
 	unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */
 	unsigned int registered_as_component:1;
-	unsigned int auxiliary:1; /* for auxiliary component of the card */
 	unsigned int suspended:1; /* is in suspend PM state */
 
 	struct list_head list;
+	struct list_head list_aux; /* for auxiliary component of the card */
 	struct list_head card_list;
 
 	struct snd_soc_dai_driver *dai_drv;
@@ -1152,6 +1152,7 @@ struct snd_soc_card {
 	 */
 	struct snd_soc_aux_dev *aux_dev;
 	int num_aux_devs;
+	struct list_head aux_comp_list;
 
 	const struct snd_kcontrol_new *controls;
 	int num_controls;
@@ -1547,6 +1548,7 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
 	INIT_LIST_HEAD(&card->widgets);
 	INIT_LIST_HEAD(&card->paths);
 	INIT_LIST_HEAD(&card->dapm_list);
+	INIT_LIST_HEAD(&card->aux_comp_list);
 	INIT_LIST_HEAD(&card->component_dev_list);
 }
 
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f1901bb1466e..15657a65e4ca 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1747,8 +1747,7 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num)
 	}
 
 	component->init = aux_dev->init;
-	component->auxiliary = 1;
-
+	list_add(&component->list_aux, &card->aux_comp_list);
 	return 0;
 
 err_defer:
@@ -1764,10 +1763,7 @@ static int soc_probe_aux_devices(struct snd_soc_card *card)
 
 	for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
 		order++) {
-		list_for_each_entry(comp, &card->component_dev_list, card_list) {
-			if (!comp->auxiliary)
-				continue;
-
+		list_for_each_entry(comp, &card->aux_comp_list, list_aux) {
 			if (comp->driver->probe_order == order) {
 				ret = soc_probe_component(card,	comp);
 				if (ret < 0) {
@@ -1791,14 +1787,11 @@ static void soc_remove_aux_devices(struct snd_soc_card *card)
 	for (order = SND_SOC_COMP_ORDER_FIRST; order <= SND_SOC_COMP_ORDER_LAST;
 		order++) {
 		list_for_each_entry_safe(comp, _comp,
-			&card->component_dev_list, card_list) {
-
-			if (!comp->auxiliary)
-				continue;
-
+			&card->aux_comp_list, list_aux) {
 			if (comp->driver->remove_order == order) {
 				soc_remove_component(comp);
-				comp->auxiliary = 0;
+				/* remove it from the card's aux_comp_list */
+				list_del(&comp->list_aux);
 			}
 		}
 	}
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2016-12-29 14:49 ` [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list" Nikita Yushchenko
@ 2016-12-29 16:18   ` Sylwester Nawrocki
  2016-12-29 16:20     ` Nikita Yushchenko
  2017-01-06 18:18     ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Sylwester Nawrocki @ 2016-12-29 16:18 UTC (permalink / raw)
  To: Nikita Yushchenko
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, Kuninori Morimoto, Chris Healy, linux-kernel

On 12/29/2016 03:49 PM, Nikita Yushchenko wrote:
> This reverts commit 1a653aa44725668590b36bbe2d7fe4736a69f055 ("ASoC:
> core: replace aux_comp_list to component_dev_list").
> 
> That commit tries to remove card->aux_comp_list, using flagged entries
> in card->component_dev_list instead.
> 
> However, components are added to card->component_dev_list in
> soc_probe_component(), which is called for aux devices by
> soc_probe_aux_devices(). Before that commit, it traversed
> card->aux_comp_list and found aux devices added by soc_bind_aux_dev().
> After that commit, it traverses card->component_dev_list and finds no
> aux devices, because soc_probe_component() was not yet called for them.
> 
> Thus all aux devices are lost and any setup that needs them no longer
> works.

I think we can't simply revert that commit now, after commit

9178feb ASoC: add Component level suspend/resume
component_dev_list is also used for the component level suspend/resume,
if auxiliary devices would have been on a separate list they would be
missed in the suspend/resume sequences.

I run into same issue and posted a patch:

"ASoC: Fix binding and probing of auxiliary components".

--
Thanks,
Sylwester

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2016-12-29 16:18   ` [alsa-devel] " Sylwester Nawrocki
@ 2016-12-29 16:20     ` Nikita Yushchenko
  2016-12-29 16:30       ` Sylwester Nawrocki
  2017-01-06 18:18     ` Mark Brown
  1 sibling, 1 reply; 8+ messages in thread
From: Nikita Yushchenko @ 2016-12-29 16:20 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, Kuninori Morimoto, Chris Healy, linux-kernel

>> This reverts commit 1a653aa44725668590b36bbe2d7fe4736a69f055 ("ASoC:
>> core: replace aux_comp_list to component_dev_list").
>>
>> That commit tries to remove card->aux_comp_list, using flagged entries
>> in card->component_dev_list instead.
>>
>> However, components are added to card->component_dev_list in
>> soc_probe_component(), which is called for aux devices by
>> soc_probe_aux_devices(). Before that commit, it traversed
>> card->aux_comp_list and found aux devices added by soc_bind_aux_dev().
>> After that commit, it traverses card->component_dev_list and finds no
>> aux devices, because soc_probe_component() was not yet called for them.
>>
>> Thus all aux devices are lost and any setup that needs them no longer
>> works.
> 
> I think we can't simply revert that commit now, after commit
> 
> 9178feb ASoC: add Component level suspend/resume
> component_dev_list is also used for the component level suspend/resume,
> if auxiliary devices would have been on a separate list they would be
> missed in the suspend/resume sequences.

I believe aux devices are on both lists.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2016-12-29 16:20     ` Nikita Yushchenko
@ 2016-12-29 16:30       ` Sylwester Nawrocki
  0 siblings, 0 replies; 8+ messages in thread
From: Sylwester Nawrocki @ 2016-12-29 16:30 UTC (permalink / raw)
  To: Nikita Yushchenko
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, Kuninori Morimoto, Chris Healy, linux-kernel

On 12/29/2016 05:20 PM, Nikita Yushchenko wrote:
> I believe aux devices are on both lists.

Indeed, you are right, they are on both lists.
So there should be no issues after reverting.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2016-12-29 16:18   ` [alsa-devel] " Sylwester Nawrocki
  2016-12-29 16:20     ` Nikita Yushchenko
@ 2017-01-06 18:18     ` Mark Brown
  2017-01-07 20:33       ` Chen-Yu Tsai
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2017-01-06 18:18 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: Nikita Yushchenko, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, Kuninori Morimoto, Chris Healy, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

On Thu, Dec 29, 2016 at 05:18:21PM +0100, Sylwester Nawrocki wrote:

> I run into same issue and posted a patch:

> "ASoC: Fix binding and probing of auxiliary components".

Which I applied so I guess things are fine now without the revert?  I'm
still working through backlog from the holidays so didn't check
properly yet.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2017-01-06 18:18     ` Mark Brown
@ 2017-01-07 20:33       ` Chen-Yu Tsai
  2017-01-09  7:41         ` Nikita Yushchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Chen-Yu Tsai @ 2017-01-07 20:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: Sylwester Nawrocki, Nikita Yushchenko, Linux-ALSA,
	Kuninori Morimoto, linux-kernel, Takashi Iwai, Liam Girdwood,
	Chris Healy

On Sat, Jan 7, 2017 at 2:18 AM, Mark Brown <broonie@kernel.org> wrote:
> On Thu, Dec 29, 2016 at 05:18:21PM +0100, Sylwester Nawrocki wrote:
>
>> I run into same issue and posted a patch:
>
>> "ASoC: Fix binding and probing of auxiliary components".
>
> Which I applied so I guess things are fine now without the revert?  I'm
> still working through backlog from the holidays so didn't check
> properly yet.

This fixes the Allwinner H3 codec analog controls aux_device for me.
Thanks.

ChenYu

>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2017-01-07 20:33       ` Chen-Yu Tsai
@ 2017-01-09  7:41         ` Nikita Yushchenko
  2017-01-09 11:55           ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Nikita Yushchenko @ 2017-01-09  7:41 UTC (permalink / raw)
  To: Chen-Yu Tsai, Mark Brown
  Cc: Sylwester Nawrocki, Linux-ALSA, Kuninori Morimoto, linux-kernel,
	Takashi Iwai, Liam Girdwood, Chris Healy

>>> I run into same issue and posted a patch:
>>
>>> "ASoC: Fix binding and probing of auxiliary components".
>>
>> Which I applied so I guess things are fine now without the revert?  I'm
>> still working through backlog from the holidays so didn't check
>> properly yet.
> 
> This fixes the Allwinner H3 codec analog controls aux_device for me.
> Thanks.

But this is not yet in 4.10-rc3 ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list"
  2017-01-09  7:41         ` Nikita Yushchenko
@ 2017-01-09 11:55           ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-01-09 11:55 UTC (permalink / raw)
  To: Nikita Yushchenko
  Cc: Chen-Yu Tsai, Sylwester Nawrocki, Linux-ALSA, Kuninori Morimoto,
	linux-kernel, Takashi Iwai, Liam Girdwood, Chris Healy

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

On Mon, Jan 09, 2017 at 10:41:37AM +0300, Nikita Yushchenko wrote:

> But this is not yet in 4.10-rc3 ?

Yes.  It's not yet been sent to Linus, it'll go whenever the next batch
of fixes goes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-09 11:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161229152622epcas4p19054a78722d5eae88c983230f457e794@epcas4p1.samsung.com>
2016-12-29 14:49 ` [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list" Nikita Yushchenko
2016-12-29 16:18   ` [alsa-devel] " Sylwester Nawrocki
2016-12-29 16:20     ` Nikita Yushchenko
2016-12-29 16:30       ` Sylwester Nawrocki
2017-01-06 18:18     ` Mark Brown
2017-01-07 20:33       ` Chen-Yu Tsai
2017-01-09  7:41         ` Nikita Yushchenko
2017-01-09 11:55           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).