Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp332281rdb; Thu, 5 Oct 2023 07:18:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjaU6h3UDLlSjlXYa3w6tl31u2gcsWm/ESMKd4X+Fg4x2yOlMs54X+oFSuk+jPrVfh1+U+ X-Received: by 2002:a05:6a21:3e01:b0:14c:def1:e728 with SMTP id bk1-20020a056a213e0100b0014cdef1e728mr4651039pzc.60.1696515520315; Thu, 05 Oct 2023 07:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696515520; cv=none; d=google.com; s=arc-20160816; b=kt5trCLykx9Q1+1K9ZT2sL+cAtci9EC7p02NTpbuvI04yL7XJoPDnts7lTY3Opd6zF wBJ4oQ6suGT8H1WXZrP+O1ffeJy1xd3rWpOhsd56/R/nD7F2H+5GynboTIJYUTkDzOak WDhQlMSGD95o1u1a98KYh91J4SAP2oHCBUVsG2RqocM+GqDhkyM4EoVG+sgJIdZdvika TsO0CaLEMKP+MQqXC6U7muKNfR2Zm47yIm84a4tZl7opo32MjNfGb5KPIEitwwaQgb0v Cz8ajLIumSi11KcqihqPU8ELK4KqDnrKPeJ53usCVw6ZQ/C9jQmiBCgeRkNO34TIRJa1 z38g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=Jc+F561eWp/agUqyVFAy1jiuEO023uKG2ojKDFhmrRM=; fh=9yLTfgjuqcj0JAkG5qz2nSy6foyitivAAvgnHh1A8t8=; b=Oho8Gq02qf6euXERAODhVTAh64AG8LsBozO2Uvli9pyhD0wZ8B3LeubYY84t8vcO4B v6x+3Qy+Utq6ryEXviavdlmKCS5hgPFsyAMOrhe2QZs57zQIxYrbXcNM4F8g0od/Ppf2 NwtGOaHMxL3gYyt/PPHvKoMe+XXyqJcMJIYxbyyOUxUFLMspwiGihW0rq8Tgqooaivm7 813+11WY8Hd0UfLOUQ/sVgWC32gTKK87B3MfSA4jTqaKFFf6RBQP5jDRYuN2sgwigOoD SI21A6+yXfAIrLKt07FfF2+vipjw6lZQfeVn8mkSebdB7YLkIzpAHvuo/ez071nAvqyd 1yHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id p18-20020a056a000b5200b0068fc49cc456si1566030pfo.248.2023.10.05.07.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:18:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7E2A58133CAE; Thu, 5 Oct 2023 07:18:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233500AbjJEORC (ORCPT + 99 others); Thu, 5 Oct 2023 10:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbjJEOO7 (ORCPT ); Thu, 5 Oct 2023 10:14:59 -0400 X-Greylist: delayed 379 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 05 Oct 2023 04:32:42 PDT Received: from mblankhorst.nl (lankhorst.se [IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AE124E9D for ; Thu, 5 Oct 2023 04:32:42 -0700 (PDT) Message-ID: Date: Thu, 5 Oct 2023 13:26:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v6 11/12] ASoC: SOF: Intel: Move binding to display driver outside of deferred probe To: =?UTF-8?Q?P=c3=a9ter_Ujfalusi?= , Kai Vehmanen , Maarten Lankhorst Cc: Alsa-devel , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Bard Liao , Ranjani Sridharan , Mark Brown , Daniel Baluta , linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org References: <20231004145540.32321-1-maarten.lankhorst@linux.intel.com> <20231004145540.32321-12-maarten.lankhorst@linux.intel.com> Content-Language: en-US From: Maarten Lankhorst In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:18:14 -0700 (PDT) On 2023-10-05 12:58, Péter Ujfalusi wrote: > > > On 04/10/2023 19:59, Kai Vehmanen wrote: >> Hi, >> >> I'm good with rest of the series, but one patch requires work. >> >> On Wed, 4 Oct 2023, Maarten Lankhorst wrote: >> >>> 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. >> [...] >>> --- 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 86a2571488bc..4eb7f04b8ae1 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; >> >> I don't think this works. The hda_codec_i915_init() errors are ignored in >> hda_init() so this never returns -EPROBE_DEFER. >> >> So something like this is needed on top (tested quickly on one SOF >> machine and this blocks SOF load until i915 or xe driver is loaded): >> >> --cut-- >> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c >> index 9025bfaf6a7e..8b17c82dcc89 100644 >> --- a/sound/soc/sof/intel/hda.c >> +++ b/sound/soc/sof/intel/hda.c >> @@ -863,13 +863,20 @@ static int hda_init(struct snd_sof_dev *sdev) >> /* init i915 and HDMI codecs */ >> ret = hda_codec_i915_init(sdev); >> if (ret < 0) >> - dev_warn(sdev->dev, "init of i915 and HDMI codec >> failed\n"); >> + dev_warn(sdev->dev, "init of i915 and HDMI codec failed >> (%d)\n", ret); > > we should not print anything or maximum dev_dbg in case of EPROBE_DEFER. There's dev_err_probe, which is dev_err on error, or sets the reason for deferred probe to the arguments if the error is -EPROBE_DEFER. ~Maarten