# USB 3.0 support slows boot

## quykfox

I was having some problems where my USB ports would stop working after a suspend/resume, which I fixed by enabling the Device Drivers -> USB Support > xHCI HCD (USB 3.0) support (CONFIG_USB_XHCI_HCD) option in my kernel configuration.  I do have USB 3.0 ports on my laptop, marked with the "SS" designation, so it made sense to me.  However, enabling this option causes a >200% increase in the boot time of the computer (confirmed by several trials).  While I would've expected some effect, this seems disproportionate.  I can't seem to find anyone else reporting this issue though, so I'm not sure...

I didn't find any revealing output in dmesg, though I'm not quite sure what to look for anyway.  I've tried with and without the generic xHCI platform driver sub-option, and it doesn't seem to have any effect.  Does anyone know what could be causing the slowdown, or where I should be looking to diagnose the issue if this is even abnormal?

Just some other information: I do not use an initial ram disk, I didn't disable the EHCI USB 2.0 option in the kernel, and I have 4 USB ports.

```

# lspci | grep -i usb

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)

00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)

00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)

```

----------

## fedeliallalinea

The output of

```
$ dmesg  | grep -i xhci
```

go back something?

----------

## quykfox

 *fedeliallalinea wrote:*   

> The output of
> 
> ```
> $ dmesg  | grep -i xhci
> ```
> ...

 

fedeliallalinea, I am not sure what you mean, but here is some output for you that might be helpful:

```

$ dmesg | grep -i "xhci\|ehci"

[    2.205270] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[    2.205272] ehci-pci: EHCI PCI platform driver

[    2.205370] ehci-pci 0000:00:1a.0: EHCI Host Controller

[    2.205411] ehci-pci 0000:00:1a.0: new USB bus registered, assigned bus number 1

[    2.205425] ehci-pci 0000:00:1a.0: debug port 2

[    2.209333] ehci-pci 0000:00:1a.0: cache line size of 64 is not supported

[    2.209342] ehci-pci 0000:00:1a.0: irq 16, io mem 0xb4a3e000

[    2.214987] ehci-pci 0000:00:1a.0: USB 2.0 started, EHCI 1.00

[    2.215012] usb usb1: Product: EHCI Host Controller

[    2.215013] usb usb1: Manufacturer: Linux 4.4.6-gentoo ehci_hcd

[    2.215335] ehci-pci 0000:00:1d.0: EHCI Host Controller

[    2.215446] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 2

[    2.215461] ehci-pci 0000:00:1d.0: debug port 2

[    2.219343] ehci-pci 0000:00:1d.0: cache line size of 64 is not supported

[    2.219349] ehci-pci 0000:00:1d.0: irq 23, io mem 0xb4a3d000

[    2.225025] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00

[    2.225065] usb usb2: Product: EHCI Host Controller

[    2.225066] usb usb2: Manufacturer: Linux 4.4.6-gentoo ehci_hcd

[    2.225484] xhci_hcd 0000:00:14.0: xHCI Host Controller

[    2.225591] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3

[    2.226683] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100 quirks 0x00009810

[    2.226688] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported

[    2.226805] usb usb3: Product: xHCI Host Controller

[    2.226806] usb usb3: Manufacturer: Linux 4.4.6-gentoo xhci-hcd

[    2.229888] xhci_hcd 0000:00:14.0: xHCI Host Controller

[    2.229928] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 4

[    2.229969] usb usb4: Product: xHCI Host Controller

[    2.229970] usb usb4: Manufacturer: Linux 4.4.6-gentoo xhci-hcd

[    2.517017] usb 1-1: new high-speed USB device number 2 using ehci-pci

[    2.527015] usb 2-1: new high-speed USB device number 2 using ehci-pci

[    2.582015] usb 3-11: new full-speed USB device number 2 using xhci_hcd

[    2.901013] usb 3-12: new high-speed USB device number 3 using xhci_hcd

```

