Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8440933rwp; Wed, 19 Jul 2023 09:48:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmkOqEWQXzz9U91qBj+1GaS1cbUuouiUEUuY5gLTn85s3JhF5hI7CnDKrdWbhsxnkVej2D X-Received: by 2002:a50:fb83:0:b0:51e:22db:813 with SMTP id e3-20020a50fb83000000b0051e22db0813mr2842990edq.22.1689785329240; Wed, 19 Jul 2023 09:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689785329; cv=none; d=google.com; s=arc-20160816; b=kcBb5N5UpuGqIIjfmL868jxcj6Ab8YImHxvBzI5SnWzx6aIN7WQ5yHhLS1nj/5Ztje F+nCEsQc9g1RGoVrOwQ/nGSmtUWnxcct3pLPajBdiU1kgr4GG0glP8VI9Wiq67GkrJm7 bwyafqINinvd+bs8GKBkoX3PtIXwpGb/zZb+9HcyLxpHJc+XZBigf1X8W05Fm++R6+Zt zts5Ba9sLrr2ymxAgP1HB/R+4VkS2G3vy2mDU+hWdZV46zdnR7kOx9m1M5xDXHDSyzyx rAuWM1BJjxDgoepivWsd3eVlZHLepI1Rdv543xjT+bL67pPLg8lUBtzYrcdYo2gvWPxl CTuw== 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 :message-id:date:subject:cc:to:from; bh=B16NnWBbm3fHhvL44fFaM87KHI/FUietahZteul6n8M=; fh=dxIo+wp2Pw2j7LKHXvog8zBrh2HlBFjJ3CkiHF3U0aM=; b=wSCUbmMBFeE7mYKaj6UAjZAFHtzAKagKN1DJGntiwEhx00orJYT77q0UoXIU38bibW UPIB1aQN7SKCE1VHMKVQ8PZVC1+E7BT2OYAVUwScsMl/FDGYwBxQlEXtBbM7oLajd2m8 veibq58R7p4Dx2bL9MviE3lgk8qpb/9u1zTDQBxWrF+Gnd5+XutUlrq/x8zKAtdtpeC+ 18BUPke9/oeWlLmZoSOUIi3td3vffLJBrFu6fVUKns9Vu+R2Q7OzNm3dL/goB1mFtf87 yUr3Z+R2KrFwGGqqLxbLBojh+vG7viVRD/JKxv2kwGkAjmukWe3APoRtPhD9Tev8E1lZ rg8A== 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 d7-20020a056402516700b0051dd4e2847csi2962799ede.660.2023.07.19.09.48.24; Wed, 19 Jul 2023 09:48:49 -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 S229905AbjGSQlv (ORCPT + 99 others); Wed, 19 Jul 2023 12:41:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjGSQls (ORCPT ); Wed, 19 Jul 2023 12:41:48 -0400 Received: from mblankhorst.nl (lankhorst.se [141.105.120.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65679135 for ; Wed, 19 Jul 2023 09:41:46 -0700 (PDT) From: Maarten Lankhorst To: alsa-devel@alsa-project.org Cc: sound-open-firmware@alsa-project.org, linux-kernel@vger.kernel.org, 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 Subject: [PATCH v2 0/9] sound: Use -EPROBE_DEFER instead of i915 module loading. Date: Wed, 19 Jul 2023 18:41:32 +0200 Message-Id: <20230719164141.228073-1-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Explicitly loading i915 becomes a problem when upstreaming the new intel driver for Tiger Lake and higher graphics (xe). By loading i915, it doesn't wait for driver load of xe, and will fail completely before it loads. -EPROBE_DEFER has to be returned before any device is created in probe(), otherwise the removal of the device will cause EPROBE_DEFER to try again in an infinite loop. The conversion is done in gradual steps. First I add an argument to snd_hdac_i915_init to allow for -EPROBE_DEFER so I can convert each driver separately. Then I convert each driver to move snd_hdac_i915_init out of the workqueue. Finally I drop the ability to choose modprobe behavior after the last user is converted. I suspect the avs and skylake drivers used snd_hdac_i915_init purely for the modprobe, but I don't have the hardware to test if it can be safely removed. It can still be done easily in a followup patch to simplify probing. --- New since first version: - snd_hda_core.gpu_bind is added as a mechanism to force gpu binding, for testing. snd_hda_core.gpu_bind=0 forces waiting for GPU bind to off, snd_hda_core.gpu_bind=1 forces waiting for gpu bind. Default setting depends on whether kernel booted with nomodeset. - Incorporated all feedback review. 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 Maarten Lankhorst (9): ALSA: hda/intel: Fix error handling in azx_probe() ALSA: hda/i915: Allow override of gpu binding. ALSA: hda/i915: Add an allow_modprobe argument to snd_hdac_i915_init ALSA: hda/i915: Allow xe as match for i915_component_master_match ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work. ASoC: Intel: Skylake: Move snd_hdac_i915_init to before probe_work. ALSA: hda/intel: Move snd_hdac_i915_init to before probe_work. ASoC: SOF: Intel: Remove deferred probe for SOF ALSA: hda/i915: Remove extra argument from snd_hdac_i915_init sound/hda/hdac_i915.c | 25 ++++++++------- sound/pci/hda/hda_intel.c | 60 ++++++++++++++++++----------------- sound/soc/intel/avs/core.c | 13 +++++--- sound/soc/intel/skylake/skl.c | 31 ++++++------------ sound/soc/sof/Kconfig | 19 ----------- sound/soc/sof/core.c | 38 ++-------------------- sound/soc/sof/intel/Kconfig | 1 - sound/soc/sof/intel/hda.c | 32 +++++++++++-------- sound/soc/sof/sof-pci-dev.c | 3 +- sound/soc/sof/sof-priv.h | 5 --- 10 files changed, 85 insertions(+), 142 deletions(-) -- 2.39.2