From patchwork Wed Nov 14 22:26:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 151133 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6250996ljp; Wed, 14 Nov 2018 14:27:03 -0800 (PST) X-Google-Smtp-Source: AJdET5fvenK2ufMXjSW06xzKe3sr+nmWG8F2yoenElys3y60qkO23ZknnsSNc3ONwbyumAO6afim X-Received: by 2002:adf:dd07:: with SMTP id a7-v6mr3591158wrm.2.1542234423318; Wed, 14 Nov 2018 14:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542234423; cv=none; d=google.com; s=arc-20160816; b=FCgVkiN65FH+mGYgbVcVv+7YD885mrkpdumhJ45AEObgsYajBGYNpWVQ9iGaan/H2e vl/+1R8u241fenz5YSXs4OTrQQTkrgoDyK1bYRbt5fg7w+kAgtEGqQ/+LlNUgQfOqwjc gVMC/C57uH1+GuerV190K4dVMXCyPfwqlHE7ijInwGWNLKrQsfj6ka4gdg6EJUZ3KS9e qAMeSHMmNcgEpOhOo7pe4zXRZk1OVSJDac8qLR7XikYp1MDuknjfhQjV+ladejp4p3io alm6sWZTxu4BN1ZuEggRR2OmKFjcdEH4Oj6DBWDR3jqLg+19FqzihNiJzUuH0mmA9en3 xV6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=PToxeNsMdeSvI8PduZ/mh7vvQJyBV0DA1e8SPJ1PYYg=; b=lsjh3d9RDhqc9G8c3UTJcayQN/F/pMXk9NaXuqmU8kvA8Iz2nfR3sPPmPGB2iSf9iv XU4gnSR2U0D3BV/T/XJxxdEwZlpeHh/OV+F14i/d5iNhtPGtJdl0LPKw809Zw2Pfk2u+ H2U+EgWToNiRDlCsMJvEfsp/yYLtihftgiiZ+VTF/Q8zOoTvTf42q/8K+dFKXjeHpGFQ foxw5RSbX9ZttRvrsL8jvi6IlerMgFSEOw3prfZ/khogAeM9yuVu90A3sTOvteysZEoh SojsEyRQaXDuWzmdz++eOySeryT5AcXWGky/u8LhdUNYoVnr0ZoqlOSX3q3vAv6C5MDJ Ag3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=uTcfO02U; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id e1-v6si19407682wrt.130.2018.11.14.14.27.02; Wed, 14 Nov 2018 14:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=uTcfO02U; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 53A60267AEB; Wed, 14 Nov 2018 23:27:01 +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 2D9F3267AF8; Wed, 14 Nov 2018 23:26:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 4A31C2677E8 for ; Wed, 14 Nov 2018 23:26:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=Wh62D6pgINFPcOh8qZCawFp5orJGp3xaJvleEslcBac=; b=uTcfO02UqKWj P5lnQ6gQH/8yUM+KBdaRzKoHiNxmdrkqsb2EX04+nnPRzejcnctIdDYDF+wTezqC2fPNbACEunDk2 NWcX5x3AU2QkkiE1He7XnclwkFFdMiAP9R1wjWsKTyEtD4T5DF38zDFtB5Od1rE8qRHwnWp47fir8 DEsuY=; Received: from [64.114.255.97] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gN3ce-0004ap-Iw; Wed, 14 Nov 2018 22:26:56 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 9B844440078; Wed, 14 Nov 2018 22:26:50 +0000 (GMT) From: Mark Brown To: Tzung-Bi Shih In-Reply-To: <20181114090613.140247-1-tzungbi@google.com> Message-Id: <20181114222650.9B844440078@finisterre.ee.mobilebroadband> Date: Wed, 14 Nov 2018 22:26:50 +0000 (GMT) Cc: alsa-devel@alsa-project.org, lars@metafoo.de, cychiang@google.com, lgirdwood@gmail.com, tzungbi@google.com, broonie@kernel.org, dgreid@google.com Subject: [alsa-devel] Applied "ASoC: dapm: Recalculate audio map forcely when card instantiated" to the asoc tree 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 The patch ASoC: dapm: Recalculate audio map forcely when card instantiated has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 882eab6c28d23a970ae73b7eb831b169a672d456 Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Wed, 14 Nov 2018 17:06:13 +0800 Subject: [PATCH] ASoC: dapm: Recalculate audio map forcely when card instantiated 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 --- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+) -- 2.19.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6ddcf12bc030..b29d0f65611e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2131,6 +2131,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);