Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp756140rwb; Tue, 27 Sep 2022 04:22:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ipjoKOWFBFNAmLulDRl8lUnGc3QlhdQ/gDkUOY+/vPRm3Un2Uczf3uQlYB58fy5GXpU6N X-Received: by 2002:a17:903:41c6:b0:178:348e:f760 with SMTP id u6-20020a17090341c600b00178348ef760mr26864725ple.123.1664277749925; Tue, 27 Sep 2022 04:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664277749; cv=none; d=google.com; s=arc-20160816; b=XafDs0hNEOUFPeQwdMiiqukD9wJ4D0rFIwAQnaG8ctXuuCCL2YmiLQfGz25sQTpU/V fgrkcsVyfmNLeKFw6S0oUkGYSJSHpwizXsHT+4VKy5vSmNDiQgtgjJ3+Fd05UXQlvCXw qAKdciKI2ncq21zuM43n15y8T57e7lvm3NQV1Rdn/p8T7fDwkO1ozX06iV5wwuAXY9V+ m4DzMbgYFB8V8GYooTzsKz+1NKc3YohOSXd9w/AoyN+58dvP5ClKPhi/I+k5rTaxTGGn kDMfGrLZPTO+W4OmKDS3KxXY03n4fhehLSEaq0HjdyoM7Todc/Pp8OTAyEQCbIQl3ODR p8ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=F3M6o/eRNMRQXBZCn7duqB55ktaXrB9BGjauAGdzu+0=; b=JoiqXsQcP68ViDr1dw+UCSHWF4HILsNLY51uh419bToAKpgxMk88g5wxEs5Uuh6sew emy1pEL6mWuS3dwTgyeS88+dib7DyMRj7p/N5+5BH/4SMkeGkQxlYgioiXJGDqyfpXK/ yCw0RDOqpn+abcDS3IYwwPdZGnVDFUTrIAo2WF/MQKwMpDULYz90QtTA36O7HD4GH/h8 gN3qGr1DbtQSiCmAonwEZi31RbkdiGYxXaS7++Gtu2me1ZnCmAcC8MbL6CjNuXxayZP9 GQ2Of9GdWr8m2qxEBXIPoOfqzN9a2ixEC1UI2p6Gd2nI8UujLFTow3LY72EQYfTPWRbV Wd3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i69-20020a638748000000b0043c20a84a57si1514645pge.17.2022.09.27.04.22.18; Tue, 27 Sep 2022 04:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbiI0LAp (ORCPT + 99 others); Tue, 27 Sep 2022 07:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbiI0LAk (ORCPT ); Tue, 27 Sep 2022 07:00:40 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FB7F27B06 for ; Tue, 27 Sep 2022 04:00:30 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTPS id C361E520359; Tue, 27 Sep 2022 13:00:27 +0200 (CEST) Received: from lxhi-065 (10.72.94.21) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.12; Tue, 27 Sep 2022 13:00:27 +0200 Date: Tue, 27 Sep 2022 13:00:22 +0200 From: Eugeniu Rosca To: Cezary Rojewski CC: Eugeniu Rosca , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , , , Yanmin Zhang , Eugeniu Rosca , Jiada Wang , Zhang Yanmin , Ramesh Babu , Dean Jenkins , Ramesh Babu B , xiao jin , Pierre-Louis Bossart , Amadeusz =?utf-8?B?U8WCYXdpxYRza2k=?= , Andy Shevchenko , Ranjani Sridharan , Bard Liao , Kai Vehmanen , Peter Ujfalusi , Guennadi Liakhovetski , Rander Wang Subject: Re: [PATCH] ASoC: soc-pcm: fix fe and be race when accessing substream->runtime Message-ID: <20220927110022.GA3802@lxhi-065> References: <1664210154-11552-1-git-send-email-erosca@de.adit-jv.com> <2f5a510b-082a-60e2-5770-58be086b5fc8@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2f5a510b-082a-60e2-5770-58be086b5fc8@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.72.94.21] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Czarek, On Di, Sep 27, 2022 at 09:50:05 +0200, Cezary Rojewski wrote: > On 2022-09-26 6:35 PM, Eugeniu Rosca wrote: > >From: xiao jin > > > >After start of fe and be, fe might go to close without triggering > >STOP, and substream->runtime is freed. However, be is still at > >START state and its substream->runtime still points to the > >freed runtime. > > > >Later on, FE is opened/started again, and triggers STOP. > >snd_pcm_do_stop => dpcm_fe_dai_trigger > > => dpcm_fe_dai_do_trigger > > => dpcm_be_dai_trigger > > => dpcm_do_trigger > > => soc_pcm_trigger > > => skl_platform_pcm_trigger > >skl_platform_pcm_trigger accesses the freed old runtime data and > >kernel panic. > > > >The patch fixes it by assigning be_substream->runtime in > >dpcm_be_dai_startup when be's state is START. > > > >Signed-off-by: xiao jin > >Signed-off-by: Zhang Yanmin > >Signed-off-by: Eugeniu Rosca > > Hello, > > The change seems to be driven by the skylake-driver problem. Agreed, based on the author/co-signer's e-mail and the call stack. > With all due > respect, why not ping owners of the driver first? There are some crucial CCs > missing. Some feedback already provided by Pierre-Louis Bossart (many thanks). Cc-ing more Intel contributors in the sound subsystem. > > I'd like to know more about the scenario you guys reproduced the problem in. This patch was originally identified in the Intel Apollo Lake v4.1 KNLs. Given that the change itself is in the core sound subsystem, our internal assessment was that the patch might potentially be relevant/helpful on other HW platforms. Our intention is to confirm or invalidate this assumption with the original developers of the patch, as well as with the audio maintainers and the members of the alsa-devel ML. > Configuration details and kernel base would be good to know too. Since our > CI did not detect problem of such sort, if the problem actually exists, we > would like to append a test or two to cover it later on. If there is no evidence that the patch is fixing a real-life issue occurring in the latest vanilla, I agree to drop the patch. So far, I do not possess this evidence myself. > Regards, > Czarek Best regards, Eugeniu