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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED3FBC07E97 for ; Tue, 28 Nov 2023 17:55:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CCBD9E12; Tue, 28 Nov 2023 18:55:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CCBD9E12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1701194143; bh=ChXBVBqsS5xdsQgc7KH0fBuDsClye8kOccQk8AVBPTw=; h=Date:Subject:To:References:From:In-Reply-To:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=MB/RfC6dqiq2XFPoiqd4M673wi1pGgOFb47B7qeo2YinWYa1AsplYwN3kCrqVnoZR HkgkknVXl6CjrzTZoWqPW5DYFFCi26l72Jz05jqEYkyayone45OMFSY8FCQgmTrgOm yHy5zhp/Iv2mfSLRGdVjM6yeenRceuF6TEzpdk1A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26029F80624; Tue, 28 Nov 2023 18:54:19 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2F3EBF80614; Tue, 28 Nov 2023 18:54:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB30EF805D2; Tue, 28 Nov 2023 18:54:11 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7D11FF8016E for ; Tue, 28 Nov 2023 18:54:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7D11FF8016E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lUgjdgiy DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701194043; x=1732730043; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=ChXBVBqsS5xdsQgc7KH0fBuDsClye8kOccQk8AVBPTw=; b=lUgjdgiy5IjAUY2XGJmxtQEv/WvmGa3QocjxkRMLrGmfBVsgtS2DM9Yx J4wceHid7sznZl2zSj0rEdWyBbbR57n3jl29VZIkpLPQL3NAuT7RAd7A7 mdkHLKqW+0RBfRPQ0AmO74PR44HA5/0fxYcnfZCRWsHHXX3hG6RVtrMep FsDYv1pjskgufcCRPALloGZ+AoIFeI0g/rM7GGUGsvJQVRUsyrkSk2WWN sx1zpFRpgnVwXv70qwB/L/vAzMqDpboZVLoA9PTIX3W8YaFXVCRxsa2mC k+IkmtzUH4C5SIzx0QQGlCBJWATbiWGrQJ3/hlx2cVesp3kZx07tbXl+X g==; X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="424127111" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="424127111" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 09:54:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="834715335" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="834715335" Received: from skumarso-mobl33.amr.corp.intel.com (HELO [10.255.231.208]) ([10.255.231.208]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2023 09:53:59 -0800 Message-ID: <56b8175d-ce80-44b5-a738-22a0802e520f@linux.intel.com> Date: Tue, 28 Nov 2023 11:47:27 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] ASoC: qcom: Move Soundwire runtime stream alloc to soundcards Content-Language: en-US To: Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org References: <20231128165638.757665-1-krzysztof.kozlowski@linaro.org> <20231128165638.757665-2-krzysztof.kozlowski@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <20231128165638.757665-2-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID-Hash: WTGYC2QFDUCFLGYX53XQF4K57ZQE3L3G X-Message-ID-Hash: WTGYC2QFDUCFLGYX53XQF4K57ZQE3L3G X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 11/28/23 10:56, Krzysztof Kozlowski wrote: > Currently the Qualcomm Soundwire controller in its DAI startup op > allocates the Soundwire stream runtime. This works fine for existing > designs, but has limitations for stream runtimes with multiple > controllers, like upcoming Qualcomm X1E80100 SoC with four WSA8840 > speakers on two Soundwire controllers. > > When two Soundwire controllers are added to sound card codecs, Soundwire > startup() is called twice, one for each Soundwire controller, and second > execution overwrites what was set before. During shutdown() this causes > double free. > > It is expected to have only one Soundwire stream runtime, thus it should > be allocated from SoC soundcard context startup(), not from each > Soundwire startup(). Such way will properly handle both cases: one and > two Soundwire controllers in the stream runtime. > > Signed-off-by: Krzysztof Kozlowski > > --- > > This is an entirely different approach than my previous try here: > https://lore.kernel.org/all/20231025144601.268645-1-krzysztof.kozlowski@linaro.org/ LGTM Reviewed-by: Pierre-Louis Bossart