Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp555158pxb; Wed, 18 Aug 2021 08:28:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzreP7Yy2VOv3vMSmwIvXiF1BcHKc6lyAOFZHKL9MbsCwcM3L8WBhmEi6YTzEvKT38W7wmn X-Received: by 2002:a05:6638:3465:: with SMTP id q37mr8428376jav.113.1629300539138; Wed, 18 Aug 2021 08:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629300539; cv=none; d=google.com; s=arc-20160816; b=pxg32aOAfIZODONi9wgzpnmR/mXzccVO8EAfr3CcuoBr1M5Y2kZwmAjiFqvDsBFPX3 N2Pvg3kZTOsOAP0kn1p4MOk9HVEctNxfLcA2tLoBAoZaG5i6T0XMZz574ENAfkhOcGN+ RyeGEw18zH9njzl4E3EQk8q9eWLqEl2ejjvmQxXgsTtxTc0IYNRGnTtsPFXOWKO2500j tijMpmSzD+zDFA4/vqzHQRWCZL52/5HtH9kyyMo+VOH86rLd1j+r4e9iQL1nvSPh9VS8 dsEI2icDfzV7yZeF7UtHFpxgzhjnsJwUliVX5dZmbzZ8SfhYvBu0rYiNnO11CiX3idVk Zgyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=VBMCtD9OOdI4UV7Yu6h/qcLEYhQUuEOhf+uZXdgGiHo=; b=oo10zo4JCpTKV+6o1kBVYAT03j1QfuJHLvlyicrMVzg9qLgLLu3a4m2tD6loEujFRr Z3/gNIwavMmGC0Z5TNxWTjPPCvynn0bTs9IRHRMar/yRXoNQKuJlWTH8PG1UXgjHC474 cJSy2Z1DFUwVeRmJQrsAnus+ITTmsAZjm8dg7SBPJH4P+hJSVA1+Buv5cvhbPTABYYgX uqQPLmm/LinYHPQOkPkyjz2jABL/9Li6VFeCsKY9sNp92d4flyfiAzHKWGR0cUdAG+FQ R8MbRjI2bI0HWVJcKwtbmVUf55Wt+Ty6GLTkL9r0IuS569RiCE6CZ4tUtqtPZr1IyFfN 0OyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si115595ilq.108.2021.08.18.08.28.47; Wed, 18 Aug 2021 08:28:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233496AbhHRP2e (ORCPT + 99 others); Wed, 18 Aug 2021 11:28:34 -0400 Received: from mga14.intel.com ([192.55.52.115]:58543 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbhHRP2e (ORCPT ); Wed, 18 Aug 2021 11:28:34 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10080"; a="216076477" X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="216076477" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 08:25:28 -0700 X-IronPort-AV: E=Sophos;i="5.84,330,1620716400"; d="scan'208";a="449796910" Received: from ksawchu-mobl.amr.corp.intel.com (HELO [10.212.83.236]) ([10.212.83.236]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2021 08:25:26 -0700 Subject: Re: [RFC PATCH 2/2] ASoC: SOF: trigger re-probing of deferred devices from workqueue To: Mark Brown Cc: alsa-devel@alsa-project.org, Kai Vehmanen , "Rafael J . Wysocki" , tiwai@suse.de, Greg Kroah-Hartman , Takashi Iwai , linux-kernel@vger.kernel.org, Liam Girdwood , liam.r.girdwood@linux.intel.com, vkoul@kernel.org, Ranjani Sridharan , Jason Gunthorpe , Dan Williams , Andy Shevchenko , Daniel Baluta , Christoph Hellwig , "moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS" References: <20210817190057.255264-1-pierre-louis.bossart@linux.intel.com> <20210817190057.255264-3-pierre-louis.bossart@linux.intel.com> <20210818120700.GB4177@sirena.org.uk> From: Pierre-Louis Bossart Message-ID: <3985f754-a0a2-92f7-1585-3b177c172664@linux.intel.com> Date: Wed, 18 Aug 2021 10:25:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210818120700.GB4177@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/21 7:07 AM, Mark Brown wrote: > On Tue, Aug 17, 2021 at 02:00:57PM -0500, Pierre-Louis Bossart wrote: > >> +++ b/sound/soc/sof/core.c >> @@ -251,6 +251,9 @@ static int sof_probe_continue(struct snd_sof_dev *sdev) >> >> sdev->probe_completed = true; >> >> + /* kick-off re-probing of deferred devices */ >> + driver_deferred_probe_trigger(); >> + > > I think we should move this into snd_soc_register_component() - the same > issue could occur with any other component, the only other thing I can > see kicking in here is the machine driver registration but that ought to > kick probe itself anyway. Or is there some other case here? Thanks for the suggestion Mark, it would be more consistent indeed to kick a re-evaluation of the deferred probe list when ASoC components are successfully registered with something like this: diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c830e96afba2..9d6feea7719c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2677,7 +2677,14 @@ int snd_soc_register_component(struct device *dev, if (ret < 0) return ret; - return snd_soc_add_component(component, dai_drv, num_dai); + ret = snd_soc_add_component(component, dai_drv, num_dai); + if (ret < 0) + return ret; + + /* kick-off re-probing of deferred devices */ + driver_deferred_probe_trigger(); + + return 0; } EXPORT_SYMBOL_GPL(snd_soc_register_component); In the case of this SOF driver, it'd be completely equivalent to what this patch suggested, the snd_soc_register_component() is what we do last in the workqueue. In the case of 'regular' drivers, the component registration is typically done last as well before the end of the probe. This would result in 2 evaluations (one on successful ASoC component registration and one on successful probe), and maybe on the second evaluation there's nothing to do. I can't think of any negative side-effects.