Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4030242rdh; Tue, 28 Nov 2023 09:54:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJpd1Rj0scmg6fytGqlgrk3Jocrxarqf6zMM1XIKHBtBFL6siVFMJBhCd9i9mun3x1nFg6 X-Received: by 2002:a17:903:2444:b0:1cf:da41:7292 with SMTP id l4-20020a170903244400b001cfda417292mr6921870pls.45.1701194076605; Tue, 28 Nov 2023 09:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701194076; cv=none; d=google.com; s=arc-20160816; b=efsPv0rIlw7qRuFtCVfESKEqRWdWKCP2i0zqdDNJNcQHnvCRU1fzvV1xRGHP7gihEw 2ltr/AvcGZU+car4Rssht7nibMDrVuQb/JSLmZp3iDdodDcWR6xMu/bsd9yhDMBVfp+H yauOUOQ/QKuh7Y6Wp/AYHxV4Pybn1TMOJyrkokGNneW7ZZv+ZRtJAimrIYtzjkFtaC8b ufjBWawaWwhmS1e/Xc7p+LFY/Q064FpDOdjSQ9g4/QdR5F/S4QxxxijWNMzG7Fix30g9 NFNG0NBh4szmAwuqcqwlTnX1YpRS6+r64ADD14mLH9i/fnBCzSFJNSDV8UW6zrtsMB91 +SMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=OALymxb8Z8ma0anJAq2DmfjnBJS1seu5xd51jpX/eeI=; fh=qOzjvlxTKswWK3XLGyce9i3nPMtFLNEhp7ngSyyCsB4=; b=gIpvJE68PxEiagDeDj8YdQI1mU1j1l6qZEca860VBGCoW7T3iE89NKfhjje8jPzEmJ +pRxM1T+5SQvyZj2S0pTpcxHIborUFlFe02sSf1TuWKjSsb/yt5juG/iun/QHwrqm6So YRUD+5Kygi2+rq4HRjbujL12s8LdNxfkltyrLRTU0HxrwdYevlc638erU6wg/3QCiQwL weoyOXbQNReSKNv5ymjoLPonyuhFHRqTVulT8bqfQOOiaCsJzOBw0SdUOvd85byAZox8 Zb1UBXrWsk9hCaNsqm6WLHfevb6TqcVi1WGtY/pnChxdFlk+1DMgzQ7+Pk3+sr7QIZN1 5e5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XmmeJA66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h7-20020a170902ac8700b001cfc419e609si5956029plr.67.2023.11.28.09.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XmmeJA66; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D6A6E8097789; Tue, 28 Nov 2023 09:54:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346536AbjK1RyB (ORCPT + 99 others); Tue, 28 Nov 2023 12:54:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346350AbjK1Rx5 (ORCPT ); Tue, 28 Nov 2023 12:53:57 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB278AB; Tue, 28 Nov 2023 09:54:03 -0800 (PST) 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:cc:references: from:in-reply-to:content-transfer-encoding; bh=U7SHRv8kT+n7b9v0GPnWjN8fPXLgdna0HJB40XzjEaE=; b=XmmeJA668oj5wlrR1op3ftWM+hNrTkF9WzqLhxdGSVWje9J4vGobtQoE TTWIrPxMUuf9z7BHrUTd1fRtTY+fRDByVXYEuMcwCFjOZcCUP93AZ33Xw nGwzVSs7CAEMMgUocsMzNg6ag8m8lWq3NEQQHY5xSzAfsjgQnzXbI+kKt 5a3NT8hUmuVPR3LHpf+2eQyHknIHKz4O6lrHwuE0gcLRQXVYBmZ0a4zYN /yLZc3rAcCRJsC0Pyf5tJEEupPaHLVm9iYk8EqBn8gPmtxYRl3XADJ0zX yF1ZgU6duAgCdMKEup3txbBB99KARLpBu4O07mzdIo8Dxykif12yHH2Qa w==; X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="424127120" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="424127120" 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:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="834715363" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="834715363" 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:54:01 -0800 Message-ID: Date: Tue, 28 Nov 2023 11:49:44 -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 Cc: linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Sanyog Kale , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , 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> <4317ec5d-8eb8-4a2f-aebc-cc04f2aba145@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <4317ec5d-8eb8-4a2f-aebc-cc04f2aba145@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:54:34 -0800 (PST) On 11/28/23 10:59, Krzysztof Kozlowski wrote: > On 28/11/2023 17: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/ > > ... and I forgot to thank you Pierre-Louis for patient explanation of > the case in my previous try. Your review was much appreciated! You're welcome. It's good if we have multiple platforms using the 'stream' concept in similar ways.