From patchwork Sat Oct 29 01:45:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 619984 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 017A5FA3741 for ; Sat, 29 Oct 2022 01:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbiJ2Bpv (ORCPT ); Fri, 28 Oct 2022 21:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiJ2Bpr (ORCPT ); Fri, 28 Oct 2022 21:45:47 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 248321DC4F3 for ; Fri, 28 Oct 2022 18:45:47 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id i3so6180334pfc.11 for ; Fri, 28 Oct 2022 18:45:47 -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=qM8nxynBORd1dgNqUGTIshaYiyUYjNtO678amsvAS0I=; b=UScndsRn651QoQYPyDtDE1dxqK1J2kHtPg+BMI0KUWd1dVnmpXxqw/yvtk/NYRmsYl 4SGTHXSm2FXQ1SNGbsa9cZcvNbjjYOk91pj5+HzccdtZtzB5pTduj8Rr+gBbMaXDActE gvlaTZJIy4DsAItV2zRb+Pziit7YfXcbnZ7H8= 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=qM8nxynBORd1dgNqUGTIshaYiyUYjNtO678amsvAS0I=; b=Y6o5V0yJg2dm9lIYzpp4sM1WhB/VHhPSaiiC0Ht6bBiVFwwXD1OzC0DeddZHeznbhq 1kHeHUFfXy1nkwVGIer/o/zqGebd/RJFYNylpG4lfRrffEMo+BK0nBcUQ6aT5axcp3PO 67uOh0IZbUVg8//HQdIFrUyuhZs5c3sC6rS8+IYqWRBnOpr/zwxV9dfaHq0HU6mAt48E KCrstKqhqVfj840zFsh6OZNKR2gBNXiATdd1nSa5NREitr6wjuEyIZCK7AHoh3q08FPv mvUrmMmu38gNPmPM3PEcYO70N9fSZnfbjLw7gYMP6LvxGKcnPiVIMXMFl6fUz4aQOEEt 6dmQ== X-Gm-Message-State: ACrzQf3mIpcQp82uItOaWIqcKROfpZRQhTct1u67rf8w+TWxYZ5Rm8sI 1I/cEeTgADK5g6LiZdY1n0pDKw== X-Google-Smtp-Source: AMsMyM4XRnoETEL36K04tlkw4gfy07JBumLkFfrx7BJvdcN1bLC9XX2PCuvYdYrUhje2h2okggUdrA== X-Received: by 2002:a65:5c0c:0:b0:46e:f582:7378 with SMTP id u12-20020a655c0c000000b0046ef5827378mr2151362pgr.120.1667007946718; Fri, 28 Oct 2022 18:45:46 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id k6-20020a170902ce0600b00186e2b3e12fsm85978plg.261.2022.10.28.18.45.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 18:45:46 -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 v2 1/2] usb: ehci-pci: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 18:45:34 -0700 Message-Id: <20221028184507.v2.1.I9a5353f81d1509f85f3a04f0cdc9099f6fe60811@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- Changes in v2: - Add Alan's Ack 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) From patchwork Sat Oct 29 01:45:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 620191 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 786D9C38A02 for ; Sat, 29 Oct 2022 01:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbiJ2Bp4 (ORCPT ); Fri, 28 Oct 2022 21:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbiJ2Bpt (ORCPT ); Fri, 28 Oct 2022 21:45:49 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091671E3ED2 for ; Fri, 28 Oct 2022 18:45:49 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id v4-20020a17090a088400b00212cb0ed97eso5967423pjc.5 for ; Fri, 28 Oct 2022 18:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fxI9jHgzXaAhc4fAzAdj535D2gJQxDQasWe16RCa7hY=; b=btNSggHejSRBsGiBwnCHivRNhwZ21zugNTd9CYmEGhneNzfLE3Yc+h0amKP0iHTzNy W4uQUb8DRtxJwiCVdUFo8AowXQrCJHzXaVimsHfqb0ASDk4Y2ex+RiXI5uF48zjPCvgq Vg7Ei/3f1w2l7p78GCLdYa/8RgH73Qgeqx/JA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fxI9jHgzXaAhc4fAzAdj535D2gJQxDQasWe16RCa7hY=; b=bxtspkP3GwSwqKM3yv47DRQqaeyoo2pGa2JKWDH6vJMtFC0kH/7q75AjSOVPiP1L3S 8MikX0dG5TJ/XdO2JyERDnu6w8tzWWuK7Y0gMWUBhyZbnEiOU8DfIXheWAto3yJnRONS 0D8wN8ELpQDcBZVwGAxo+co6tJb3qO2MV2kXfTht5NUBWW8rG0ll7fxF+X5+YLoNcXQC BZqjr12Tnf6QK41gqHiyyF2xKIGXs4fwgUkbPv7Qw/XjAkyLp8P6+xtRURKGkiFg6r1r bMrQa6jzVX6euVjVTHYrFp012F/hraJjVInBK5lTSE48gyFN42MVPxNYTeaxqPcQRiPo OR4g== X-Gm-Message-State: ACrzQf2uWOAzfL53IpHYTWExHCNvPUqZIiy46dwXXNVN3l4UVrOVuHTx KRNfDm5ZQwWoLLP4aSb9vzXzAQ== X-Google-Smtp-Source: AMsMyM4TXyjJQWrPr0aWD4niC9hvjhk0Vgp8VK1Dql/gMk3EKG/HNUNFtw341fCTkGVMRZH2lBOLEA== X-Received: by 2002:a17:902:e892:b0:187:35b:5a50 with SMTP id w18-20020a170902e89200b00187035b5a50mr2052841plg.160.1667007948593; Fri, 28 Oct 2022 18:45:48 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id v17-20020aa799d1000000b0056bb191f176sm122684pfi.14.2022.10.28.18.45.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 18:45:48 -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 v2 2/2] usb: xhci-pci: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 18:45:35 -0700 Message-Id: <20221028184507.v2.2.I5a309231785d3a4e37118a25e84f5caa0136a343@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028184507.v2.1.I9a5353f81d1509f85f3a04f0cdc9099f6fe60811@changeid> References: <20221028184507.v2.1.I9a5353f81d1509f85f3a04f0cdc9099f6fe60811@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This driver often takes on the order of 10ms to start, but in some cases takes more than 100ms. 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 --- Changes in v2: - Move outside #ifdef CONFIG_PM (oops; thanks Alan) drivers/usb/host/xhci-pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 40228a3d77a0..5bbb1fed32d2 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -687,11 +687,12 @@ static struct pci_driver xhci_pci_driver = { /* suspend and resume implemented later */ .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 xhci_pci_init(void)