Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp827725rdg; Fri, 13 Oct 2023 02:16:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk3OcYXiW2IX/xJr86SaVYTJ1rratp3XqARtCsJC4bSMkH8S6X9jcpWJgesE91lAVJzV4r X-Received: by 2002:a17:90b:b06:b0:27d:9b5:d6f8 with SMTP id bf6-20020a17090b0b0600b0027d09b5d6f8mr5570607pjb.49.1697188564325; Fri, 13 Oct 2023 02:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697188564; cv=none; d=google.com; s=arc-20160816; b=WVHpeZcYfTDFLnBE/2agAymmTOiI58Vl0Vv2YbakLa/5zWBQA8qH6XOHFz3xCUYgq0 0Qw4q1LkyR+q/KNyJV8d3mTFdBUpPuU+k79J/25uYsBOhUyQnMVy+7ODO+UsiI4g+DPl VIBVQ09bHY/6uOQuGhmyB2z2wVoVwYwLJCdwCto5sLCEPPNz6u/EcEfCWVhVX9yOfJt5 /2p+c9uIF9wcOeHwgrnQLVox3sSOiWUs+mimDkXcwm5uNVUMtQXneqGOpsNtfCQ5b2yy 9xKt1NONHwbXbrph3Lk4+ERkTsUlsNIaeZ+yOKrF0ZfeTpK2HkrM/q1V2sQ9p/PtI1oJ x/wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=efOBm3e13ZjEOj+ZGaXSfOb0Hkfg1ATCQXj1BE9CT/M=; fh=08GkTM21HxENFUnjLfdtF3D3WuEkZgJ/44x+7exc9aM=; b=J1UFic1x7CmofZWs24nzwEEGh3oSK8RDcwXiqSONJV45PlZ2DCIuW6UIHpRC+rn7FZ G10PG8e+RfQQDsJDv3KVJeEU4BY39b8ZYGsTnd9NzrJpcxB+2FOICnfi2nSS/nxbPZDV R9fTEPEg7mH3WODL2tawz4+aB2jigGtz6lwbZrWgOuTIzzA7AXPuSCZ35YPbgu2uAVha coeDCLjNNfEfgJkGrtCcFGGLgxTixL+GG7Lw39fha1CFPTGaCktXLBoBN3Zys4Wz+N73 KxvUkjrnQuFMOUbU1mMkr3nsjXep9CpiUry4nV60tx0YQaHN/PCfJcRB1mwcykMXrvSh XLlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lLi3T9YO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=eCWLIDHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l6-20020a170902d34600b001c9cc3a07a7si3678184plk.232.2023.10.13.02.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 02:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lLi3T9YO; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=eCWLIDHO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E0CB28083493; Fri, 13 Oct 2023 02:15:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjJMJPQ (ORCPT + 99 others); Fri, 13 Oct 2023 05:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbjJMJPO (ORCPT ); Fri, 13 Oct 2023 05:15:14 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A96795 for ; Fri, 13 Oct 2023 02:15:12 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C174921871; Fri, 13 Oct 2023 09:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1697188510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=efOBm3e13ZjEOj+ZGaXSfOb0Hkfg1ATCQXj1BE9CT/M=; b=lLi3T9YOusq8Wctbl0n66KEIJZRhNfDyerrLnb7Pe1zQWNzFKaPw2kLCiAhooVCe2YxEbv LwUWxooe0UHbboAP+gPikEwlO0HmLPtg5nwJbGOADV8AR/+U2X7OuBwexobfmYdT9m/kyc JfyncHoug92gPyW4WDtR13Ah14H0yyc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1697188510; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=efOBm3e13ZjEOj+ZGaXSfOb0Hkfg1ATCQXj1BE9CT/M=; b=eCWLIDHO5dkzaxRvzaXYHOIOJKMneeEod4anzkMO5Ri2hw3Qyp2EW6bVrXKOds4pW+o/po Mu3gwtC1+/Y2qYAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 733411358F; Fri, 13 Oct 2023 09:15:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id zEk2G54KKWU/DQAAMHmgww (envelope-from ); Fri, 13 Oct 2023 09:15:10 +0000 Date: Fri, 13 Oct 2023 11:15:09 +0200 Message-ID: <87il7aopcy.wl-tiwai@suse.de> From: Takashi Iwai To: Maarten Lankhorst Cc: alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Daniel Baluta , linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org Subject: Re: [PATCH v7 01/13] ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. In-Reply-To: <20231009115437.99976-2-maarten.lankhorst@linux.intel.com> References: <20231009115437.99976-1-maarten.lankhorst@linux.intel.com> <20231009115437.99976-2-maarten.lankhorst@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -3.10 X-Spamd-Result: default: False [-3.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWELVE(0.00)[15]; MID_CONTAINS_FROM(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 02:15:26 -0700 (PDT) On Mon, 09 Oct 2023 13:54:25 +0200, Maarten Lankhorst wrote: > > In an effort to not call sof_ops_free twice, we stopped running it when > probe was aborted. > > Check the result of cancel_work_sync to see if this was the case. > > Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful") > Cc: Peter Ujfalusi > Acked-by: Mark Brown Your Signed-off-by tag is missing. Could you resubmit? thanks, Takashi > --- > sound/soc/sof/core.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c > index 2d1616b81485c..0938b259f7034 100644 > --- a/sound/soc/sof/core.c > +++ b/sound/soc/sof/core.c > @@ -459,9 +459,10 @@ int snd_sof_device_remove(struct device *dev) > struct snd_sof_dev *sdev = dev_get_drvdata(dev); > struct snd_sof_pdata *pdata = sdev->pdata; > int ret; > + bool aborted = false; > > if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) > - cancel_work_sync(&sdev->probe_work); > + aborted = cancel_work_sync(&sdev->probe_work); > > /* > * Unregister any registered client device first before IPC and debugfs > @@ -487,6 +488,9 @@ int snd_sof_device_remove(struct device *dev) > snd_sof_free_debug(sdev); > snd_sof_remove(sdev); > sof_ops_free(sdev); > + } else if (aborted) { > + /* probe_work never ran */ > + sof_ops_free(sdev); > } > > /* release firmware */ > -- > 2.39.2 >