Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp258280pxy; Wed, 5 May 2021 01:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydo6D4n0BhUuvn1UF6xjHq823GomgTkqc8hY31QKMk/YCurt7r1KKFF631+juMV5d92KXn X-Received: by 2002:a17:906:a0c6:: with SMTP id bh6mr26162214ejb.359.1620202410507; Wed, 05 May 2021 01:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620202410; cv=none; d=google.com; s=arc-20160816; b=BBIwxkDlJyHhVHeUn4uPHM2hghAKFyq9mhSEOGJicaScsShi6KnKGy8jdS7B1N6gA/ rmmsn1t8DoOEZ3U2GIY3Q8qNtB1MrSo68zJKw/ILrizxJ1Vp1oioWJObnhBypg+rWyEL Dses/4bLENolpA7aGYHVqFFzGG68zlDmXImPajzreiu1+PGfKivEjHn/6GflsQjErI5Z NE1KA2SaPOAQaGDvcXWY8PAE5g7+n+lxpUEhuufhceauTPfOwXUodPSjOXr45rAdG17y gGtndQMWfurpECMPKzv+/m2AdUIz87CR97wMuNIiqug/gWHH+sw8jFS12+yWGQUHV1Ai tTog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wdSouZJwBvnkdmCW3DMsbKhWWHvkwwtilW5zRZtSzw0=; b=AgOXyZ1Ug3v3Og3Q98mKhtVhWckQtEsIPeOPn0wTqE97G+/WnYmeEouurqF5WR1pmb wHILdXMAQhLOCmAJeGsgMCA8hgaFnq0+Xe+iNL7GshcA/Y5wlQ7G0sH/B4YZ+FMIRbuX BnP7Fl59QMvxMoD5q2LWojD7/zceLmHT9RYaEgcZ4meySQO1ZiOKC3nHLyY53n0z0ZkB yJPJhqKWux2JMYaQuAF8/4RIHtzHJgAYn6jCxpiykDcBfF+nKn8tYIhFLEVJlIt5bt33 /V4NHD8eSWYlhkTaDt05oEAU0H9ZLNl0cRG1zgYluyDrcsmiG3HYpBZugYd24LucUrtY KddA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pvB3jtbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb8si16022182edb.103.2021.05.05.01.13.06; Wed, 05 May 2021 01:13:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pvB3jtbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231836AbhEEIMq (ORCPT + 99 others); Wed, 5 May 2021 04:12:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbhEEIMq (ORCPT ); Wed, 5 May 2021 04:12:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 81A5561078; Wed, 5 May 2021 08:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620202310; bh=2laNnaXDtXu5mpdO9hMOxhzvS3BWXU53ZPRV+2GL3xw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pvB3jtbocymI5+N/cmAdFfshGMT2Gqlj33c1jFLXzQnjjrpzhGwcsAjkEjAVW6tEq fV79+JTOntOEO1Nnrzd8y6W3i8Ft22A2cjnCUOnzaOuSoqYAMloBdFLn3K3xI/Qj5i UMI2kz6tCK9CnRILxn8n3BWwxwEG03bi/Ktl3VbQ= Date: Wed, 5 May 2021 10:11:47 +0200 From: Greg Kroah-Hartman To: Paul Menzel Cc: linux-usb@vger.kernel.org, LKML , Mathias Nyman , linux-pci@vger.kernel.org Subject: Re: `quirk_usb_handoff_xhci` takes 60 ms with ASM1042 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 05, 2021 at 09:57:44AM +0200, Paul Menzel wrote: > Dear Linux folks, > > > On an Asus F2A85-M PRO, BIOS 6601 11/25/2014, with an ASM1042 SuperSpeed USB > Host Controller [1b21:1042], and the xHCI drivers built as modules > > CONFIG_USB_XHCI_PCI=m > CONFIG_USB_XHCI_HCD=m > > `quirk_usb_handoff_xhci` takes 60 ms, which is 15 % of the time to reaching > `run_init_process()`. I addded some prints, showing the f > > [ 0.308841] pci 0000:03:00.0: PCI->APIC IRQ transform: INT A -> IRQ > 17 > [ 0.369858] pci 0000:03:00.0: handshake done with timeout = 0 > [ 0.369862] pci 0000:03:00.0: hc_init reached > [ 0.369865] pci 0000:03:00.0: second handshake done > [ 0.369869] pci 0000:03:00.0: third handshake done > [ 0.369909] pci 0000:03:00.0: quirk_usb_early_handoff+0x0/0x670 took > 59661 usecs > […] > [ 0.415223] Run /lib/systemd/systemd as init process > > Is there a way to optimize this, or move it out “the hot path”? That's the hardware taking so long, all that function does is make some PCI calls to the device. If the driver is built as a module, there should not be any "hot path" here as the module is loaded async when the device is discovered, right? What is waiting for this module to load in order to cause your init to stall? Perhaps fix your initramfs logic or build the driver into the kernel itself to take it off of this "load all the modules and wait" path? thanks, greg k-h