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: 12616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1136561wru; Fri, 28 Oct 2022 18:50:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6VnCMTeZba4XHkgKLFfkmDV1A9Bqe8qkjgMTX82DJ/7TWaECbpg/loJBrkovQszTugxeIL X-Received: by 2002:a17:907:7211:b0:7ac:e7b0:3bb5 with SMTP id dr17-20020a170907721100b007ace7b03bb5mr1864582ejc.515.1667008240954; Fri, 28 Oct 2022 18:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667008240; cv=none; d=google.com; s=arc-20160816; b=N4kjszRFOB6lQPd8qcmBTpVoQaTz3hy+VVJ4LclpdcVnvO7D0c0evqrp8ljeK1hN7C C6R/T0Q+28h00IhE6cC3EHaZWNAHb5OBlf6Y61adSvOCAa8uYERAxl2stTgeVV/PY0Xu 6fHE8SI8N6dI/SN8ITFBuAWkgoJX41Ax7c8q9vwDn/7bLScSxhux/msEyhNPsm/CwvFJ pKUkGnTEl/JTWVEe90ZRl8ZodL5tLynhf1v8nydxUEiTT9AOmXdXxtspTN+eUe0l2+RQ 3pSgBf6sK+DLfc5hrv4dIfep/o6QeevhlmyCe45mEG3VfIhToD6vfhl0Co8ef4ncNdZL 0CXA== 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=qM8nxynBORd1dgNqUGTIshaYiyUYjNtO678amsvAS0I=; b=G3XQ+zG1CIOeA3mOVB+QaT/ptbNRdIKG65Z6ZwzmA7YuOhK96gqeshH8A57bSPMoZd jSLGBH3JwXA69rR98HNa/jk0B27EbDYKCLhENYPzmoti+BPm/rtwUY1mxewgGSiMIbgt l8ogaqtehaqtepg6k9ey9pB44XFPzqGo+xTNnGw6EtzaZjROke7eq6ou0Yw5FvO/g2s5 s1YJYin16iFwHvAMK9KkjbixuophRfSR8wMzHSf57A6Ph4HVukDE4+/y9WkVAP6TGc0O BJc2vFeR4eGxBsB0+UWZ7fgjwiLCiQdVy/YTKdGo4VklFDlCp1SGUaWTqXYszznY6PH3 9x3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UScndsRn; 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 ne3-20020a1709077b8300b007aa6ce58d9asi323671ejc.712.2022.10.28.18.50.14; Fri, 28 Oct 2022 18:50:40 -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=UScndsRn; 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 S229663AbiJ2Bpx (ORCPT + 99 others); Fri, 28 Oct 2022 21:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiJ2Bpr (ORCPT ); Fri, 28 Oct 2022 21:45:47 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 203AF1DC0B7 for ; Fri, 28 Oct 2022 18:45:47 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id h2so6280041pgp.4 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=iwuv4j/0VevpTRJ6dCJ0MUU/Ugq1fcEtv9noSHCaLpHIeHqw54PoKX1R/G6D+zJ4Fw cNG/1VkxZPzvdmMNpgbbR2xPY6w4u+UbgBuAvpapxolI5JXIxQkCV8kq+WC1p+T/eb3H H9c8GEfjOn3amBSNfQebtnn+0OBR17KscWquZg5UfllS4+HcpBwVZ1O18WDkx7BYWnYT /o23gBzvo+ItHlEAnitlS6x9WpwycPuU5nO9tfiRuFL0VmkovQ92ojWIgmpG+zbe4MK5 7BSY7hjTXDx5AyCwNsptFoaxFccd/70fcoc+vz9JG0ZWKY4KbHEjz20+VDgt89ULd8lP LpwA== X-Gm-Message-State: ACrzQf1Ejt/5QUuhNjIJsYpUmpHehaEidu3eh+sDvbrpe3SV8HGLye6o G83E2kM0vdu6XXU12bL0h02Ygw== 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 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?1747984833037761042?= 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: 12615 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1136434wru; Fri, 28 Oct 2022 18:50:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM45qy6IJgKxeJIiVDJJ5U7iTkEzr/tX5gZqx9zXb0TuLE+/0FigZATyGB/4p4Y5tx4TG/vG X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr2206157edz.240.1667008210184; Fri, 28 Oct 2022 18:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667008210; cv=none; d=google.com; s=arc-20160816; b=oDJ5qKbgko3di5OxPiCvY/OEbM9Xr0O/WNyXj84GMs9NZlAO8dgy86PyUUtdTgDoEk WD6cA+QcxPS3xPvQghSIagIvog/Djh7yPj0ywMKgEBrfgwNqSbhlkzbWNUNLqiXpNAnC NNR9YjyH0AVxErJsspKHPaVANzW/reanBWqCDskpz8DLkPsLUcujFPsoxgBdCcfMESHI rpSQUGVGDqbX+6oD36X15em/bgUUn3ryFnGztHUAKLxtSWFCxsDGY8N+6HS4+OsVwtwN ApRWlE0uoZ5oftxwLNR7tIT7B+VT6LhJkc8WFZQFK+2ZPCNchLy1a0FVvB4RR1NL98fH zvWg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fxI9jHgzXaAhc4fAzAdj535D2gJQxDQasWe16RCa7hY=; b=RCT+KlTOyxFUjmHbvwC7S2kF7u2xVuZ6GFTkz2OknPL3FfHxytPc3fQ1nOB0i6Vjs4 uOcWcJJk2vj9P3+HHMPYYBp85G85WCDCy+/peP5l7/nxbdnRmC83Qs4u3BbJgucXzsFK APnxgU1Q8H+VBTZ9CW+tQVUBOL2a2IL3f/3g8MFR/Yhe9gCiR/Z2Kgo1vHBNdxmLHJWX 0e+eyMrZwZGqGA62mM08EpbzwZ2lBYvBMe7Q9yDjf0S1y8UCdYX1RL/pEaf9Rx7dYoJw a5tV/rUIDH9PRmpKs9WJrdkjCCUK3g4/O2GWQcABX5IJj3liUqBCLzPQoMRxk2n2/LRZ EBaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=btNSggHe; 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 g5-20020a170906520500b00711da52c6e4si243621ejm.309.2022.10.28.18.49.46; Fri, 28 Oct 2022 18:50:10 -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=btNSggHe; 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 S229678AbiJ2BqA (ORCPT + 99 others); Fri, 28 Oct 2022 21:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiJ2Bpt (ORCPT ); Fri, 28 Oct 2022 21:45:49 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07EFA1DF43D for ; Fri, 28 Oct 2022 18:45:49 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id 3-20020a17090a0f8300b00212d5cd4e5eso11391272pjz.4 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=GU6n/HV3Ys0I9eWVLkrtNqCzVp+XHjOeeG/KSTeLrMWva70KObrBtfL+Y3Jwry2UdA Db0qmatv4eLBsvQf6BFFLGGUWRwWyJefaPHxtt2trT3gFCDhP6Lw/+HWrfUNCz4BVSvS pJSRxaXVR8L2nZADDSio7QIqgv4XouDYY75FELUuTapxTCtBXZYGYqKbIQ0p5k2FAEG+ A/xrzjV/X6b5ZbgYGZQHHIMj5kEzml35FkYEEODLCEj3TiDd65gU4k12DhekcxWV6IRy z8pmPSYfdPCLXQtXQbLNz5hEA0w7h1RWhw6WMiNAQkOqp6bEK4eXgRdilZegcVQ3x+cr N7RA== X-Gm-Message-State: ACrzQf1P8u/RQznTkNq48m0v/ZA7HpckFyq6SQGKEdiJqH8UcWIcX8ry HjjpK11/pb/Jrh0Tw1T3W4CcGw== 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 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?1747984801257049680?= X-GMAIL-MSGID: =?utf-8?q?1747984801257049680?= 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)