Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1462959rdb; Mon, 2 Oct 2023 10:09:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoXbC9VIHC6nFbQ80AjOC/Cr+/ACUKt9OFIlYOws4Efcnj7ON7OcAfUN/xKzgngUvRMGTT X-Received: by 2002:a05:6870:56a3:b0:1bb:6485:7988 with SMTP id p35-20020a05687056a300b001bb64857988mr13148629oao.35.1696266592970; Mon, 02 Oct 2023 10:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696266592; cv=none; d=google.com; s=arc-20160816; b=ytgipepsyBsmGBUo9uWxpwSCN5dSHr8gebjLy6Nkr7k0YJF+WooAgoCBv1mH6diLBm lNXJymdnLcxZkYUlSXdGEqqKnrMbF8HDNY6CPPwC7IKALpItH1Y8fhRyZbM4BlDPbg/4 Mq+dFpVHeaL5yWkpgkBS4FsxQLvhCMgOosjYTlKYpWiO9KDwXd5BcyBLQ0J/hoqLG2lO wKoV4/8klBpXnTETwbjD6OYc3+cfHuCsw3cN2Sgi2Cuth6grKoXNSBXqCLsnxGUzdAMc EK29DtZcgcH80vP8BKbWZAdC5I77s9NmElAhBe1uoKkFOCTwjcl8GFNV3Ws/ERwnx8lQ XQBA== 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=bZ0qbImQ5q9YZfd/myQ4Jr1Y8YmPmCnSVFoFZsJ8zOc=; fh=/pUP8+71qBSl8LEnpR7al3hgnpyZaIrk4M/0QwVMVCk=; b=EmMCMBJYjxEPkzlRZyu5RlaMZsIHgUo2aeQaRp+hD7vT2jH8N3pk22VWSANt2+YEcT xrEqCPgXjNn3F0YSo6Q9LlD8X18a0a3Q/XInMp6aJ9O9cfwyoCspzHCkMVyQQqt5mv9z YbT3fUsoqH55Y46jefL1rDlj0CTpXH61zUor3ANuyVi+f1iwBHPbAaR0G7IaAsicHb8y 0x0+sHPEUuzEJlt+GuzzE6meVCydPp95aNKft2IcEeVXfZUG1UjGb/BaM2qNr35xsp+L b/Xq27PA4JQu+ZNzZwKn/RcqtzaiSzwo8e9vj2dRZs8pzfnEr9EOiuFU+/7O1Z71BIvK muIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b9-20020a63d809000000b0057c29fec784si26918230pgh.110.2023.10.02.10.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 10:09:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 59A1B825CD0C; Mon, 2 Oct 2023 09:52:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238490AbjJBQwX (ORCPT + 99 others); Mon, 2 Oct 2023 12:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238503AbjJBQwV (ORCPT ); Mon, 2 Oct 2023 12:52:21 -0400 Received: from mblankhorst.nl (lankhorst.se [IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD51DBF for ; Mon, 2 Oct 2023 09:52:18 -0700 (PDT) From: Maarten Lankhorst To: alsa-devel@alsa-project.org Cc: Maarten Lankhorst , Pierre-Louis Bossart , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , 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 v5 11/12] ASoC: SOF: Intel: Move binding to display driver outside of deferred probe Date: Mon, 2 Oct 2023 18:52:14 +0200 Message-Id: <20231002165214.17879-1-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230929145123.233838-1-maarten.lankhorst@linux.intel.com> References: <20230929145123.233838-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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 09:52:34 -0700 (PDT) Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. Use the -EPROBE_DEFER mechanism instead, which must be returned in the probe function. The previously added probe_early can be used for this, and we also use the newly added remove_late for unbinding afterwards. Signed-off-by: Maarten Lankhorst Cc: Pierre-Louis Bossart --- Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Cezary Rojewski Cc: Pierre-Louis Bossart Cc: Liam Girdwood Cc: Peter Ujfalusi Cc: Bard Liao Cc: Ranjani Sridharan Cc: Kai Vehmanen Cc: Mark Brown Cc: Daniel Baluta Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Cc: sound-open-firmware@alsa-project.org sound/soc/sof/intel/hda-common-ops.c | 1 + sound/soc/sof/intel/hda.c | 14 ++++++-------- sound/soc/sof/intel/hda.h | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/sof/intel/hda-common-ops.c b/sound/soc/sof/intel/hda-common-ops.c index 1cc18fb2b75bb..26105d8f1bdc7 100644 --- a/sound/soc/sof/intel/hda-common-ops.c +++ b/sound/soc/sof/intel/hda-common-ops.c @@ -19,6 +19,7 @@ struct snd_sof_dsp_ops sof_hda_common_ops = { .probe_early = hda_dsp_probe_early, .probe = hda_dsp_probe, .remove = hda_dsp_remove, + .remove_late = hda_dsp_remove_late, /* Register IO uses direct mmio */ diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 86a2571488bcc..32ac0581f9f63 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1160,6 +1160,7 @@ int hda_dsp_probe_early(struct snd_sof_dev *sdev) return -ENOMEM; sdev->pdata->hw_pdata = hdev; hdev->desc = chip; + ret = hda_init(sdev); err: return ret; @@ -1195,9 +1196,6 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) /* set up HDA base */ bus = sof_to_bus(sdev); - ret = hda_init(sdev); - if (ret < 0) - goto hdac_bus_unmap; if (sdev->dspless_mode_selected) goto skip_dsp_setup; @@ -1307,8 +1305,6 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) iounmap(sdev->bar[HDA_DSP_BAR]); hdac_bus_unmap: platform_device_unregister(hdev->dmic_dev); - iounmap(bus->remap_addr); - hda_codec_i915_exit(sdev); return ret; } @@ -1317,7 +1313,6 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) { struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; const struct sof_intel_dsp_desc *chip = hda->desc; - struct hdac_bus *bus = sof_to_bus(sdev); struct pci_dev *pci = to_pci_dev(sdev->dev); struct nhlt_acpi_table *nhlt = hda->nhlt; @@ -1368,10 +1363,13 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) if (!sdev->dspless_mode_selected) iounmap(sdev->bar[HDA_DSP_BAR]); - iounmap(bus->remap_addr); + return 0; +} +int hda_dsp_remove_late(struct snd_sof_dev *sdev) +{ + iounmap(sof_to_bus(sdev)->remap_addr); sof_hda_bus_exit(sdev); - hda_codec_i915_exit(sdev); return 0; diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index e13cdc933ca6b..8e846684279e7 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -576,6 +576,7 @@ struct sof_intel_hda_stream { int hda_dsp_probe_early(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_remove_late(struct snd_sof_dev *sdev); int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask); int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask); int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask); -- 2.39.2