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) From patchwork Fri Oct 28 21:19:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1057523wru; Fri, 28 Oct 2022 14:44:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wPsep0h9I/F5WIiXemZcMVlYDuwOZw8PJFzBWvuqlJx5iJ4HlwJIl/4iE4yjxlYIWSljA X-Received: by 2002:a17:907:b08:b0:78e:2f4c:882c with SMTP id h8-20020a1709070b0800b0078e2f4c882cmr1220816ejl.293.1666993450830; Fri, 28 Oct 2022 14:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993450; cv=none; d=google.com; s=arc-20160816; b=Al5cL31qph+iEjNHjFNGEF8zYCMeDN+1LYHah4jHyAHG2DNwYypSNc+8UulGy/piMv n0+0ofMeMq9A7UlFEyKP7YDfCB7PCKZJVd+4tREs0F2Ujonjg+NY36WB6I842u6pwFYP UoKsPixx77lhl7D2TSftmvEsOZLsbr8GQii45QUROuuoiiBVo3XJ9fKZ62n+DPn2JTwa Ga+ZCRA6zUroM3uuICogS/WkdlZEFojK7rXW1e0n2dBFifOZW64hyoy7v+jRbUcflR3n 897ibUa6Zu1uSHsTEf1+m27yUkUNGCo9tsVa5dZFl2GCT9yJbsCYYgQTkoKbkvntt7X3 pTiA== 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=l3rdludOurvC4fVB6DK3mkTjnKTmpaPqFr2e/WcU1PY=; b=sGTXbBR4waWf0lrlCMGiTLOoqkZK+cSgh+YiwB/vKHtsUJuIwCyS090nDCLKHz5PEs /dc6N2Mf4y/QMT8igZp7qO05anvcZIhvRTOnmCe2iLk+28qXcg4h43ZOLXVV99Fp+CGx 3IC17UjzdNsYQ0yYitex2YdDxIEJwBtocdsvsDVCrUE5dDb9bXwd18x6X5c5LLaJNDgu OcGqu1l7pr7aXGoxui6JpXN0bjSNtGtkPKtbJao7Kk96W4f3sg4+a6dLZZ6J0qGdyJrE O1EGyKLmNLsgyEAqzQtNb1lbdgA61qLD3pP5zvlrsKfQPqWmRRRso+GUXPiMJ7DK0tc8 kVqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Ba7p35/O"; 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 z18-20020a05640235d200b00462bd784df2si2365169edc.542.2022.10.28.14.43.47; Fri, 28 Oct 2022 14:44: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="Ba7p35/O"; 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 S229663AbiJ1VT0 (ORCPT + 99 others); Fri, 28 Oct 2022 17:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiJ1VTU (ORCPT ); Fri, 28 Oct 2022 17:19:20 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD00B24AE1C for ; Fri, 28 Oct 2022 14:19:19 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id h185so5868842pgc.10 for ; Fri, 28 Oct 2022 14:19:19 -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=l3rdludOurvC4fVB6DK3mkTjnKTmpaPqFr2e/WcU1PY=; b=Ba7p35/O4HWTJ6gXbkKVc218UyBTKXLiCvsaBmMU9S9QH0SSlKGUaCiXW8I9NYRB33 EweO63dvPYeifzge13DmYlNPALfhSgTjMQR0KaVKRHjFlIbzijOPwCc/WlxEdAZFUG/P bgx7kY6bca4Hfm3vWZGLThlemm7c0jMCm53RQ= 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=l3rdludOurvC4fVB6DK3mkTjnKTmpaPqFr2e/WcU1PY=; b=xCMdB7b23qq4yP4lYffwyN/YsG0ljZDQ9pyawbttySoPhUZJgTgc8zam9wH8SMxI/c fP0MInPbwzMh/Ylty7F7X5V+tUvT0EcwY4+yLATq+n0L694b475/5YBNN+9ADwVHi/ZU Tfp+mn9CZ0vSOopxewHFgWEFhOPfGG00thTM+QEYxwSgsNmu1Ieab9qiDRE+6WDRvI3G zfXLtfGzfpOdEjKxhlcRKyA1Vrmm0msjqJOc3O2qs4ra6sMSj4VcevOA6RyQRnjxNaBh t4iQd26A3xEHGYA3PH39qCu5jWxNLRsvU86ibElt1/fomT6jY+T2oRQUyhXTq9FeLAee 5/9g== X-Gm-Message-State: ACrzQf0p8Wf9eUHv8cWx5gou9CGYl09ZPMuLqT9qZQ6mYc/niUyu9e/s GqpxlqGdgT1TJuBGh4N0hAzwdNtsFZFVbw== X-Received: by 2002:a63:1a07:0:b0:46b:2825:f9cf with SMTP id a7-20020a631a07000000b0046b2825f9cfmr1342652pga.370.1666991959465; Fri, 28 Oct 2022 14:19:19 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id f2-20020a623802000000b00550724f8ea0sm3250546pfa.128.2022.10.28.14.19.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:19:19 -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 2/2] usb: xhci-pci: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:19:08 -0700 Message-Id: <20221028141821.2.I5a309231785d3a4e37118a25e84f5caa0136a343@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028141821.1.I9a5353f81d1509f85f3a04f0cdc9099f6fe60811@changeid> References: <20221028141821.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=unavailable 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?1747969324842796504?= X-GMAIL-MSGID: =?utf-8?q?1747969324842796504?= 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 --- drivers/usb/host/xhci-pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 40228a3d77a0..4da03de1be70 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -689,7 +689,8 @@ static struct pci_driver xhci_pci_driver = { .shutdown = usb_hcd_pci_shutdown, #ifdef CONFIG_PM .driver = { - .pm = &usb_hcd_pci_pm_ops + .pm = &usb_hcd_pci_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, #endif };