This output was generated after I enabled (compiled in) CONFIG_USB_XHCI_HCI and CONFIG_USB_XHCI_PCI for my kernel.

The "cache line size" message is interesting, but I'm not sure if that's a problem or not.

----------

## fedeliallalinea

 *quykfox wrote:*   

> fedeliallalinea, I am not sure what you mean, but here is some output for you that might be helpful:

 

I was hoping to see something that would help, but all messages appear normal.

And try with an another version of kernel, the problem persist?

----------

## quykfox

I'm not sure.  Apologies for the delay; I'm having a trouble figuring out how to try a kernel different version without breaking my current setup.  Currently, I build my kernel (4.4.6-gentoo) from sys-kernel/gentoo-sources.

If I wanted to try with kernel version 4.7.2 (latest testing version), I believe I could edit my package.accept_keywords and run:

```
# emerge -a =sys-kernel/gentoo-sources-4.7.2
```

How difficult would it be to revert back to the current stable version (4.4.6), though?  I have an rsync backup of my system, but I don't trust that I would be able to restore anything too complex because of a problem with extended attributes that I'm still working on.

----------

## fedeliallalinea

 *quykfox wrote:*   

> How difficult would it be to revert back to the current stable version (4.4.6), though?  I have an rsync backup of my system, but I don't trust that I would be able to restore anything too complex because of a problem with extended attributes that I'm still working on.

 

If you don't remove old kernel in grub (you have grub?) you can choice with what boot

----------

## NeddySeagoon

quykfox,

kernels are slotted, so that the sources all go into /usr/src, side by side.

You can have several kernels installed so it becomes a boot time menu selection.

Take care with --depclean if you want to keep old kernels in /usr/src.  Its not required for them to continue to work as /usr/src/ is only nte build location.

----------

## quykfox

 *fedeliallalinea wrote:*   

>  *quykfox wrote:*   How difficult would it be to revert back to the current stable version (4.4.6), though?  I have an rsync backup of my system, but I don't trust that I would be able to restore anything too complex because of a problem with extended attributes that I'm still working on. 
> 
> If you don't remove old kernel in grub (you have grub?) you can choice with what boot

 

I'm using syslinux instead of grub; I can add a new entry in the boot menu without much trouble it seems.  It's more the source tree in /usr/src and whatever else sys-kernel/gentoo-sources installed on my system that I'm concerned about.

 *NeddySeagoon wrote:*   

> 
> 
> kernels are slotted, so that the sources all go into /usr/src, side by side. 
> 
> You can have several kernels installed so it becomes a boot time menu selection.
> ...

 

So, just to confirm, if I install sys-kernel/gentoo-sources-4.7.2 using the method I described previously it would be slotted alongside my current 4.4.6 (assuming I don't remove 4.4.6 with --depclean)?  And I would be able to use, modify, or remove either with (probably) no conflicts?  Sorry, I'm still trying to wrap my head around kernel management in portage here  :Embarassed: 

----------

## NeddySeagoon

quykfox,

Correct.  Like this

```
$ ls /usr/src

linux                  linux-4.4.6-gentoo  linux-4.6.4-beetterfly

linux-4.2.0-gentoo-r1  linux-4.5.0-gentoo  linux-4.7.0-gentoo

linux-4.3.3-gentoo     linux-4.5.1-gentoo  linux-4.7.1-gentoo

linux-4.4.5-gentoo     linux-4.6.0-gentoo
```

Even if you --depclean, the old source tarballs  will be in distfiles until you prune that.

A feature to be aware of is that things that build against the kernel follow the linux symlink to know which kernel to build against.

That's mostly out of tree kernel modules.

Its very easy to re(build) nvidia-drivers for the wrong kernel. 

Ebuilds also follow /usr/src/linux to check kernel settings.  They will warn but not fail if they don't like what they find.  Its quite common to build things on one system that will run on another. 

Users needing to go back in time can fetch the ebuild from git.

----------

