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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF68ECDB47E for ; Fri, 13 Oct 2023 09:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230438AbjJMJPR (ORCPT ); Fri, 13 Oct 2023 05:15:17 -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-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)[] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >