From patchwork Fri Oct 28 21:19:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12565 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1055991wru; Fri, 28 Oct 2022 14:39:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM780A6XNOTBQ6YEPT/YeP5kF8dFKOP/W7GYIqTEckauVRJGsxYu4bUtkXJ8yQ4puW8Cp1I9 X-Received: by 2002:a17:907:7ba4:b0:78e:281d:91ef with SMTP id ne36-20020a1709077ba400b0078e281d91efmr1255295ejc.288.1666993179217; Fri, 28 Oct 2022 14:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993179; cv=none; d=google.com; s=arc-20160816; b=jtuDrCmogduY9m9TUYxXhKWKDRkzcvWV3xrLlE/Nf95+dcCVZt7iEXUoPcg7Z2KJOY vGY5thgyg1tLNgikfOoTPH6sUhdPJcOwD7tvr1E2zcktnEjBnAH6P7/cBvx2ukiRbV9D 098UBA7jNaBkKiczR4SzCKDLwOt5uPtwvpPgF2EG0TKoTDrWrQrbTXy68f8/eRwhYgU6 9X9mBSWlhPowEBVOo24fLtUUkIMTZky98Dec0opH6ccoBjouuUea29nBrSCrAUMb539T OOCMweJAqgA7rduCGYmBYTXc0h34FBukI8cHeCupTmbv8c8ULm81QC2GPOkXmv+Htd4o WjSg== 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:dkim-signature; bh=+ReCGUZkiii68cxY5IFdEUSZ/im3lxKgaunLDv0fff4=; b=LcRqr5UjAUvInOOodTM8aPbCxkDMz1LZNr6cWYhP0YPJ1HQWuKHHf38VO9/kwNNtjA 2Bi2Uo5NeFbp5BKt3PzisKg6XIBl65jFta2nuWvtcV/n3VzFYO2uRvUllyy4AK7DIw27 hJFBs6G9cfRIMJiNbFYmolNmuYuzanwlD0oT1KOEcSWbvYkVmNdCRbLQt15MlZL7vgyL 7sGxNZJxaeRExsfxafmAgbX5t8p5LYIbSr8sZZXL4O5ifaa8dm1EKAMRblNwV96wI9h1 QoXxa+m5ZtvbL+Lp0UOCOOjBsuoN6KkIJD3A+juZcdxf7sj0NScWot1BW3+BqCjFrJ4C Gu1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dfyzPY26; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a20-20020aa7d914000000b0045928479b71si4993470edr.405.2022.10.28.14.39.15; Fri, 28 Oct 2022 14:39:39 -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; dkim=pass header.i=@chromium.org header.s=google header.b=dfyzPY26; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbiJ1VTU (ORCPT + 99 others); Fri, 28 Oct 2022 17:19:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiJ1VTS (ORCPT ); Fri, 28 Oct 2022 17:19:18 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104A624AE1C for ; Fri, 28 Oct 2022 14:19:18 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id o7so2498580pjj.1 for ; Fri, 28 Oct 2022 14:19:18 -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=+ReCGUZkiii68cxY5IFdEUSZ/im3lxKgaunLDv0fff4=; b=dfyzPY26KbrgwSdtg2Eu9muTgcMpRXIMEJnsdw50KY+jAxf3zk92oBn8bsHdNzq1nb iQQJEqJQaOQy8a/V1OTKldPw9obGnX3WoxPGSuiVLCVEQIw2aR5hgjPPFg2//6LRG2eD /pgH8SqGafhbQnprbtIKIj9gW+eAi57yGg3l0= 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=+ReCGUZkiii68cxY5IFdEUSZ/im3lxKgaunLDv0fff4=; b=wvW+c3PehlLXzD9eGMJLmRU7nHVBco7OqFuyv1x47DVm8MRRne9Iqw2YLr479WEHIZ bPy6rhoA1/i2ROeAkTqEFLvmGX4LRW/COceTx5CIJiMTXbA2WSez9ZfYAYONRURTkCei QXn1wGzpkHw5/tm03c6EeF4Gl2dQhna9Br6esZub3zOqd1SP4UFMXbQZWT1nxlt8TJOc VJeNgemc9p5px4EqiRZE3oMRcg4lcyJdLoklk9/1MgbbpZcQcXTC6jXTpK+Hs7xFc9ux aYEoFCxXrrE985xPCOsQ3PRpkikKaZ76njBIsJVallEmY47wfVuKdycEfe7gIXDFSWEZ U4fw== X-Gm-Message-State: ACrzQf3Khs2s0CwDmP3Bz8JhvVL+To9J0sYIInCVYzfzQrcbhfIXo10y B8NJUYTYxeQ35hpX4A4bQy2F6g== X-Received: by 2002:a17:902:dacf:b0:185:3735:ffc7 with SMTP id q15-20020a170902dacf00b001853735ffc7mr930436plx.147.1666991957575; Fri, 28 Oct 2022 14:19:17 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id f5-20020a170902860500b00186c37270f6sm3452364plo.24.2022.10.28.14.19.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:19:17 -0700 (PDT) From: Brian Norris To: Alan Stern , Greg Kroah-Hartman , Mathias Nyman Cc: Brian Norris , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 1/2] usb: ehci-pci: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:19:07 -0700 Message-Id: <20221028141821.1.I9a5353f81d1509f85f3a04f0cdc9099f6fe60811@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747969040077660396?= X-GMAIL-MSGID: =?utf-8?q?1747969040077660396?= This driver often takes on the order of 8ms to start, but every little bit counts. It shouldn't have many cross-device dependencies to race with, nor racy access to shared state with other drivers, so this should be a relatively low risk change. This driver was pinpointed as part of a survey of top slowest initcalls (i.e., are built in, and probing synchronously) on a lab of ChromeOS systems. Signed-off-by: Brian Norris Acked-by: Alan Stern --- drivers/usb/host/ehci-pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 17f8b6ea0c35..4b148fe5e43b 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -411,11 +411,12 @@ static struct pci_driver ehci_pci_driver = { .remove = ehci_pci_remove, .shutdown = usb_hcd_pci_shutdown, -#ifdef CONFIG_PM .driver = { - .pm = &usb_hcd_pci_pm_ops - }, +#ifdef CONFIG_PM + .pm = &usb_hcd_pci_pm_ops, #endif + .probe_type = PROBE_PREFER_ASYNCHRONOUS, + }, }; static int __init ehci_pci_init(void)