Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4030219rdh; Tue, 28 Nov 2023 09:54:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFS7NRsDAVbPuTTWTpDQ9jBsZYvkjYuDBW3XLh1zoGkwr5o9XD5O8DRAAer9CRgLv/btg22 X-Received: by 2002:a05:6a00:478a:b0:6c9:af71:1de7 with SMTP id dh10-20020a056a00478a00b006c9af711de7mr23772842pfb.11.1701194074231; Tue, 28 Nov 2023 09:54:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701194074; cv=none; d=google.com; s=arc-20160816; b=DpebL0LB4QOWV77EssYwda5wu4LpoAHZzl1udvp4IruIFhm5y6+ngGMRO3pkDgzRxh gphtLu2+n3/FID4t4Nk/X7llALG0VlX4xBWhEIqh9oSScpEt7hoEgGxNWL2e1qsqq6oS XcOYjhdjkv532JcxFFf8Dlixs+DPxZBuNX0VLNqDO28LbLCq0IX6SWFdy2jTtxcusuOv XfLf1+w9COs0PnkLvaqFctURybzDGAYNsewq3XOYecd0K3lgHq6c7z968K6b2smRnOSF YCvlX3QZp4kKHhbjLQTv+65wUnX7ttL06nBbtBKG3xZRzbDAJRU/RTFOCBz1d6tCWacv WHtw== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=rdsyZJWhH642W7J8rY6qKi6fRd+I+0MSiXmUfBY55Xs=; fh=qrNSO+80abD0pPDXgyp/EObHD19dpxnCeGa/9DgcsEs=; b=f654Fv6xmVn15Fuc/F7YA3Cc0txrgHaqojj86bcK7RYixwZpIQbtdw+CiVMPVWTamj uHoRsBkwCfqT5WEPj8AZMnOngjEs8SnVV9uE2QtuEQ3EcW5sGldCycpJdVeX+p+INIg1 Mp8i8UCCmA6UyTTtJIJh1Ap/RhRmWidj8R8ohjzA5QdJh8H7WUena8IKCSFykjyUF8eI 11KWSGgsocp68Ww1464Dix/+iuG/TGFzHqztihK4/yXgm0/P/QQhmikHeN/YauJjRQPd FUuIrU53pTFz+aKRTD7qoewjqK2AFGC78+fjhdqUhxz9I8/N0KoILPiB3SB2HLyT939S hTBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M+3okfD4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id 29-20020a630c5d000000b005b87df75d54si12715952pgm.83.2023.11.28.09.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=M+3okfD4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 7FBB5804C23C; Tue, 28 Nov 2023 09:54:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346475AbjK1Rx7 (ORCPT + 99 others); Tue, 28 Nov 2023 12:53:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346517AbjK1Rxz (ORCPT ); Tue, 28 Nov 2023 12:53:55 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC962C1; Tue, 28 Nov 2023 09:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701194041; x=1732730041; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=ChXBVBqsS5xdsQgc7KH0fBuDsClye8kOccQk8AVBPTw=; b=M+3okfD4QsWlMOq0Gs5bGvspqg7k3grNVXenKtWTszf+IVbT3DfIF5wR CYOJ7QE1m2uBHA/6uN8YyhXLLnGEoZNlIBu1k83h3S6ghbFHjOocHu+Vk qvkt+vyXlo+Yy0bpjPuBZdSNh4z4Lj4PrHWVsue3RH/sRgsHoO+Uh2MAb L/nRk3miSEGRx0LrBsg0p+gJ8pQ5+5aGysEKZVFxZjW6JV+tNKrY0/nX7 9Xb0gcpCt1xRt7jbCGBjaVJqx04WxNH1r1OEusMDX/Z/N2YI6Ux2isJOl x6+RFHDp65kvXXktHZkQ1ajwTGZdJ+5NGKlz22hPyy+oKU/+y6vvk5EFc Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10908"; a="424127108" X-IronPort-AV: E=Sophos;i="6.04,234,1695711600"; d="scan'208";a="424127108" 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 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:54:31 -0800 (PST) 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