From patchwork Fri Oct 28 21:53:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13024337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 801C0C38A02 for ; Fri, 28 Oct 2022 21:53:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8285410E8E9; Fri, 28 Oct 2022 21:53:32 +0000 (UTC) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by gabe.freedesktop.org (Postfix) with ESMTPS id F250A10E8E8 for ; Fri, 28 Oct 2022 21:53:26 +0000 (UTC) Received: by mail-pl1-x632.google.com with SMTP id 4so5994711pli.0 for ; Fri, 28 Oct 2022 14:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uwCxQi/lzbG99sopXdaVgVE2DsVCsrVGzk6dQZZnkc8=; b=I2wDE32iuPDJS6Ln4R3C7D+1bXa0yvl0RCT+wy/Vt0bL7g0cgQTolmDJ1THfnJ8khZ jDEdnMGi8XvZMvYAHMAkQxMDjybr0ID5erEsw7n6tALBv/ktbg7bhZ4rLNKN82hdrShW J9ifmwTQrN86Sp5PxD+oOtzKrNwbXuElrxYMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uwCxQi/lzbG99sopXdaVgVE2DsVCsrVGzk6dQZZnkc8=; b=cXao+dj9AlLynGjqzR9WhBFWrs/Iiofavu8vtgZAQDg/QsLsYLy6fVxjrHxz1Y+TOT utT1Rwcnel+zCWQdmXLzfYMYfVC2Jndh1eR8V+2ttlVCMfAlY/+fJg9ar3d9ypwQC5lE ETjqh1bJQvplO5az/HvE0M4kY+pz9LC/Pc5EnSrkgXHz3nDHPsLwKOBYm/O773zGKiTW aPZD8Oen7eCCjhgtVCiXnxae+gUSmyv58sNoMvTVt1sD6QXOrt7jL9foUGJ/6uTSh2kS REC7y91TjJz/CMenajKioJSjHyVlhKYpLakLuG94eXjVzUHOuvCqMo4+v25FDZ+arcAP fYeg== X-Gm-Message-State: ACrzQf2MCtczcSu413XNbPEZrbn8Jx0ZN8RGdqQVc7I2yrpvg8SxZyjL rx71SpiwYYY4LrHdjIQdDT9GWg== X-Google-Smtp-Source: AMsMyM7Z7henHLAjyucT+QXQnehtd5Zyu7DPcyrdvjnKBnTvpxyYd8nxtXTnemCxJqDLmGYfSMu6QA== X-Received: by 2002:a17:90b:3e81:b0:20d:bbe5:f332 with SMTP id rj1-20020a17090b3e8100b0020dbbe5f332mr19029604pjb.112.1666994006140; Fri, 28 Oct 2022 14:53:26 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id a4-20020a621a04000000b00545f5046372sm3251964pfa.208.2022.10.28.14.53.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:53:25 -0700 (PDT) From: Brian Norris To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin Date: Fri, 28 Oct 2022 14:53:22 -0700 Message-Id: <20221028145319.1.I87b119c576d486ad139faf1b7278d97e158aabe4@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: Set PROBE_PREFER_ASYNCHRONOUS X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tang , Jani Nikula , Daniel Vetter , intel-gfx@lists.freedesktop.org, Brian Norris , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Wilson , Daniel Vetter , David Airlie Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This driver often takes a good 100ms to start, but in some particularly bad cases takes more than 1 second. In surveying risk for this driver, I poked around for cross-device shared state, which can be a source of race conditions. GVT support (intel_gvt_devices) seems potentially suspect, but it has an appropriate mutex, and doesn't seem to care about ordering -- if devices are present when the kvmgt module loads, they'll get picked up; and if they probe later than kvmgt, they'll attach then. Additionally, I see past discussions about this patch [1], which concluded that there were problems at the time due to the way hdac_i915.c called request_module("i915") and expected it to complete probing [2]. Work has since been merged [3] to fix that problem. This driver was pinpointed as part of a survey of drivers that take more than 100ms in their initcall (i.e., are built in, and probing synchronously) on a lab of ChromeOS systems. [1] [RFC] i915: make the probe asynchronous https://lore.kernel.org/all/20180604053219.2040-1-feng.tang@intel.com/ [2] https://lore.kernel.org/all/s5hin4d1e3f.wl-tiwai@suse.de/ [3] Commit f9b54e1961c7 ("ALSA: hda/i915: Allow delayed i915 audio component binding") Signed-off-by: Brian Norris --- drivers/gpu/drm/i915/i915_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 38460a0bd7cb..1cb1f87aea86 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -1371,7 +1371,10 @@ static struct pci_driver i915_pci_driver = { .probe = i915_pci_probe, .remove = i915_pci_remove, .shutdown = i915_pci_shutdown, - .driver.pm = &i915_pm_ops, + .driver = { + .pm = &i915_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + }, }; int i915_pci_register_driver(void)