From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 077F4C6786C for ; Fri, 14 Dec 2018 12:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C30D3214F0 for ; Fri, 14 Dec 2018 12:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789691; bh=8gSfu1FfUKe2hW003MlIabwGJdFCeMZY7mrsns3IM+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZlsQKRNdERbw+kVKZryrMeyoRKDLrWkS1KAzW2SlnIU1FWjRAu2ezqAWE0mX6nxht YyIADIFp2P46eB4hz3wqSZ/O0S5fJmDFo0BmGWTTCGbnRhtlZ9A7PYiPw2q94Purb5 m0HHzrXMtUDzGAw6DsxUTVNOryU/cwRq+vJZ64V0= DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C30D3214F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732439AbeLNMOu (ORCPT ); Fri, 14 Dec 2018 07:14:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:34548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732422AbeLNMOr (ORCPT ); Fri, 14 Dec 2018 07:14:47 -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 9F8F52133F; Fri, 14 Dec 2018 12:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789687; bh=8gSfu1FfUKe2hW003MlIabwGJdFCeMZY7mrsns3IM+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQ5jXzGrzIVdJHrca3mIYRHAGGyZbPx0tuZ1QpTLSlGL3epXBpK2hZpiR/tDe8saQ CTcZzA7zihjK6pU3nujFZOAHSuY50H3WOZip/vLiYZ9UIFuAMsS6NGl1Vu/otJNY5J 4YT7n9VVIv8yk7g8EjALmQBcP4Gzau5KkYPcCLGI= 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.4 15/88] ASoC: dapm: Recalculate audio map forcely when card instantiated Date: Fri, 14 Dec 2018 12:59:49 +0100 Message-Id: <20181214115703.411783905@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115702.151309521@linuxfoundation.org> References: <20181214115702.151309521@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.4-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 fa6b74a304a7..b927f9c81d92 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1711,6 +1711,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