From patchwork Thu Dec 29 14:49:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Yushchenko X-Patchwork-Id: 9491257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35CA760453 for ; Thu, 29 Dec 2016 15:14:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D4201FF8E for ; Thu, 29 Dec 2016 15:14:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1140C24DA2; Thu, 29 Dec 2016 15:14:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97ABB1FF8E for ; Thu, 29 Dec 2016 15:14:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 62BC7266F5C; Thu, 29 Dec 2016 16:14:10 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AAFE1266F65; Thu, 29 Dec 2016 16:11:51 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 67833266F44; Thu, 29 Dec 2016 15:50:06 +0100 (CET) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by alsa0.perex.cz (Postfix) with ESMTP id 50345266539 for ; Thu, 29 Dec 2016 15:49:59 +0100 (CET) Received: by mail-lf0-f44.google.com with SMTP id c13so222482560lfg.0 for ; Thu, 29 Dec 2016 06:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=4bSJruuXqERRs50zr+7TfNBIUYApckLyttsN7BlnMHM=; b=Ts7kwIlzp0UHwsodVeiBWQAS/HRuran6ScEkUNVz+jMtdLp0VJ/xvGNv42EuRmrx8h CJN1W0x4rBcpLzomX9giWs4XM5U+Us1vPn/NQ8RVEYpkZ+mMY8THJZH40hvdXLE2Lwkd hCE8NIaB++E7NIEQAZHOc5kO4k2oImSzwkDtrS5PMdoldPB9g+5wma/6nop9PQpjcPRZ +/XBtBOCuLXhVQZ361pATjG4CpPhg7hCQ8d4tz/iCVCyeFFFVEIgL+6EST99gIsb6WXx I1/s/aVRPu5iLr9yPuFS4PIwR3abNHMjPKc4Ar8JHG7YkfVU21vxN1WzwmC/vgQJGcZM 9Bmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4bSJruuXqERRs50zr+7TfNBIUYApckLyttsN7BlnMHM=; b=miIBJ0/Jxo5KMVsqg+Y2CFYqemOZPWkvDteVlvyUyhrGssG9rdj0/Gf2V8ezyGYGSL zes3/1bG/iqbkwrmQCzbaTrkuUN/IK8xD1zr4cL4z2sziO+XyQcMnMI3jacMNdZUOxgE Pc1illSWLO0dlhAEMyJqOs3uUiAwiS0IqxhToIM79Iy41nKUU4eWKIzKp+7m7oakRJc3 eai/nVwy5TeL/muO8WmNCgspJDKR4rTD5O1xuuhbPzwYKhK19MVOH2WmHGXMm6TxvBNO Vxi1jlX6i8BxO1/5qpbcIJgsGDUy5AKQH+2JqMGjIP29VKtv+++v+vhPJYWfrKUpzosv Jrsw== X-Gm-Message-State: AIkVDXIbsVMZv8nE9/nvlCY5FQLVDPf/NQvtM6qElsAe2KXMK9LrquLQxuWsjHm3PZ78aQ== X-Received: by 10.46.7.18 with SMTP id 18mr14589618ljh.30.1483022997129; Thu, 29 Dec 2016 06:49:57 -0800 (PST) Received: from hugenb.home (nikaet.starlink.ru. [94.141.168.29]) by smtp.gmail.com with ESMTPSA id g63sm7560586ljg.23.2016.12.29.06.49.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Dec 2016 06:49:56 -0800 (PST) From: Nikita Yushchenko To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Date: Thu, 29 Dec 2016 17:49:47 +0300 Message-Id: <1483022987-28843-1-git-send-email-nikita.yoush@cogentembedded.com> X-Mailer: git-send-email 2.1.4 Cc: Nikita Yushchenko , Kuninori Morimoto , Chris Healy , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] Revert "ASoC: core: replace aux_comp_list to component_dev_list" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); } } }