Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp4072585rdb; Wed, 30 Aug 2023 14:56:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2HK1uGDyMsOscod6H9cXEVJtjl3rrE/jCe7Al2G5B50OwRMOKA8xIOv35/z2IWV6Kk+NZ X-Received: by 2002:a17:906:8a4d:b0:9a5:eedb:ee2e with SMTP id gx13-20020a1709068a4d00b009a5eedbee2emr1948174ejc.19.1693432594713; Wed, 30 Aug 2023 14:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693432594; cv=none; d=google.com; s=arc-20160816; b=Sk0J3apD19NguPZT7052x+lvXvuPY77wU7CIpXqFlfOdoB3S3cVayAUNDjnLvBUkgG 9FSM3MufmL8j9+vyKcZWtexm6WGUscIyj5BsvsRiasOfX/AQWdCEjXg3Vtp1fzZo+g9a cCfliVM1PlwFXiULWM8PKVg9shkuM+BZMbsqsMArxPnxF9OCP3Yo9MazWUy0JpIkMD23 dvcSx3Mue4kZ4D7V8mhhmSTxJqUU5Q+aRBf3gA3TcyprcHCFUyX7f8FtQsmZaXl5DLuZ cNK+rxHOyDz1kVYwHOZagj7rHse70BOoAthJiARdY4BpgQLfZtBF8T2HLmYQnEZ+ylER PuVw== 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=kRgPFkgBkvN/xH6rhllDwowLQY8M21GMBRyG+N1S2To=; fh=gSlqDyTAaX4sD5o7lNdgN6GT1mkO6Z4/Ye0T8jAhwnM=; b=RJ7O36e9m6PgkksN0S4xeqgfDN0C4S1MlstEPnqBUZq6kKBrMtYnQ/2A0qgWZ+FoKR Un8LZyXHmXiOsxssLKg1mH+GCqmH/A9eWCeQFN23jfWYr62bNBitUU8KKyx4C8p0C9XW 8nucHr2j9f6neApwEfcfa1NDKKibm+zgzUeVV68iiOcK8F/TpNa02/ELPJbKVaD2cGA/ d8LVb0oguMW/4fl5MErfLaX7PSmue4aLGm087GVW/6cWXupx5L80mUwmFMxclyXvDRMs 8XTGO9ZiKKFMS2/wmofqXHeWPJnrXG0DLT/It+ymPXT5AxCXCMVwg520gkvWqOL4Jn1w lkpw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a170906a40e00b00992ac8614b7si42146ejz.69.2023.08.30.14.56.08; Wed, 30 Aug 2023 14:56:34 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239661AbjH3Skj (ORCPT + 99 others); Wed, 30 Aug 2023 14:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245570AbjH3PhL (ORCPT ); Wed, 30 Aug 2023 11:37:11 -0400 Received: from mblankhorst.nl (lankhorst.se [IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DDB11A4 for ; Wed, 30 Aug 2023 08:37:07 -0700 (PDT) From: Maarten Lankhorst To: alsa-devel@alsa-project.org Cc: Maarten Lankhorst , 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: [PATCH v4 02/11] ASoC: SOF: Intel: hda: start splitting the probe Date: Wed, 30 Aug 2023 17:36:43 +0200 Message-Id: <20230830153652.217855-3-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230830153652.217855-1-maarten.lankhorst@linux.intel.com> References: <20230830153652.217855-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,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 From: Pierre-Louis Bossart This patch moves the initial parts of the probe to the probe_no_wq() callback, which provides a much faster decision on whether the SOF driver shall deal with a specific platform or yield to other Intel drivers. This is a limited functionality change, the bigger change is to move the i915/Xe initialization to the probe_no_wq(). Signed-off-by: Pierre-Louis Bossart Signed-off-by: Maarten Lankhorst --- sound/soc/sof/intel/hda-common-ops.c | 1 + sound/soc/sof/intel/hda.c | 16 +++++++++++++--- sound/soc/sof/intel/hda.h | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/soc/sof/intel/hda-common-ops.c b/sound/soc/sof/intel/hda-common-ops.c index 8e1cd0babd32c..803b5e9087782 100644 --- a/sound/soc/sof/intel/hda-common-ops.c +++ b/sound/soc/sof/intel/hda-common-ops.c @@ -16,6 +16,7 @@ struct snd_sof_dsp_ops sof_hda_common_ops = { /* probe/remove/shutdown */ + .probe_no_wq = hda_dsp_probe_no_wq, .probe = hda_dsp_probe, .remove = hda_dsp_remove, diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 15e6779efaa3b..e918b5dadfa02 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1118,11 +1118,10 @@ static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context) return IRQ_HANDLED; } -int hda_dsp_probe(struct snd_sof_dev *sdev) +int hda_dsp_probe_no_wq(struct snd_sof_dev *sdev) { struct pci_dev *pci = to_pci_dev(sdev->dev); struct sof_intel_hda_dev *hdev; - struct hdac_bus *bus; const struct sof_intel_dsp_desc *chip; int ret = 0; @@ -1162,6 +1161,17 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) sdev->pdata->hw_pdata = hdev; hdev->desc = chip; +err: + return ret; +} + +int hda_dsp_probe(struct snd_sof_dev *sdev) +{ + struct pci_dev *pci = to_pci_dev(sdev->dev); + struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; + struct hdac_bus *bus; + int ret = 0; + hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); @@ -1299,7 +1309,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) platform_device_unregister(hdev->dmic_dev); iounmap(bus->remap_addr); hda_codec_i915_exit(sdev); -err: + return ret; } diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 5c517ec57d4a2..89b8c239e9a5e 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -573,6 +573,7 @@ struct sof_intel_hda_stream { /* * DSP Core services. */ +int hda_dsp_probe_no_wq(struct snd_sof_dev *sdev); int hda_dsp_probe(struct snd_sof_dev *sdev); int hda_dsp_remove(struct snd_sof_dev *sdev); int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask); -- 2.39.2