Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1995036imu; Fri, 14 Dec 2018 04:13:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/UBevHa8Gh5EM7FsdeDQNnxUnAGlNsSSMBlDMfkZoqeH7K7lctiHdLdMUoLbIOjFoBgRRVS X-Received: by 2002:a17:902:4225:: with SMTP id g34mr2728177pld.152.1544789624514; Fri, 14 Dec 2018 04:13:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544789624; cv=none; d=google.com; s=arc-20160816; b=WJbzxbCL/Hnx8q/sJ+X/Nhmjeew5tv9eujmOeXUsGMot5LE8C1Z9XoZQvxlDh5cgDx asmiV1fPqgLFLqlC3UQ2IpM9IEXqkOQVwXD+NN2jI2N5nJngDJU8gyhSam7+8UZQddBU XfGOp7uqdlprlXqWjEUXk7iWOiCNicpZ+A8y6FcPpJMOA/u521o2R0zLJz+t8MEx1wyV wvEGHNNSmwVD4bMEBhDk1+7rHQwLHz9cKecIB59Xj0ByGPCFEmRJDT4QNpUxiz8sSXDP /3y2CFU+mHjaxcOJ5ZKfqipA8rOX0Lev4jF4CQ6+fXNUI++9d73rKPdItyFEMevTvMJ8 kByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lFPoyAQy81IlIUs1nOX+kCmKKNBXMDxPA4wV9I6SLJM=; b=OD2oe8F6YFyD3a2UMGn/Y6pdFNIZYG6CoRc3LB+szQnomYxxu/aaK9BvOBySh8/BnE 16t3pMRGItzBRG/IEZ20OpgWaPWVh/qzjLAmTYaS0CatpBY9aOz2mvkWi4PJHL02+x+1 DtUSKn7fZYHm+NYCVLVbft5lp55iGGHIGlkI9A45OXe3HrNxbxMz0YaJOQJJknZrmsNG SFQTGWX5Fp7dkSgU/8Tqh6m6agsTwkovYu81YxyOWBW8VxLcMP4MpHiFrkEgF7011eud GIx44XGSRNfjWTZj3BE/MEeOv2z8AOMlgdxL8QkU92IrwUgpK3a4f7OPSClQTK5XC/ED cM1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R3TVGEQI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m38si4005891pgl.125.2018.12.14.04.13.29; Fri, 14 Dec 2018 04:13:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R3TVGEQI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730996AbeLNMMn (ORCPT + 99 others); Fri, 14 Dec 2018 07:12:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:59940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731980AbeLNMMm (ORCPT ); Fri, 14 Dec 2018 07:12:42 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5D35214D9; Fri, 14 Dec 2018 12:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789561; bh=ylrJRX0SkUAu9egZLviKtXTf8miNJfxQ1yQCzTCsyKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3TVGEQIA9d8/Lb1J7wjayiQpwWZXfLyscIOipzo63jY9wE+FKBMb2S+xKXbN7X1x qvOEIqWhbLP3VGC4UNAg7tAvWj8rRSXwXp/rt52jpMAZ8lqV6/bTYeOtG8rsggv8EH Gj12Soo6unhnA28uxA/28HPr43k9i/5SDG7NmUDs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tzung-Bi Shih , Mark Brown , Sasha Levin Subject: [PATCH 4.9 19/51] ASoC: dapm: Recalculate audio map forcely when card instantiated Date: Fri, 14 Dec 2018 13:00:21 +0100 Message-Id: <20181214115715.200081429@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115713.244259772@linuxfoundation.org> References: <20181214115713.244259772@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 882eab6c28d23a970ae73b7eb831b169a672d456 ] Audio map are possible in wrong state before card->instantiated has been set to true. Imaging the following examples: time 1: at the beginning in:-1 in:-1 in:-1 in:-1 out:-1 out:-1 out:-1 out:-1 SIGGEN A B Spk time 2: after someone called snd_soc_dapm_new_widgets() (e.g. create_fill_widget_route_map() in sound/soc/codecs/hdac_hdmi.c) in:1 in:0 in:0 in:0 out:0 out:0 out:0 out:1 SIGGEN A B Spk time 3: routes added in:1 in:0 in:0 in:0 out:0 out:0 out:0 out:1 SIGGEN -----> A -----> B ---> Spk In the end, the path should be powered on but it did not. At time 3, "in" of SIGGEN and "out" of Spk did not propagate to their neighbors because snd_soc_dapm_add_path() will not invalidate the paths if the card has not instantiated (i.e. card->instantiated is false). To correct the state of audio map, recalculate the whole map forcely. Signed-off-by: Tzung-Bi Shih Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4e3de566809c..168559b5e9f3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2018,6 +2018,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) } card->instantiated = 1; + dapm_mark_endpoints_dirty(card); snd_soc_dapm_sync(&card->dapm); mutex_unlock(&card->mutex); mutex_unlock(&client_mutex); -- 2.19.1