Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1451190pxb; Tue, 17 Aug 2021 12:03:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+BZi6UqkmNHb4pRqovdbVyomszzu5mWu/Uz4CKu1d6ycWbOmFnPNHV1kw2t/TzbWBtOoV X-Received: by 2002:a02:1942:: with SMTP id b63mr4245593jab.111.1629227020507; Tue, 17 Aug 2021 12:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629227020; cv=none; d=google.com; s=arc-20160816; b=t4+alYZ4if8F7AVcoKUC7/RgAwDyvGoxKPbKktPFD+BSPGPXPaMuCF09gBgntnIkPi v16yoxpSFCJKq/8QJpUOli7VGM5O7uxNKcwxB/XP+ZO42eUl6AtN67ksNJrnoNXcIxVa T3s45obuRuN3Dj6lP8xNVy1tIx+1mUEptlzOA32sRe2mwmRjKPytxkVk8pmCCdx0plUC xUv+LJoZMBP/Ee06Uxo0aU6iKoHqOnCDXRBT9Y1oLKXRfu2WIbHvaAspTSbuxilAr89h /2Yxz5LKj1XAEqroE3FymOdIcA7KyOg+CoN9/46JuNIyEP4ERBOz2aVxVe8Na/KaVcLE oL2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WQbTqdXCytRjFrb+rE7SwS+FJkY8A80fGDrhlfl/WfM=; b=sNTeHF9PdHbfo/D2Vj2KB578Q0XyVZGKGnbNNvLWDQzZVlm483Pl2lAoWdsEYbL2OC +7CsGHm4R958a72Z0cS1BssL5OELisZXbXSpyzn5I+lqFyodiDltDAyZZ/8SK37Rrjav wRt5pb5W59lCSMOrN/PQGllfcT9qZyvsYRchqntYcGN7uy15eOby5MY9SYCVApSXrSoh xvXoSLnuKVlP9rJdoydjC6UObAe7swsKIemohK+/5oYP0TrgmaDNX1vYVMJ4jWKWCy7I LzRk8pjL18dhb0tgDxazfUtzGczErSxs/RsHZPMda+/LWSiJzkS+kEpap3moPMUzDALa uFpw== 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 y14si2881577ilb.66.2021.08.17.12.03.28; Tue, 17 Aug 2021 12:03:40 -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 S233499AbhHQTC1 (ORCPT + 99 others); Tue, 17 Aug 2021 15:02:27 -0400 Received: from mga18.intel.com ([134.134.136.126]:18728 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233385AbhHQTCH (ORCPT ); Tue, 17 Aug 2021 15:02:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10079"; a="203324527" X-IronPort-AV: E=Sophos;i="5.84,329,1620716400"; d="scan'208";a="203324527" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2021 12:01:34 -0700 X-IronPort-AV: E=Sophos;i="5.84,329,1620716400"; d="scan'208";a="488147352" Received: from aaadelek-mobl3.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.12.89]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2021 12:01:32 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, vkoul@kernel.org, liam.r.girdwood@linux.intel.com, Andy Shevchenko , Dan Williams , Jason Gunthorpe , Christoph Hellwig , Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , sound-open-firmware@alsa-project.org (moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS) Subject: [RFC PATCH 2/2] ASoC: SOF: trigger re-probing of deferred devices from workqueue Date: Tue, 17 Aug 2021 14:00:57 -0500 Message-Id: <20210817190057.255264-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210817190057.255264-1-pierre-louis.bossart@linux.intel.com> References: <20210817190057.255264-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Audio drivers such as HDaudio legacy and SOF rely on a workqueue to split the probe into two, with a first pass returning success immediately, and the second pass taking a lot more time due to the use of request_module() and the DSP initializations. This workqueue-based solution helps deal with conflicting requirements a) other drivers should not be blocked by a long probe b) a PROBE_PREFER_ASYNCHRONOUS probe_type is explicitly not allowed to avoid a deadlock when request_module() is used. This patch makes sure the deferred probe framework is triggered when the provider of resources successfully completes its initialization. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sof/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 3e4dd4a86363..cecc0e914807 100644 --- a/sound/soc/sof/core.c +++ 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(); + return 0; fw_trace_err: -- 2.25.1